LinuxSir.cn,穿越时空的Linuxsir!

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

LFS6.1编译glibc-2.3.4第一遍出错,提示符号重定义。

[复制链接]
发表于 2006-1-11 16:32:39 | 显示全部楼层 |阅读模式
提示如下:
/lfs/sources/glibc-build/csu/divdi3.os.dt -MT /lfs/sources/glibc-build/csu/divdi3.os
/tmp/ccpFwel2.s: Assembler messages:
/tmp/ccpFwel2.s:348: Error: symbol `__divdi3' is already defined
/tmp/ccpFwel2.s:425: Error: symbol `__moddi3' is already defined
/tmp/ccpFwel2.s:516: Error: symbol `__udivdi3' is already defined
/tmp/ccpFwel2.s:554: Error: symbol `__umoddi3' is already defined
make[2]: *** [/lfs/sources/glibc-build/csu/divdi3.os] Error 1
make[2]: Leaving directory `/lfs/sources/glibc-2.3.4/csu'
make[1]: *** [csu/subdir_lib] Error 2
make[1]: Leaving directory `/lfs/sources/glibc-2.3.4'
make: *** [all] Error 2

全部按照book操作,binutils没有使用livecd的,下载了2.16.91.0.4,不知有没有关系。
 楼主| 发表于 2006-1-12 18:21:07 | 显示全部楼层
换了livcd里的binutils,打上gcc4补丁,重新复制了linux-libc-headers,glibc编译通过,不知是因为binutils,还是headers。
回复 支持 反对

使用道具 举报

发表于 2006-3-13 12:43:50 | 显示全部楼层

glibc补丁:sysdeps/wordsize-32/symbol-hacks.h对新的gas汇编器反应的修正

原帖在 http://sources.redhat.com/ml/libc-alpha/2005-11/msg00033.html:

I think it is a glibc bug. It has

        __divdi3 = __divdi3_internal
        ...
__divdi3:

The new assembler rejects it.


H.J.
----
2005-11-08  H.J. Lu  <hongjiu.lu@intel.com>

        * sysdeps/wordsize-32/Makefile (CPPFLAGS-divdi3.c): Set to
        -Din_divdi3_c

        * sysdeps/wordsize-32/symbol-hacks.h: Skip if in_divdi3_c is
        defined.

--- sysdeps/wordsize-32/Makefile.as        2002-09-18 23:47:56.000000000 -0700
+++ sysdeps/wordsize-32/Makefile        2005-11-07 15:13:38.000000000 -0800
@@ -2,5 +2,6 @@ ifeq ($(subdir),csu)
ifeq (yes,$(build-shared))
sysdep_routines += divdi3
shared-only-routines += divdi3
+CPPFLAGS-divdi3.c = -Din_divdi3_c
endif
endif
--- sysdeps/wordsize-32/symbol-hacks.h.as        2004-03-08 12:59:34.000000000 -0800
+++ sysdeps/wordsize-32/symbol-hacks.h        2005-11-07 14:57:49.000000000 -0800
@@ -22,7 +22,7 @@
    therefore we get PLTs.  Unnecessarily so.  Changing gcc is a big
    task which might not be worth it so we play tricks with the
    assembler.  */
-#if !defined __ASSEMBLER__ && !defined NOT_IN_libc && defined SHARED
+#if !defined __ASSEMBLER__ && !defined in_divdi3_c && !defined NOT_IN_libc && defined SHARED
asm ("__divdi3 = __divdi3_internal");
asm ("__udivdi3 = __udivdi3_internal");
asm ("__moddi3 = __moddi3_internal");

打了以上补丁后,使用 binutils-2.16.91.0.6(用了新的gas汇编器)编译glibc-2.3.4不在出所述错误。
回复 支持 反对

使用道具 举报

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

本版积分规则

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