LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 2555|回复: 6

CLFS-SYSROOT - arm - 5.8. Glibc-2.6 configure时出错 - 已解决!

[复制链接]
发表于 2007-8-26 23:31:04 | 显示全部楼层 |阅读模式
  1. checking for ld --version-script... no
  2. *** WARNING: You should not compile GNU libc without versioning. Not using
  3. *** versioning will introduce incompatibilities so that old binaries
  4. *** will not run anymore.
  5. *** For versioning you need recent binutils (binutils-2.8.1.0.23 or newer).
  6. checking for .previous assembler directive... yes
  7. checking for .protected and .hidden assembler directive... yes
  8. checking whether __attribute__((visibility())) is supported... yes
  9. checking for broken __attribute__((visibility()))... no
  10. checking for broken __attribute__((alias()))... no
  11. checking whether to put _rtld_local into .sdata section... no
  12. checking for .preinit_array/.init_array/.fini_array support... no
  13. configure: error: Need linker with .init_array/.fini_array support.
复制代码


宿主系统:debian etch

  1. CLFS_HOST="i486-cross-linux-gnu"
  2. CLFS_TARGET="armeb-unknown-linux-gnu"
复制代码



config.log 中有这样两个错误:

  1. configure:5196: checking for ld --version-script
  2. configure:5222: armeb-unknown-linux-gnu-gcc -g -O2  -shared
  3.                                 -o conftest.so conftest.o
  4.                                 -nostartfiles -nostdlib
  5.                                 -Wl,--version-script,conftest.map
  6.                        1>&5
  7. /home/armeb-root/cross-tools/lib/gcc/armeb-unknown-linux-gnu/4.2.1/../../../../armeb-unknown-linux-gnu/bin/ld: unrecognised emulation mode: armelf_linux
  8. Supported emulations: armelfb_linux armelfb
  9. collect2: ld returned 1 exit status
复制代码

  1. configure:5481: checking for .preinit_array/.init_array/.fini_array support
  2. configure:5494: armeb-unknown-linux-gnu-gcc -g -O2   -o conftest conftest.c
  3.                      -static -nostartfiles -nostdlib 1>&5
  4. /home/armeb-root/cross-tools/lib/gcc/armeb-unknown-linux-gnu/4.2.1/../../../../armeb-unknown-linux-gnu/bin/ld: unrecognised emulation mode: armelf_linux
  5. Supported emulations: armelfb_linux armelfb
  6. collect2: ld returned 1 exit status
复制代码


看起来怎么像是binutils的问题?
 楼主| 发表于 2007-8-26 23:35:35 | 显示全部楼层
发错地方了,版主帮忙挪一下,谢啦!
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-8-28 16:38:44 | 显示全部楼层
Woo~
没人遇到么,google了很久也没有发现有用信息
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-8-28 17:36:18 | 显示全部楼层
看起来这个问题就是由于使用了大尾的CLFS_TARGET所致。使用员手册中的
CLFS_TARGET="arm-unknown-linux-gnu"
则没有错误。
唉,为什么自己动手建大尾的交叉编译工具链这么难呢?
谁有armeb经验,说一下呀!
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-8-28 19:50:16 | 显示全部楼层
很怪异的问题,应该是gcc没有正确产生大尾的目标工具。
做了以下的测试:
  1. clfs@debian:~$ echo "int main() {}" > test.c
  2. clfs@debian:~$ armeb-unknown-linux-gnu-gcc -c test.c
  3. clfs@debian:~$ file test.o
  4. test.o: ELF 32-bit MSB relocatable, ARM, version 1 (ARM), not stripped
复制代码
  1. clfs@debian:~$ armeb-unknown-linux-gnu-gcc -e main test.o
  2. /home/armeb-root/cross-tools/lib/gcc/armeb-unknown-linux-gnu/4.2.1/../../../../armeb-unknown-linux-gnu/bin/ld: unrecognised emulation mode: armelf_linux
  3. Supported emulations: armelfb_linux armelfb
  4. collect2: ld returned 1 exit status
复制代码
  1. clfs@debian:~$ armeb-unknown-linux-gnu-ld -e main test.o
  2. clfs@debian:~$ file a.out
  3. a.out: ELF 32-bit MSB executable, ARM, version 1 (ARM), statically linked, not stripped
复制代码
  1. clfs@debian:~$ /home/armeb-root/cross-tools/lib/gcc/armeb-unknown-linux-gnu/4.2.1/../../../../armeb-unknown-linux-gnu/bin/ld -e main test.o
  2. clfs@debian:~$ file a.out
  3. a.out: ELF 32-bit MSB executable, ARM, version 1 (ARM), statically linked, not stripped
复制代码

上面的结果很怪异,当gcc间接调用ld时就会出错,直接敲ld命令则没有出错,不解!!
遇到了gcc的bug么?
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-8-28 20:09:06 | 显示全部楼层
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-8-28 21:12:19 | 显示全部楼层
问题初步解决,放出patch。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表