+ -
当前位置:首页 → 问答吧 → [已解决] 标题: glibc 2.6.1 更新失败

[已解决] 标题: glibc 2.6.1 更新失败

时间:2007-08-21

来源:互联网

我的是 2.6.22内核,昨天更新的portage, emerge --update --deep --newuse world,更新到glib-2.6.1的时候就出错了, gcc 版本原先是4.1.2,
gcc 4.20在emerge world的时候已经编译过了,
运行emerge -p gcc, 版本是gcc 4.2.0,
为什么版本还是以前的4.1.2, glibc2.6.1的失败和这有关系吗

作者: grety   发布时间: 2007-08-21

出错信息是什么?

作者: sheep204   发布时间: 2007-08-21

补充一下: gcc -v 时,gcc的版本是4.1.2

作者: grety   发布时间: 2007-08-21

gcc-config -l
信息都没有看什么呀?

作者: axlrose   发布时间: 2007-08-21

我用gcc-config 把gcc switch 成4.2.0。
gcc-config -l
[1] x86_64-pc-linux-gnu-4.1.2
[2] x86_64-pc-linux-gnu-4.2.0 *

gcc -v
Using built-in specs. Target: x86_64-pc-linux-gnu Configured with: /var/tmp/portage/sys-devel/gcc-4.2.0/work/gcc-4.2.0/configure --prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/4.2.0 --includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.2.0/include --datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.2.0 --mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.2.0/man --infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.2.0/info --with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.2.0/include/g++-v4 --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --disable-altivec --enable-nls --without-included-gettext --with-system-zlib --disable-checking --disable-werror --enable-secureplt --disable-libunwind-exceptions --enable-multilib --enable-libmudflap --disable-libssp --disable-libgcj --enable-languages=c,c++,fortran --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu Thread model: posix gcc version 4.2.0 (Gentoo 4.2.0 p1.4)

作者: grety   发布时间: 2007-08-22

用gcc 4.2.0 编译 出错信息如下:

