glibc 升级到2.6 编译出现的错误是是怎么回事

bbandrew 2008-06-23 01:39:06
在RH9下面做glibc的升级,用的是glibc2.6 + binutils-2.18+ gcc4.2.0
内核指定 到 linux2.6.20.7的include下!!!
../glibc-2.6/configure --prefix=/usr --with-headers=/home/xyz/build/linux-2.6.20.7/include 没出现错误
make命令的时候出现如下错误


/home/xyz/build/glibc-2.6-build/elf/librtld.os: In function `add_dependency':
/home/xyz/build/glibc-2.6/elf/dl-lookup.c:106: undefined reference to `__sync_fe
tch_and_add_4'
/home/xyz/build/glibc-2.6/elf/dl-lookup.c:110: undefined reference to `__sync_va
l_compare_and_swap_4'
/home/xyz/build/glibc-2.6-build/elf/librtld.os: In function `_dl_profile_fixup':
/home/xyz/build/glibc-2.6/elf/dl-runtime.c:196: undefined reference to `__sync_v
al_compare_and_swap_4'
/home/xyz/build/glibc-2.6/elf/dl-runtime.c:205: undefined reference to `__sync_f
etch_and_add_4'
/home/xyz/build/glibc-2.6-build/elf/librtld.os: In function `_dl_fixup':
/home/xyz/build/glibc-2.6/elf/dl-runtime.c:102: undefined reference to `__sync_v
al_compare_and_swap_4'
/home/xyz/build/glibc-2.6/elf/dl-runtime.c:110: undefined reference to `__sync_f
etch_and_add_4'
/home/xyz/build/glibc-2.6-build/elf/librtld.os: In function `dl_open_worker':
/home/xyz/build/glibc-2.6/elf/dl-open.c:425: undefined reference to `__sync_val_
compare_and_swap_4'
/home/xyz/build/glibc-2.6/elf/dl-open.c:427: undefined reference to `__sync_fetc
h_and_add_4'
/home/xyz/build/glibc-2.6-build/elf/librtld.os: In function `_dl_close_worker':
/home/xyz/build/glibc-2.6/elf/dl-close.c:407: undefined reference to `__sync_val
_compare_and_swap_4'
/home/xyz/build/glibc-2.6/elf/dl-close.c:409: undefined reference to `__sync_fet
ch_and_add_4'
collect2: ld ·µ»Ø 1
make[2]: *** [/home/xyz/build/glibc-2.6-build/elf/ld.so] Error 1
make[2]: Leaving directory `/home/xyz/build/glibc-2.6/elf'
make[1]: *** [elf/subdir_lib] Error 2


...全文
864 27 打赏 收藏 转发到动态 举报
写回复
用AI写文章
27 条回复
切换为时间正序
请发表友善的回复…
发表回复
bbandrew 2008-06-30
  • 打赏
  • 举报
回复
我也想换个内核和动态库版本都比较高的系统试试,免得再升级这么麻烦!
虽然问题没解决 ,这当中也学了不少东西,非常感谢大家!分数不多,大家将就点吧!!
fierygnu 2008-06-30
  • 打赏
  • 举报
回复
。。。
那还是换个新的系统试试吧,比如CentOS 5。
bbandrew 2008-06-29
  • 打赏
  • 举报
回复
undefined reference to 还是这样类似的错误
fierygnu 2008-06-27
  • 打赏
  • 举报
回复
跟哪个错误同样?
bbandrew 2008-06-27
  • 打赏
  • 举报
回复
还是不行,同样的错误,无奈了 是不是该换个思路 从根本上解决这个问题了? 避免glibc的升级
fierygnu 2008-06-27
  • 打赏
  • 举报
回复
设置CFLAGS="-g -O2 -march=i686"
bbandrew 2008-06-25
  • 打赏
  • 举报
回复
我之前 用原来的命令configure 没错误,然后 make 出现undefined reference to 的错误
然后加上 CFLAGS="-march=i686" 后configure 还是没出错,但make的时候
出现的错误大致是 error :glibc cannot be complied without optimization
fierygnu 2008-06-25
  • 打赏
  • 举报
回复
呵呵,就是开始编译的地方。
bbandrew 2008-06-25
  • 打赏
  • 举报
回复
我是新手啊,不好意思 ,出现gcc.. 的地方是什么意思呢 求助
fierygnu 2008-06-25
  • 打赏
  • 举报
