LinuxSir.cn,穿越时空的Linuxsir!

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

Help me!! lfs6.4 compiling glibc-2.8 errors!!!

[复制链接]
发表于 2008-12-26 17:18:56 | 显示全部楼层 |阅读模式
While compiling the glibc-2.8 in chapter 6,i encountered this problem.
mv -f /sources/glibc-build/shlib.ldsT /sources/glibc-build/shlib.lds
gcc   -shared -static-libgcc -Wl,-O1  -Wl,-z,defs -Wl,-dynamic-linker=/lib/ld-linux.so.2  -B/sources/glibc-build/csu/  -Wl,--version-script=/sources/glibc-build/libc.map -Wl,-soname=libc.so.6 -Wl,-z,combreloc -Wl,-z,relro -Wl,--hash-style=both -nostdlib -nostartfiles -e __libc_main -L/sources/glibc-build -L/sources/glibc-build/math -L/sources/glibc-build/elf -L/sources/glibc-build/dlfcn -L/sources/glibc-build/nss -L/sources/glibc-build/nis -L/sources/glibc-build/rt -L/sources/glibc-build/resolv -L/sources/glibc-build/crypt -L/sources/glibc-build/nptl -Wl,-rpath-link=/sources/glibc-build:/sources/glibc-build/math:/sources/glibc-build/elf:/sources/glibc-build/dlfcn:/sources/glibc-build/nss:/sources/glibc-build/nis:/sources/glibc-build/rt:/sources/glibc-build/resolv:/sources/glibc-build/crypt:/sources/glibc-build/nptl -o /sources/glibc-build/libc.so -T /sources/glibc-build/shlib.lds /sources/glibc-build/csu/abi-note.o /sources/glibc-build/elf/soinit.os /sources/glibc-build/libc_pic.os /sources/glibc-build/elf/sofini.os /sources/glibc-build/elf/interp.os /sources/glibc-build/elf/ld.so -lgcc
/sources/glibc-build/libc_pic.os: In function `__libc_fork':
/sources/glibc-2.8-20080929/posix/../nptl/sysdeps/unix/sysv/linux/i386/../fork.c:76: undefined reference to `__sync_bool_compare_and_swap_4'
/sources/glibc-build/libc_pic.os: In function `nscd_getpw_r':
/sources/glibc-2.8-20080929/nscd/nscd_getpw_r.c:232: undefined reference to `__sync_fetch_and_add_4'
/sources/glibc-build/libc_pic.os: In function `__nscd_drop_map_ref':
/sources/glibc-2.8-20080929/nscd/nscd-client.h:320: undefined reference to `__sync_fetch_and_add_4'
/sources/glibc-build/libc_pic.os: In function `nscd_getgr_r':
/sources/glibc-2.8-20080929/nscd/nscd_getgr_r.c:321: undefined reference to `__sync_fetch_and_add_4'
/sources/glibc-build/libc_pic.os: In function `__nscd_drop_map_ref':
/sources/glibc-2.8-20080929/nscd/nscd-client.h:320: undefined reference to `__sync_fetch_and_add_4'
/sources/glibc-build/libc_pic.os: In function `nscd_gethst_r':
/sources/glibc-2.8-20080929/nscd/nscd_gethst_r.c:400: undefined reference to `__sync_fetch_and_add_4'
/sources/glibc-build/libc_pic.os:/sources/glibc-2.8-20080929/nscd/nscd-client.h:320: more undefined references to `__sync_fetch_and_add_4' follow
/sources/glibc-build/libc_pic.os: In function `__nscd_get_map_ref':
/sources/glibc-2.8-20080929/nscd/nscd_helper.c:406: undefined reference to `__sync_val_compare_and_swap_4'
/sources/glibc-build/libc_pic.os: In function `*__GI___libc_freeres':
/sources/glibc-2.8-20080929/malloc/set-freeres.c:39: undefined reference to `__sync_bool_compare_and_swap_4'
collect2: ld returned 1 exit status
make[1]: *** [/sources/glibc-build/libc.so] Error 1
make[1]: Leaving directory `/sources/glibc-2.8-20080929'
make: *** [all] Error 2
root:/sources/glibc-build#


How can i resolve this problem??? I appreciate very much!
 楼主| 发表于 2008-12-26 20:00:51 | 显示全部楼层
经过搜索将 marh=i486 改成 i686后出现了新问题
/sources/glibc-build/csu/crt1.o: In function `_start':
(.text+0xc): undefined reference to `__libc_csu_fini'
/sources/glibc-build/csu/crt1.o: In function `_start':
(.text+0x11): undefined reference to `__libc_csu_init'
/sources/glibc-build/csu/crt1.o: In function `_start':
(.text+0x1d): undefined reference to `__libc_start_main'
/sources/glibc-build/elf/sln.o: In function `makesymlink':
/sources/glibc-2.8-20080929/elf/sln.c:143: undefined reference to `__lxstat'
/sources/glibc-2.8-20080929/elf/sln.c:151: undefined reference to `unlink'
/sources/glibc-2.8-20080929/elf/sln.c:166: undefined reference to `symlink'
/sources/glibc-2.8-20080929/elf/sln.c:172: undefined reference to `access'
/sources/glibc-2.8-20080929/elf/sln.c:184: undefined reference to `__errno_location'
/sources/glibc-2.8-20080929/elf/sln.c:184: undefined reference to `strerror'
/sources/glibc-2.8-20080929/elf/sln.c:185: undefined reference to `stderr'
/sources/glibc-2.8-20080929/elf/sln.c:185: undefined reference to `fprintf'
/sources/glibc-2.8-20080929/elf/sln.c:158: undefined reference to `__errno_location'
/sources/glibc-2.8-20080929/elf/sln.c:160: undefined reference to `strerror'
/sources/glibc-2.8-20080929/elf/sln.c:161: undefined reference to `stderr'
/sources/glibc-2.8-20080929/elf/sln.c:161: undefined reference to `fprintf'
/sources/glibc-2.8-20080929/elf/sln.c:147: undefined reference to `stderr'
/sources/glibc-2.8-20080929/elf/sln.c:147: undefined reference to `fprintf'
/sources/glibc-2.8-20080929/elf/sln.c:151: undefined reference to `__errno_location'
/sources/glibc-2.8-20080929/elf/sln.c:153: undefined reference to `stderr'
/sources/glibc-2.8-20080929/elf/sln.c:153: undefined reference to `fprintf'
/sources/glibc-2.8-20080929/elf/sln.c:174: undefined reference to `__errno_location'
/sources/glibc-2.8-20080929/elf/sln.c:174: undefined reference to `strerror'
/sources/glibc-2.8-20080929/elf/sln.c:175: undefined reference to `unlink'
/sources/glibc-build/elf/sln.o: In function `main':
/sources/glibc-2.8-20080929/elf/sln.c:52: undefined reference to `printf'
/sources/glibc-build/elf/sln.o: In function `makesymlinks':
/sources/glibc-2.8-20080929/elf/sln.c:72: undefined reference to `stdin'
/sources/glibc-build/elf/sln.o: In function `getline':
/sources/glibc-2.8-20080929/elf/../libio/bits/stdio.h:118: undefined reference to `__getdelim'
/sources/glibc-build/elf/sln.o: In function `makesymlinks':
/sources/glibc-2.8-20080929/elf/sln.c:40: undefined reference to `__ctype_b_loc'
/sources/glibc-2.8-20080929/elf/sln.c:129: undefined reference to `fclose'
/sources/glibc-2.8-20080929/elf/sln.c:75: undefined reference to `fopen'
/sources/glibc-2.8-20080929/elf/sln.c:78: undefined reference to `stderr'
/sources/glibc-2.8-20080929/elf/sln.c:78: undefined reference to `fprintf'
/sources/glibc-2.8-20080929/elf/sln.c:115: undefined reference to `stderr'
/sources/glibc-2.8-20080929/elf/sln.c:115: undefined reference to `fprintf'
collect2: ld returned 1 exit status
make[2]: *** [/sources/glibc-build/elf/sln] Error 1
make[2]: Leaving directory `/sources/glibc-2.8-20080929/elf'
make[1]: *** [elf/others] Error 2
make[1]: Leaving directory `/sources/glibc-2.8-20080929'
make: *** [all] Error 2
回复 支持 反对

使用道具 举报

发表于 2008-12-27 03:57:19 | 显示全部楼层
可能是GCC编译的有问题吧.
回复 支持 反对

使用道具 举报

发表于 2009-1-4 11:20:02 | 显示全部楼层
将glibc-2.8-20080929版本改为glibc-2.8-20081208应该没什么问题,我用后面的版本编译通过。
回复 支持 反对

使用道具 举报

发表于 2009-1-8 16:51:09 | 显示全部楼层
用glibc......1208的话,要不要patch,这个怎么才能从哪儿知道答案?
回复 支持 反对

使用道具 举报

发表于 2009-1-8 17:27:01 | 显示全部楼层
Post by jvava;1935780
用glibc......1208的话,要不要patch,这个怎么才能从哪儿知道答案?


don't patch
回复 支持 反对

使用道具 举报

发表于 2009-1-17 09:29:33 | 显示全部楼层
我碰见这个问题,改为glibc-2.8-20090112版本后make没有出错了,但是检查的时候有错,没有管他还是安装了,不知道后面会不会受影响
回复 支持 反对

使用道具 举报

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

本版积分规则

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