: /var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/libc_nonshared.a x86_64-pc-linux-gnu-gcc -nostdlib -nostartfiles -r -o /var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/libc_pic.os \
-Wl,-d -Wl,--whole-archive /var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/libc_pic.a x86_64-pc-linux-gnu-gcc -shared -Wl,-O1 \
-nostdlib -nostartfiles \
-Wl,-dynamic-linker=/lib32/ld-linux.so.2 -Wl,-z,combreloc -Wl,-z,relro -Wl,--hash-style=both \
-Wl,--verbose 2>&1 | \ sed > /var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/shlib.ldsT \
-e '/^=========/,/^=========/!d;/^=========/d' \
-e 's/^.*\.gnu\.hash[ ]*:.*$/ .note.ABI-tag : { *(.note.ABI-tag) } &/' -e '/^[ ]*\.hash[ ]*:.*$/{h;d;}' -e '/DATA_SEGMENT_ALIGN/{H;g}' \
-e 's/^.*\*(\.dynbss).*$/& \ PROVIDE(__start___libc_freeres_ptrs = .); \
*(__libc_freeres_ptrs) \
PROVIDE(__stop___libc_freeres_ptrs = .);/'\
-e 's@^.*\*(\.jcr).*$@& \ PROVIDE(__start___libc_subfreeres = .);\
__libc_subfreeres : { *(__libc_subfreeres) }\
PROVIDE(__stop___libc_subfreeres = .);\
PROVIDE(__start___libc_atexit = .);\
__libc_atexit : { *(__libc_atexit) }\
PROVIDE(__stop___libc_atexit = .);\
PROVIDE(__start___libc_thread_subfreeres = .);\ __libc_thread_subfreeres : { *(__libc_thread_subfreeres) }\
PROVIDE(__stop___libc_thread_subfreeres = .);\
/DISCARD/ : { *(.gnu.glibc-stub.*) }@' mv -f /var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/shlib.ldsT /var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/shlib.lds x86_64-pc-linux-gnu-gcc -shared -static-libgcc -Wl,-O1 -Wl,-z,defs -Wl,-dynamic-linker=/lib32/ld-linux.so.2 -B/var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/csu/ -Wl,--version-script=/var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/libc.map -Wl,-soname=libc.so.6 -Wl,-z,combreloc -Wl,-z,relro -Wl,--hash-style=both -nostdlib -nostartfiles -e __libc_main -Wl,-z,now -L/var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl -L/var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/math -L/var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/elf -L/var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/dlfcn -L/var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/nss -L/var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/nis -L/var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/rt -L/var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/resolv -L/var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/crypt -L/var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/nptl -Wl,-rpath-link=/var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl:/var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/math:/var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/elf:/var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/dlfcn:/var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/nss:/var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/nis:/var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/rt:/var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/resolv:/var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/crypt:/var/tmp/ e/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/nptl -o /var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/libc.so -T /var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/shlib.lds /var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/csu/abi-note.o /var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/elf/soinit.os /var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/libc_pic.os /var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/elf/sofini.os /var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/elf/interp.os /var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/elf/ld.so -lgcc /var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/libc_pic.os: In function `__fork': (.text+0x78e6f): undefined reference to `__sync_bool_compare_and_swap_4' /var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/libc_pic.os: In function `nscd_getpw_r': nscd_getpw_r.c:(.text+0xda747): undefined reference to `__sync_fetch_and_add_4' nscd_getpw_r.c:(.text+0xda78b): undefined reference to `__sync_fetch_and_add_4' /var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/libc_pic.os: In function `nscd_getgr_r': nscd_getgr_r.c:(.text+0xdab8b): undefined reference to `__sync_fetch_and_add_4' nscd_getgr_r.c:(.text+0xdabd0): undefined reference to `__sync_fetch_and_add_4' /var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/libc_pic.os: In function `nscd_gethst_r': nscd_gethst_r.c:(.text+0xdb22d): undefined reference to `__sync_fetch_and_add_4' /var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/libc_pic.os:nscd_gethst_r.c:(.text+0xdb274): more undefined references to `__sync_fetch_and_add_4' follow /var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/libc_pic.os: In function `__nscd_get_map_ref': (.text+0xdd200): undefined reference to `__sync_val_compare_and_swap_4' /var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/libc_pic.os: In function `__GI___libc_freeres': (__libc_freeres_fn+0x87e): undefined reference to `__sync_bool_compare_and_swap_4' collect2: ld returned 1 exit status make[1]: *** [/var/tmp/portage/sys-libs/glibc-2.6.1/work/build-x86-x86_64-pc-linux-gnu-nptl/libc.so] Error 1 make[1]: Leaving directory `/var/tmp/portage/sys-libs/glibc-2.6.1/work/glibc-2.6.1' make: *** [all] Error 2
*
* ERROR: sys-libs/glibc-2.6.1 failed.
* Call stack:
* ebuild.sh, line 1654: Called dyn_compile
* ebuild.sh, line 990: Called qa_call 'src_compile'
* ebuild.sh, line 44: Called src_compile
* glibc-2.6.1.ebuild, line 147: Called eblit-run 'src_compile'
* glibc-2.6.1.ebuild, line 143: Called eblit-glibc-src_compile
* src_compile.eblit, line 168: Called src_compile
* glibc-2.6.1.ebuild, line 147: Called eblit-run 'src_compile'
* glibc-2.6.1.ebuild, line 143: Called eblit-glibc-src_compile
* src_compile.eblit, line 179: Called toolchain-glibc_src_compile
* src_compile.eblit, line 122: Called die
*
* make for x86 failed

作者: grety   发布时间: 2007-08-22

是不是no-multilib的原因啊?
emerge glibc的时候,x86 和 x86_64的lib都编译,我加上no-multilib编译也失败了,
2个库不可能是用同一个gcc (x86_64-pc-linux-gnu-4.2.0) 编译出来的吧,
那编译x86的glibc库默认的gcc在什么地方可以改阿

作者: grety   发布时间: 2007-08-22

是不是我的问题太初级,大虾们给个解决的方向阿?

作者: grety   发布时间: 2007-08-22

方向是找更熟悉的人
比如找glibc开发者或者gentoo glibc维护者

作者: zhllg   发布时间: 2007-08-22

问题解决了。
我的处理器是Core 2 Duo,
GCC 4.2,CFLAGS 添加 -march=nocona -mtune=generic。

如果是GCC 4.1,Core Solo/Duo使用-march=prescott;
Core 2 Duo/Solo则使用-march=nocona。

作者: grety   发布时间: 2007-08-23