回复
不是。要configure结束后,make,出现了gcc ...的地方,再做。
bbandrew 2008-06-25
  • 打赏
  • 举报
回复
ot@localhost glibc-2.6-build]# ../glibc-2.6/configure --prefix=/usr --with-headers=/home/xyz/build/linux-2.6.20.7/include
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
configure: running configure fragment for add-on nptl
checking sysdep dirs... sysdeps/i386/elf nptl/sysdeps/unix/sysv/linux/i386/i686 nptl/sysdeps/unix/sysv/linux/i386 sysdeps/unix/sysv/linux/i386 nptl/sysdeps/unix/sysv/linux nptl/sysdeps/pthread sysdeps/pthread sysdeps/unix/sysv/linux sysdeps/gnu sysdeps/unix/common sysdeps/unix/mman sysdeps/unix/inet sysdeps/unix/sysv/i386 nptl/sysdeps/unix/sysv sysdeps/unix/sysv sysdeps/unix/i386 nptl/sysdeps/unix sysdeps/unix sysdeps/posix sysdeps/i386/i686/fpu nptl/sysdeps/i386/i686 sysdeps/i386/i686 sysdeps/i386/i486 nptl/sysdeps/i386/i486 sysdeps/i386/fpu nptl/sysdeps/i386 sysdeps/i386 sysdeps/wordsize-32 sysdeps/ieee754/ldbl-96 sysdeps/ieee754/dbl-64 sysdeps/ieee754/flt-32 sysdeps/ieee754 sysdeps/generic/elf sysdeps/generic
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln -s works... yes
checking for gcc... gcc
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed


谢谢楼上.是到这个地方吗? 我到这个地方 停了 然后在加上 -march=i686 继续编译 还是出现了上述问题! 无奈了!!
fierygnu 2008-06-25
  • 打赏
  • 举报
回复
[Quote=引用 10 楼 bbandrew 的回复:]
在configure配置前加上CFLAGS="-march=i686"试试。
出现的错误大致是 error :glibc cannot be complied without optimization
[/Quote]
正常配置,编译,待出现gcc ....的时候中断,把其编译选项加上-march=i686都加到CFLAGS里,再试。

bbandrew 2008-06-25
  • 打赏
  • 举报
回复
我是在RH9 下升级的!也有可能是 glibc gcc binutils还有内核不匹配的问题
我用的版本分别是 gcc4.2.0(后来升级的) binutils2.18 原来内核2.4.20 指定新内核头文件版本2.6.20.7
有没有升级成功的, 说说你们都各自用的什么版本 ,是否匹配成功!!1
bbandrew 2008-06-25
  • 打赏
  • 举报
回复
还是没解决办法吗? 由于是新手走了太多弯路了,但问题还没解决呢. linux真是麻烦啊 !
pottichu 2008-06-24
  • 打赏
  • 举报
回复
《Linux 彻底定制指南
http://man.chinaunix.net/linux/lfs/LFS-6.1.1/index.html

这文档有详细的关于编译升级 glibc 的说明.
huailairen 2008-06-24
  • 打赏
  • 举报
回复
确认下你configure 的时候是不是有错误,
样子看上去应该是头文件的原因.
bbandrew 2008-06-24
  • 打赏
  • 举报
回复
我看了一下 关于内核升级的步骤,工作量太大了,我是个新手,配置文件越多,就越容易出错,而且有可能在内核升级过程中就崩溃可! 而且我现在用的是带串口工控机.我担心内核升级时配置不好,在别的方面又出很多问题!
还是希望各位 能帮忙找到我上述错误的根源!多谢!
bbandrew 2008-06-24
  • 打赏
  • 举报
回复
我用 --with-headers=/ 指定了新内核头文件了,还不可以吗?
非得要把内核升级吗?
AHZYZQ 2008-06-24
  • 打赏
  • 举报
回复
我建议先升级内核再升级glibc
bbandrew 2008-06-24
  • 打赏
  • 举报
回复
在configure配置前加上CFLAGS="-march=i686"试试。
出现的错误大致是 error :glibc cannot be complied without optimization
加载更多回复(7)

19,612

社区成员

发帖
与我相关
我的任务
社区描述
系统使用、管理、维护问题。可以是Ubuntu, Fedora, Unix等等
社区管理员
  • 系统维护与使用区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