LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
12
返回列表 发新帖
楼主: djstava

glibc编译出错,请高手帮忙,万分感谢!

[复制链接]
发表于 2007-12-5 16:19:36 | 显示全部楼层
楼主照11#的做即可
configre 时指定,例如
CFLAGS="-O2 -march=i686" ../glibc-2.7/configure –enable-shared –prefix=/usr –enable-profile=no –enable-add-ons –enable-kernel=2.6.23
(具体参数根据你的具体情况而定)
回复 支持 反对

使用道具 举报

发表于 2007-12-5 16:20:16 | 显示全部楼层
也可export ,例如
export CFLAGS="-O2 -march=i686"
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-12-5 17:11:36 | 显示全部楼层
谢谢楼上各位了,努力!!!
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-12-6 11:52:32 | 显示全部楼层
为什么我照着楼上做,错误信息还是一样?
回复 支持 反对

使用道具 举报

发表于 2007-12-6 21:42:54 | 显示全部楼层
到底执行过哪些命令?
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-12-7 09:28:55 | 显示全部楼层
我换了个版本2.5.1,竟然通过了。
回复 支持 反对

使用道具 举报

发表于 2007-12-12 18:17:26 | 显示全部楼层
我也试了下,命令如下:
#cd glibc-2.7-build
#[color="Red"]CFLAGS="-O2 -march=i686" ../glibc-2.7/configure --prefix=/opt/glibc-2.7 --disable-profile  --enable-kernel=2.6.0  --with-headers=/usr/src/linux/include
无错后make,报如下错误:

gcc   -shared -static-libgcc -Wl,-O1  -Wl,-z,defs -Wl,-dynamic-linker=/opt/glibc-2.7/lib/ld-linux.so.2  -B/root/source/glibc-build/csu/  -Wl,--version-script=/root/source/glibc-build/libc.map -Wl,-soname=libc.so.6 -Wl,-z,combreloc -Wl,-z,relro -nostdlib -nostartfiles -e __libc_main -L/root/source/glibc-build -L/root/source/glibc-build/math -L/root/source/glibc-build/elf -L/root/source/glibc-build/dlfcn -L/root/source/glibc-build/nss -L/root/source/glibc-build/nis -L/root/source/glibc-build/rt -L/root/source/glibc-build/resolv -L/root/source/glibc-build/crypt -L/root/source/glibc-build/nptl -Wl,-rpath-link=/root/source/glibc-build:/root/source/glibc-build/math:/root/source/glibc-build/elf:/root/source/glibc-build/dlfcn:/root/source/glibc-build/nss:/root/source/glibc-build/nis:/root/source/glibc-build/rt:/root/source/glibc-build/resolv:/root/source/glibc-build/crypt:/root/source/glibc-build/nptl -o /root/source/glibc-build/libc.so -T /root/source/glibc-build/shlib.lds /root/source/glibc-build/csu/abi-note.o /root/source/glibc-build/elf/soinit.os /root/source/glibc-build/libc_pic.os /root/source/glibc-build/elf/sofini.os /root/source/glibc-build/elf/interp.os /root/source/glibc-build/elf/ld.so -lgcc
/root/source/glibc-build/libc_pic.os: In function `__libc_fork':
../nptl/sysdeps/unix/sysv/linux/i386/../fork.c:76: undefined reference to `__sync_bool_compare_and_swap_4'
/root/source/glibc-build/libc_pic.os: In function `nscd_getpw_r':
/root/source/glibc-2.7/nscd/nscd-client.h:320: undefined reference to `__sync_fetch_and_add_4'
/root/source/glibc-build/libc_pic.os: In function `nscd_getpw_r':
/root/source/glibc-2.7/nscd/nscd_getpw_r.c:232: undefined reference to `__sync_fetch_and_add_4'
/root/source/glibc-build/libc_pic.os: In function `nscd_getgr_r':
/root/source/glibc-2.7/nscd/nscd-client.h:320: undefined reference to `__sync_fetch_and_add_4'
/root/source/glibc-build/libc_pic.os: In function `nscd_getgr_r':
/root/source/glibc-2.7/nscd/nscd_getgr_r.c:321: undefined reference to `__sync_fetch_and_add_4'
/root/source/glibc-build/libc_pic.os: In function `nscd_gethst_r':
/root/source/glibc-2.7/nscd/nscd-client.h:320: undefined reference to `__sync_fetch_and_add_4'
/root/source/glibc-build/libc_pic.os:/root/source/glibc-2.7/nscd/nscd_gethst_r.c:400: more undefined references to `__sync_fetch_and_add_4' follow
/root/source/glibc-build/libc_pic.os: In function `__nscd_get_map_ref':
/root/source/glibc-2.7/nscd/nscd_helper.c:404: undefined reference to `__sync_val_compare_and_swap_4'
/root/source/glibc-build/libc_pic.os: In function `*__GI___libc_freeres':
/root/source/glibc-2.7/malloc/set-freeres.c:39: undefined reference to `__sync_bool_compare_and_swap_4'
collect2: ld returned 1 exit status
make[1]: *** [/root/source/glibc-build/libc.so] Error 1
make[1]: Leaving directory `/root/source/glibc-2.7'
make: *** [all] Error 2
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-12-13 11:33:53 | 显示全部楼层
换成2.5.1,成功了,不明白2.7为什么不行?
回复 支持 反对

使用道具 举报

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

本版积分规则

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