Fail with cross-compiling (mips)
by circus78 from LinuxQuestions.org on (#50BQX)
Hi,
I am trying to cross-compile a software for mips-be architecture (my PC is: x86_64).
I am using toolchain from buildroot.org, with this command:
Code:$ CC=/home/darkstar/buildroot/output/host/bin/mips-buildroot-linux-uclibc-gcc ./configure --target=mips-buildroot-linux-gnu --host=mips-buildroot-linux-gnu --prefix=/tmp/code/The error I get is:
Code:Binary.o: relocations in generic ELF (EM: 8)
/usr/bin/ld: Binary.o: relocations in generic ELF (EM: 8)
/usr/bin/ld: Binary.o: error adding symbols: file in wrong format
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:457: code] Error 1
make[2]: Leaving directory '/home/darkstar/src/code/src'
make[1]: *** [Makefile:387: all-recursive] Error 1
make[1]: Leaving directory '/home/darkstar/src/code'
make: *** [Makefile:328: all] Error 2
I noticed that in Makefile, LDFLAGS is empty, so I tried to manually set to:
/home/darkstar/buildroot/output/host/mips-buildroot-linux-uclibc/bin/ld
but I got very same error.
Any suggestion?
Thank you very much!


I am trying to cross-compile a software for mips-be architecture (my PC is: x86_64).
I am using toolchain from buildroot.org, with this command:
Code:$ CC=/home/darkstar/buildroot/output/host/bin/mips-buildroot-linux-uclibc-gcc ./configure --target=mips-buildroot-linux-gnu --host=mips-buildroot-linux-gnu --prefix=/tmp/code/The error I get is:
Code:Binary.o: relocations in generic ELF (EM: 8)
/usr/bin/ld: Binary.o: relocations in generic ELF (EM: 8)
/usr/bin/ld: Binary.o: error adding symbols: file in wrong format
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:457: code] Error 1
make[2]: Leaving directory '/home/darkstar/src/code/src'
make[1]: *** [Makefile:387: all-recursive] Error 1
make[1]: Leaving directory '/home/darkstar/src/code'
make: *** [Makefile:328: all] Error 2
I noticed that in Makefile, LDFLAGS is empty, so I tried to manually set to:
/home/darkstar/buildroot/output/host/mips-buildroot-linux-uclibc/bin/ld
but I got very same error.
Any suggestion?
Thank you very much!