交叉编译时,ucLinux libbzip2出现重定位类型错误

4

我一直试图将libCurl包含在ucLinux中进行编译,但是每次在配置中包含curl时,它在尝试编译libbzip2时出现错误。

我正在为coldfire 68K处理器进行交叉编译。

它说PIC不支持重定位类型,但是我不知道如何解决这个问题。 我的印象是所有库都需要以PIC方式编译。

以下是输出内容:

make[4]: Entering directory `/home/lantronix/linuxsdk/linux/lib/libbzip2'
ucfront-gcc m68k-uclinux-gcc -mcpu=5208 -DCONFIG_COLDFIRE -O2 -g -fomit-frame-pointer -pipe -fno-common -fno-builtin -Wall   -DEMBED -fno-dwarf2-cfi-asm -msep-data -Dlinux -D__linux__ -Dunix -D__uClinux__ -c blocksort.c
ucfront-gcc m68k-uclinux-gcc -mcpu=5208 -DCONFIG_COLDFIRE -O2 -g -fomit-frame-pointer -pipe -fno-common -fno-builtin -Wall   -DEMBED -fno-dwarf2-cfi-asm -msep-data -Dlinux -D__linux__ -Dunix -D__uClinux__ -c huffman.c
ucfront-gcc m68k-uclinux-gcc -mcpu=5208 -DCONFIG_COLDFIRE -O2 -g -fomit-frame-pointer -pipe -fno-common -fno-builtin -Wall   -DEMBED -fno-dwarf2-cfi-asm -msep-data -Dlinux -D__linux__ -Dunix -D__uClinux__ -c crctable.c
ucfront-gcc m68k-uclinux-gcc -mcpu=5208 -DCONFIG_COLDFIRE -O2 -g -fomit-frame-pointer -pipe -fno-common -fno-builtin -Wall   -DEMBED -fno-dwarf2-cfi-asm -msep-data -Dlinux -D__linux__ -Dunix -D__uClinux__ -c randtable.c
ucfront-gcc m68k-uclinux-gcc -mcpu=5208 -DCONFIG_COLDFIRE -O2 -g -fomit-frame-pointer -pipe -fno-common -fno-builtin -Wall   -DEMBED -fno-dwarf2-cfi-asm -msep-data -Dlinux -D__linux__ -Dunix -D__uClinux__ -c compress.c
ucfront-gcc m68k-uclinux-gcc -mcpu=5208 -DCONFIG_COLDFIRE -O2 -g -fomit-frame-pointer -pipe -fno-common -fno-builtin -Wall   -DEMBED -fno-dwarf2-cfi-asm -msep-data -Dlinux -D__linux__ -Dunix -D__uClinux__ -c decompress.c
ucfront-gcc m68k-uclinux-gcc -mcpu=5208 -DCONFIG_COLDFIRE -O2 -g -fomit-frame-pointer -pipe -fno-common -fno-builtin -Wall   -DEMBED -fno-dwarf2-cfi-asm -msep-data -Dlinux -D__linux__ -Dunix -D__uClinux__ -c bzlib.c
ucfront-gcc m68k-uclinux-gcc -mcpu=5208 -DCONFIG_COLDFIRE -shared -Wl,-soname -Wl,libbz2.so.1.0 -o libbz2.so.1.0.3 blocksort.o huffman.o crctable.o randtable.o compress.o decompress.o bzlib.o
ERROR: reloc type R_68K_32 is not supported for PIC
ERROR: reloc type R_68K_32 is not supported for PIC
ERROR: reloc type R_68K_32 is not supported for PIC
ERROR: reloc type R_68K_32 is not supported for PIC
ERROR: reloc type R_68K_32 is not supported for PIC
ERROR: reloc type R_68K_32 is not supported for PIC
ERROR: reloc type R_68K_32 is not supported for PIC
ERROR: reloc type R_68K_32 is not supported for PIC
ERROR: reloc type R_68K_32 is not supported for PIC
ERROR: reloc type R_68K_32 is not supported for PIC
ERROR: reloc type R_68K_32 is not supported for PIC
ERROR: reloc type R_68K_32 is not supported for PIC
ERROR: reloc type R_68K_32 is not supported for PIC
ERROR: reloc type R_68K_32 is not supported for PIC
ERROR: reloc type R_68K_32 is not supported for PIC
ERROR: reloc type R_68K_32 is not supported for PIC
ERROR: reloc type R_68K_32 is not supported for PIC
ERROR: reloc type R_68K_32 is not supported for PIC
ERROR: reloc type R_68K_32 is not supported for PIC
ERROR: reloc type R_68K_32 is not supported for PIC
ERROR: reloc type R_68K_32 is not supported for PIC
ERROR: reloc type R_68K_32 is not supported for PIC
ERROR: reloc type R_68K_32 is not supported for PIC
ERROR: reloc type R_68K_32 is not supported for PIC
ERROR: reloc type R_68K_32 is not supported for PIC
ERROR: reloc type R_68K_32 is not supported for PIC
ERROR: reloc type R_68K_32 is not supported for PIC
ERROR: reloc type R_68K_32 is not supported for PIC
ERROR: reloc type R_68K_32 is not supported for PIC
ERROR: reloc type R_68K_32 is not supported for PIC
ERROR: reloc type R_68K_32 is not supported for PIC
ERROR: reloc type R_68K_32 is not supported for PIC
ERROR: reloc type R_68K_32 is not supported for PIC
ERROR: reloc type R_68K_32 is not supported for PIC
ERROR: reloc type R_68K_32 is not supported for PIC
ERROR: reloc type R_68K_32 is not supported for PIC
ERROR: reloc type R_68K_32 is not supported for PIC
ERROR: reloc type R_68K_32 is not supported for PIC
ERROR: reloc type R_68K_32 is not supported for PIC
ERROR: reloc type R_68K_32 is not supported for PIC
ERROR: reloc type R_68K_32 is not supported for PIC
ERROR: reloc type R_68K_32 is not supported for PIC
ERROR: reloc type R_68K_32 is not supported for PIC
43 bad relocs
/home/lantronix/linuxsdk/toolchains/freescale-coldfire-4.4/m68k-uclinux/bin/ld.real: warning: cannot find entry symbol _start; defaulting to 00000000
collect2: ld returned 1 exit status
make[4]: *** [all] Error 1
make[4]: Leaving directory `/home/lantronix/linuxsdk/linux/lib/libbzip2'
make[3]: *** [libbzip2] Error 2
make[3]: Leaving directory `/home/lantronix/linuxsdk/linux/lib'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/lantronix/linuxsdk/linux/lib'
make[1]: *** [subdirs] Error 1
make[1]: Leaving directory `/home/lantronix/linuxsdk/linux'
make: *** [build] Error 2

你尝试手动指定“-fPIC”了吗?整个构建需要它或者不需要它 - 不能混合使用。 - lynxlynxlynx
尝试重新编译而不使用-fPIC选项...(另外,请通知@我,因为我不会手动检查答案) - user2284570
1个回答

0

我发现去掉-msep-data标志(或在其后放置-mno-sep-data)可以消除这些警告。来自GCC doc page的内容如下:

生成允许数据段位于内存中不同区域的代码,以便在没有虚拟内存管理的环境中进行原地执行。此选项意味着-fPIC。

我还发现-fPIC-fno-PIC没有任何效果。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接