LinuxSir.cn,穿越时空的Linuxsir!

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

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

[复制链接]
发表于 2007-8-21 08:41:28 | 显示全部楼层 |阅读模式
我的是 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的失败和这有关系吗
发表于 2007-8-21 08:43:56 | 显示全部楼层
出错信息是什么?
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-8-21 08:44:50 | 显示全部楼层
补充一下:  gcc -v 时,gcc的版本是4.1.2
回复 支持 反对

使用道具 举报

发表于 2007-8-21 09:31:34 | 显示全部楼层
gcc-config -l
信息都没有看什么呀?
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-8-21 20:03:58 | 显示全部楼层
我用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)
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-8-21 20:06:27 | 显示全部楼层
用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
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-8-22 09:32:23 | 显示全部楼层
是不是no-multilib的原因啊?
emerge glibc的时候,x86 和 x86_64的lib都编译,我加上no-multilib编译也失败了,
2个库不可能是用同一个gcc (x86_64-pc-linux-gnu-4.2.0) 编译出来的吧,
那编译x86的glibc库默认的gcc在什么地方可以改阿
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-8-22 14:42:32 | 显示全部楼层
是不是我的问题太初级,大虾们给个解决的方向阿?
回复 支持 反对

使用道具 举报

发表于 2007-8-22 14:56:20 | 显示全部楼层
方向是找更熟悉的人
比如找glibc开发者或者gentoo glibc维护者
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-8-22 21:00:53 | 显示全部楼层
问题解决了。
我的处理器是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。
回复 支持 反对

使用道具 举报

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

本版积分规则

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