Closed N0body007 closed 2 years ago
If you just type make
and have all the build-dependencies listed in the README present, you will get four binaries:
_build/x86_64-w64-mingw32/spyre.exe
_build/i686-w64-mingw32/spyre.exe
_build/x86_64-linux-musl/spyre.exe
_build/i386-linux-musl/spyre.exe
The last one is your 32bit (i386) musl-libc-based statically linked binarry.
Or am I misunderstanding your question?
@N0body007 Does my answer help?
I’am sorry for taking so long to reply to you. I've been busy with other things recently and didn't pay attention to GitHub messages. I'am sorry again. I have read the makefile you wrote.But I want to build 32-bit program of linux on 64-bit linux using Linux terminal command. I have build 64-bit program of linux successfully using musl-gcc. But when I used the following command to build 32-bit program of linux on 64-bit linux, "GOOS=linux GOARCH=386 CGO_ENABLED=1 \ CC=musl-gcc \ PKG_CONFIG_PATH=${PREFIX_LINUX_MUSL}/lib/pkgconfig \ go build -ldflags '-extldflags "-static"' -tags yara_static -o simple-yara-musl ./_examples/simple-yara" I got the one of errors like this "/usr/bin/ld: i386 architecture of input file `/tmp/go-build2117339483/b062/_x008.o' is incompatible with i386:x86-64 output". I don't know how to specify the lib of 32-bit musl gcc.Could you help me out?Thanks again.
Try setting CGO_CFLAGS=-m32
for building i386 objects. This only works with the patch applied by _3rdparty)/patch-musl-spec.sh
, though.
Thank you very much for your answer. Through your answer, I know how to solve this problem.
Glad I could help. Closing the issue now.
Hi, I don't know how to build for 32-bit program of linux on 64-bit linux using musl-gcc, just like the spyre of i386-linux-musl, which I don't know how to generate on 64-bit linux. I have searched a lot,but don't find the solution.Could you help me out? Thanks in advance.