Closed azman0101 closed 9 years ago
You have a typo in your compilation command, if you check INTERLOCK README file the command uses CGO_ENABLED and not CGO_ENABLE.
Let me know if this is the issue so that I can close the ticket.
Thanks!
I build Go as the doc says:
./all.bash
I got this error:
make GOARCH=arm CC=/usr/bin/arm-linux-gnueabihf-gcc-ar-4.8 CGO_ENABLED=1
cd src && GOPATH="/home/dev/interlock" go build -ldflags "-X main.InterlockBuild \"dev@dev on 2015-06-27 13:32:50\"" -o ../interlock
# runtime/cgo
/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/../../../../arm-linux-gnueabihf/bin/ar: invalid option -- 'E'
Usage: /usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/../../../../arm-linux-gnueabihf/bin/ar [emulation options] [-]{dmpqrstx}[abcDfilMNoPsSTuvV] [--plugin <name>] [member-name] [count] archive-file file...
/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/../../../../arm-linux-gnueabihf/bin/ar -M [<mri-script]
commands:
d - delete file(s) from the archive
m[ab] - move file(s) in the archive
p - print file(s) found in the archive
q[f] - quick append file(s) to the archive
r[ab][f][u] - replace existing or insert new file(s) into the archive
s - act as ranlib
t - display contents of archive
x[o] - extract file(s) from the archive
command specific modifiers:
[a] - put file(s) after [member-name]
[b] - put file(s) before [member-name] (same as [i])
[D] - use zero for timestamps and uids/gids
[U] - use actual timestamps and uids/gids (default)
[N] - use instance [count] of name
[f] - truncate inserted file names
[P] - use full path names when matching
[o] - preserve original dates
[u] - only replace files that are newer than current archive contents
generic modifiers:
[c] - do not warn if the library had to be created
[s] - create an archive index (cf. ranlib)
[S] - do not build a symbol table
[T] - make a thin archive
[v] - be verbose
[V] - display the version number
@<file> - read options from <file>
--target=BFDNAME - specify the target object format as BFDNAME
optional:
--plugin <p> - load the specified plugin
emulation options:
No emulation specific options
/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/../../../../arm-linux-gnueabihf/bin/ar: supported targets: elf32-littlearm elf32-bigarm elf32-little elf32-big plugin srec symbolsrec verilog tekhex binary ihex
go tool: no such tool "5g"
make: *** [build] Erreur 3
Then I've build Go like this:
sudo GOOS=linux GOARCH=arm ./make.bash --no-clean
And then:
make GOARCH=arm CC=/usr/bin/arm-linux-gnueabihf-gcc-ar-4.8 CGO_ENABLED=1
cd src && GOPATH="/home/dev/interlock" go build -ldflags "-X main.InterlockBuild \"dev@dev on 2015-06-27 13:37:58\"" -o ../interlock
# runtime/cgo
/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/../../../../arm-linux-gnueabihf/bin/ar: invalid option -- 'E'
Usage: /usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/../../../../arm-linux-gnueabihf/bin/ar [emulation options] [-]{dmpqrstx}[abcDfilMNoPsSTuvV] [--plugin <name>] [member-name] [count] archive-file file...
/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/../../../../arm-linux-gnueabihf/bin/ar -M [<mri-script]
commands:
d - delete file(s) from the archive
m[ab] - move file(s) in the archive
p - print file(s) found in the archive
q[f] - quick append file(s) to the archive
r[ab][f][u] - replace existing or insert new file(s) into the archive
s - act as ranlib
t - display contents of archive
x[o] - extract file(s) from the archive
command specific modifiers:
[a] - put file(s) after [member-name]
[b] - put file(s) before [member-name] (same as [i])
[D] - use zero for timestamps and uids/gids
[U] - use actual timestamps and uids/gids (default)
[N] - use instance [count] of name
[f] - truncate inserted file names
[P] - use full path names when matching
[o] - preserve original dates
[u] - only replace files that are newer than current archive contents
generic modifiers:
[c] - do not warn if the library had to be created
[s] - create an archive index (cf. ranlib)
[S] - do not build a symbol table
[T] - make a thin archive
[v] - be verbose
[V] - display the version number
@<file> - read options from <file>
--target=BFDNAME - specify the target object format as BFDNAME
optional:
--plugin <p> - load the specified plugin
emulation options:
No emulation specific options
/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/../../../../arm-linux-gnueabihf/bin/ar: supported targets: elf32-littlearm elf32-bigarm elf32-little elf32-big plugin srec symbolsrec verilog tekhex binary ihex
make: *** [build] Erreur 2
Your cross compiling environment has some issues, it might be not modern enough or not configured correctly. Rather than debugging those I suggest you build INTERLOCK directly on the target (which I am assuming it is the USB armory). If you want to try and fix your cross compiling environment you can try and set it up as suggested at https://github.com/inversepath/usbarmory/wiki/Preparing-a-bootable-microSD-image.
Keep in mind that if you are building for a non-ARM host (like an x86 machine) then cross compiling is not necessary and you can just use make.
I personally find it easier to just have native arm Go and compile INTERLOCK on my USB armory directly.
Thanks for your help. As you mentioned before, my cross compiling environment has some issues.
Hello,
I've installed Golang on a Linux VM
Cross-complied with this command:
And then, after following the tutoriel for encryptedfs creation: