尝试为ARM交叉编译Erlang R13B04时失败

时间:2010-09-12 16:14:36

标签: erlang arm cross-compiling

我正在尝试交叉编译Erlang并遇到一个奇怪的错误。使用的命令是

make clean

./otp_build configure --host=arm-none-linux-gnueabi --build=i686-pc-linux-gnu 
--prefix=/opt/erlang erl_xcomp_sysroot=~/sbctools/arm-2007q3 --disable-hipe 
--disable-threads --disable-smp --disable-megaco-flex-scanner-lineno 
--disable-megaco-reentrant-flex-scanner --disable-dynamic-ssl-lib 
--without-termcap --without-javac --without-ssl

./otp_build boot

他们的输出可以在http://gist.github.com/576199看到(它太大了,不能粘贴在这里),但是结束这个过程的错误是

/home/aromanov/sbctools/arm-2007q3/bin/../lib/gcc/arm-none-linux-gnueabi/4.2.1/../../../../arm-none-linux-gnueabi/bin/ld: /home/aromanov/otp_src/erts/emulator/zlib/obj/arm-none-linux-gnueabi/opt/libz.a(adler32.o): Relocations in generic ELF (EM: 3)
/home/aromanov/sbctools/arm-2007q3/bin/../lib/gcc/arm-none-linux-gnueabi/4.2.1/../../../../arm-none-linux-gnueabi/bin/ld: /home/aromanov/otp_src/erts/emulator/zlib/obj/arm-none-linux-gnueabi/opt/libz.a(adler32.o): Relocations in generic ELF (EM: 3)
/home/aromanov/sbctools/arm-2007q3/bin/../lib/gcc/arm-none-linux-gnueabi/4.2.1/../../../../arm-none-linux-gnueabi/bin/ld: /home/aromanov/otp_src/erts/emulator/zlib/obj/arm-none-linux-gnueabi/opt/libz.a(adler32.o): Relocations in generic ELF (EM: 3)
/home/aromanov/sbctools/arm-2007q3/bin/../lib/gcc/arm-none-linux-gnueabi/4.2.1/../../../../arm-none-linux-gnueabi/bin/ld: /home/aromanov/otp_src/erts/emulator/zlib/obj/arm-none-linux-gnueabi/opt/libz.a(adler32.o): Relocations in generic ELF (EM: 3)
/home/aromanov/sbctools/arm-2007q3/bin/../lib/gcc/arm-none-linux-gnueabi/4.2.1/../../../../arm-none-linux-gnueabi/bin/ld: /home/aromanov/otp_src/erts/emulator/zlib/obj/arm-none-linux-gnueabi/opt/libz.a(adler32.o): Relocations in generic ELF (EM: 3)
/home/aromanov/otp_src/erts/emulator/zlib/obj/arm-none-linux-gnueabi/opt/libz.a: could not read symbols: File in wrong format
collect2: ld returned 1 exit status
make[3]: *** [/home/aromanov/otp_src/bin/arm-none-linux-gnueabi/beam] Error 1
make[3]: Leaving directory `/home/aromanov/otp_src/erts/emulator'
make[2]: *** [opt] Error 2
make[2]: Leaving directory `/home/aromanov/otp_src/erts/emulator'
make[1]: *** [opt] Error 2
make[1]: Leaving directory `/home/aromanov/otp_src/erts'
make: *** [emulator] Error 2

确实,查看~/otp_src/erts/emulator/zlib/obj/arm-none-linux-gnueabi/opt/libz.a显示它是为英特尔30386编译的。但为什么呢?我怎么能避免它?

编辑:~/sbctools/arm-2007q3/binPATH中的第一个目录。我是否也需要添加其他工具链目录?

1 个答案:

答案 0 :(得分:1)

make[4]: Entering directory /home/aromanov/otp_src/erts/emulator/zlib'
make -f arm-none-linux-gnueabi/Makefile TYPE=opt
make[5]: Entering directory/home/aromanov/otp_src/erts/emulator/zlib'
make[5]: Nothing to be done for all'.
make[5]: Leaving directory/home/aromanov/otp_src/erts/emulator/zlib'
make[4]: Leaving directory `/home/aromanov/otp_src/erts/emulator/zlib'

看起来你之前构建了zlib部件......当它没有正确配置时。 尝试/home/aromanov/otp_src/erts/emulator/zlib' make -f arm-none-linux-gnueabi/Makefile TYPE=opt make[5]: Entering directoryall'. make[5]: Leaving directory,然后重新编译。