当前位置: 技术问答>linux和unix
glibc 升级到2.6 编译出现的错误是是怎么回事
来源: 互联网 发布时间:2016-03-29
本文导语: 在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命令的时候...
在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
内核指定 到 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
|
确认下你configure 的时候是不是有错误,
样子看上去应该是头文件的原因.
样子看上去应该是头文件的原因.
|
《Linux 彻底定制指南
http://man.chinaunix.net/linux/lfs/LFS-6.1.1/index.html
这文档有详细的关于编译升级 glibc 的说明.
http://man.chinaunix.net/linux/lfs/LFS-6.1.1/index.html
这文档有详细的关于编译升级 glibc 的说明.
|
uname -m返回什么?
|
在configure配置前加上CFLAGS="-march=i686"试试。
|
我建议先升级内核再升级glibc
|
正常配置,编译,待出现gcc ....的时候中断,把其编译选项加上-march=i686都加到CFLAGS里,再试。
|
不是。要configure结束后,make,出现了gcc ...的地方,再做。
|
呵呵,就是开始编译的地方。
|
设置CFLAGS="-g -O2 -march=i686"
|
跟哪个错误同样?