LinuxSir.cn,穿越时空的Linuxsir!

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

【help】lfs6.6 glibc-2.11.1 第一次编译错误

[复制链接]
发表于 2010-6-13 15:55:25 | 显示全部楼层 |阅读模式
/mnt/lfs/sources/glibc-2.11.1/posix/../nptl/sysdeps/unix/sysv/linux/i386/../fork.c:79: undefined reference to `__sync_bool_compare_and_swap_4'
/mnt/lfs/sources/glibc-build/libc_pic.os: In function `__nscd_drop_map_ref':
/mnt/lfs/sources/glibc-2.11.1/nscd/nscd-client.h:320: undefined reference to `__sync_fetch_and_add_4'
/mnt/lfs/sources/glibc-build/libc_pic.os: In function `nscd_getpw_r':
/mnt/lfs/sources/glibc-2.11.1/nscd/nscd_getpw_r.c:233: undefined reference to `__sync_fetch_and_add_4'
/mnt/lfs/sources/glibc-build/libc_pic.os: In function `__nscd_drop_map_ref':
/mnt/lfs/sources/glibc-2.11.1/nscd/nscd-client.h:320: undefined reference to `__sync_fetch_and_add_4'
/mnt/lfs/sources/glibc-build/libc_pic.os: In function `nscd_getgr_r':
/mnt/lfs/sources/glibc-2.11.1/nscd/nscd_getgr_r.c:322: undefined reference to `__sync_fetch_and_add_4'
/mnt/lfs/sources/glibc-build/libc_pic.os: In function `__nscd_drop_map_ref':
/mnt/lfs/sources/glibc-2.11.1/nscd/nscd-client.h:320: undefined reference to `__sync_fetch_and_add_4'
/mnt/lfs/sources/glibc-build/libc_pic.os:/mnt/lfs/sources/glibc-2.11.1/nscd/nscd_gethst_r.c:415: more undefined references to `__sync_fetch_and_add_4' follow
/mnt/lfs/sources/glibc-build/libc_pic.os: In function `__nscd_get_map_ref':
/mnt/lfs/sources/glibc-2.11.1/nscd/nscd_helper.c:433: undefined reference to `__sync_val_compare_and_swap_4'
/mnt/lfs/sources/glibc-build/libc_pic.os: In function `*__GI___libc_freeres':
/mnt/lfs/sources/glibc-2.11.1/malloc/set-freeres.c:39: undefined reference to `__sync_bool_compare_and_swap_4'
collect2: ld returned 1 exit status
make[1]: *** [/mnt/lfs/sources/glibc-build/libc.so] Error 1
make[1]: Leaving directory `/mnt/lfs/sources/glibc-2.11.1'
make: *** [install] Error 2
发表于 2010-6-22 04:34:25 | 显示全部楼层
我的也出错


../sysdeps/i386/fpu/s_frexp.S:66: Error: invalid identifier for ".ifdef"                       
../sysdeps/i386/fpu/s_frexp.S:66: Error: junk at end of line, first unrecognized character is `1'
../sysdeps/i386/fpu/s_frexp.S:66: Error: junk at end of line, first unrecognized character is `1'
../sysdeps/i386/fpu/s_frexp.S:66: Error: junk at end of line, first unrecognized character is `1'
../sysdeps/i386/fpu/s_frexp.S:66: Error: junk at end of line, first unrecognized character is `.'
../sysdeps/i386/fpu/s_frexp.S:66: Error: junk at end of line, first unrecognized character is `1'
../sysdeps/i386/fpu/s_frexp.S:66: Error: expected comma after name `' in .size directive
../sysdeps/i386/fpu/s_frexp.S:66: Error: ".endif" without ".if"
../sysdeps/i386/fpu/s_frexp.S:66: Error: junk `.get_pc_thunk.dx' after expression
make[2]: *** [/mnt/lfs/make/glibc-build/math/s_frexp.os] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory `/mnt/lfs/make/glibc-2.11.1/math'
make[1]: *** [math/subdir_lib] Error 2
make[1]: Leaving directory `/mnt/lfs/make/glibc-2.11.1'
make: *** [all] Error 2
同求解


已解
改变/mnt/lfs的权限
组lfs 用户lfs
回复 支持 反对

使用道具 举报

发表于 2010-8-1 03:53:57 | 显示全部楼层
一楼用的应该是Debian,二楼用的应该是Red Hat。
../configure --prefix=/usr/ --with-tls --with-cpu=i686;
vi config.make 在 CFLAGS = -g -O2 后加 -march=i686。
重编译之前一定要 make clean。
回复 支持 反对

使用道具 举报

发表于 2010-8-1 04:05:46 | 显示全部楼层
Post by cjrcl;2106293
一楼用的应该是Debian,二楼用的应该是Red Hat。
../configure --prefix=/usr/ --with-tls --with-cpu=i686;
vi config.make 在 CFLAGS = -g -O2 后加 -march=i686。
重编译之前一定要 make clean。

纠错:--with-cpu=i686 不能要。
补充:对于有的Debian需要 vi ../nscd/Makefile 在 LDLIBS-nscd = $(selinux-LIBS) 后加 -lssp。另外 --with-tls 对于Red Hat可要可不要,对于Debian如果不要则必须 rm -rf /lib/tls。
回复 支持 反对

使用道具 举报

发表于 2010-10-13 15:18:26 | 显示全部楼层
楼上cjrcl兄说的是本质上的问题,关于此问题,请楼主仔细阅读6.6的手册,5.7节如下处:

case `uname -m` in
  i?86) echo "CFLAGS += -march=i486 -mtune=native" > configparms ;;
esac

此处的-march=i486,是必须符合你的宿主系统的,例如像我一样Fedora13,就改成

case `uname -m` in
  i?86) echo "CFLAGS += -march=i686 -mtune=native" > configparms ;;
esac

在此,感谢cjrcl同志的指点
回复 支持 反对

使用道具 举报

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

本版积分规则

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