+ -
当前位置:首页 → 问答吧 → LFS 6.4中5.17 Coreutils-6.12编译错误!

LFS 6.4中5.17 Coreutils-6.12编译错误!

时间:2009-08-18

来源:互联网

host: Linux host-lfs 2.6.18-128.el5
[monitor@host-lfs ~]$ more /etc/issue
Red Hat Enterprise Linux Server release 5.3 (Tikanga)

在编译到
lfs:/lfs/sources/coreutils-6.12$ make
make all-recursive
make[1]: Entering directory `/lfs/sources/coreutils-6.12'
Making all in lib
make[2]: Entering directory `/lfs/sources/coreutils-6.12/lib'
make all-am
make[3]: Entering directory `/lfs/sources/coreutils-6.12/lib'
make[3]: Nothing to be done for `all-am'.
make[3]: Leaving directory `/lfs/sources/coreutils-6.12/lib'
make[2]: Leaving directory `/lfs/sources/coreutils-6.12/lib'
Making all in src
make[2]: Entering directory `/lfs/sources/coreutils-6.12/src'
make all-am
make[3]: Entering directory `/lfs/sources/coreutils-6.12/src'
gcc -std=gnu99 -g -O2 -Wl,--as-needed -o chcon chcon.o ../lib/libcoreutils.a ../lib/libcoreutils.a
chcon.o: In function `main':
/lfs/sources/coreutils-6.12/src/chcon.c:546: undefined reference to `getfilecon'
chcon.o: In function `change_file_context':
/lfs/sources/coreutils-6.12/src/chcon.c:199: undefined reference to `context_new'
/lfs/sources/coreutils-6.12/src/chcon.c:204: undefined reference to `context_str'
/lfs/sources/coreutils-6.12/src/chcon.c:220: undefined reference to `context_free'
/lfs/sources/coreutils-6.12/src/chcon.c:221: undefined reference to `freecon'
/lfs/sources/coreutils-6.12/src/chcon.c:220: undefined reference to `context_free'
/lfs/sources/coreutils-6.12/src/chcon.c:221: undefined reference to `freecon'
chcon.o: In function `compute_context_from_mask':
/lfs/sources/coreutils-6.12/src/chcon.c:119: undefined reference to `context_new'
/lfs/sources/coreutils-6.12/src/chcon.c:141: undefined reference to `context_user_set'
/lfs/sources/coreutils-6.12/src/chcon.c:142: undefined reference to `context_range_set'
/lfs/sources/coreutils-6.12/src/chcon.c:143: undefined reference to `context_role_set'
/lfs/sources/coreutils-6.12/src/chcon.c:144: undefined reference to `context_type_set'
/lfs/sources/coreutils-6.12/src/chcon.c:149: undefined reference to `context_free'
chcon.o: In function `main':
/lfs/sources/coreutils-6.12/src/chcon.c:561: undefined reference to `context_new'
/lfs/sources/coreutils-6.12/src/chcon.c:565: undefined reference to `context_free'
../lib/libcoreutils.a(selinux-at.o): In function `lsetfileconat':
/lfs/sources/coreutils-6.12/lib/at-func.c:45: undefined reference to `lsetfilecon'
/lfs/sources/coreutils-6.12/lib/at-func.c:38: undefined reference to `lsetfilecon'
/lfs/sources/coreutils-6.12/lib/at-func.c:73: undefined reference to `lsetfilecon'
../lib/libcoreutils.a(selinux-at.o): In function `setfileconat':
/lfs/sources/coreutils-6.12/lib/at-func.c:45: undefined reference to `setfilecon'
/lfs/sources/coreutils-6.12/lib/at-func.c:38: undefined reference to `setfilecon'
/lfs/sources/coreutils-6.12/lib/at-func.c:73: undefined reference to `setfilecon'
../lib/libcoreutils.a(selinux-at.o): In function `lgetfileconat':
/lfs/sources/coreutils-6.12/lib/at-func.c:45: undefined reference to `lgetfilecon'
/lfs/sources/coreutils-6.12/lib/at-func.c:38: undefined reference to `lgetfilecon'
/lfs/sources/coreutils-6.12/lib/at-func.c:73: undefined reference to `lgetfilecon'
../lib/libcoreutils.a(selinux-at.o): In function `getfileconat':
/lfs/sources/coreutils-6.12/lib/at-func.c:45: undefined reference to `getfilecon'
/lfs/sources/coreutils-6.12/lib/at-func.c:38: undefined reference to `getfilecon'
/lfs/sources/coreutils-6.12/lib/at-func.c:73: undefined reference to `getfilecon'
collect2: ld returned 1 exit status
make[3]: *** [chcon] Error 1
make[3]: Leaving directory `/lfs/sources/coreutils-6.12/src'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/lfs/sources/coreutils-6.12/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/lfs/sources/coreutils-6.12'
make: *** [all] Error 2
lfs:/lfs/sources/coreutils-6.12$

不清楚chcon.c的中会有这些问题

lfs:/lfs/sources/coreutils-6.12$ ls -d ../core*
../coreutils-6.12-old_build_kernel-1.patch ../coreutils-6.12.tar.gz
../coreutils-6.12-i18n-2.patch ../coreutils-6.12-uname-1.patch
有个的coreutils的相关包

作者: jerryjzm   发布时间: 2009-08-18

是不是路径问题呀?找不到定义

作者: win2linux   发布时间: 2009-08-18

应该不是,lfs book的行文时这样告诉,都是将相应的包解开后,进入,以进入后的未工作目录,除非它提示要mkdir个目录,进入!

我贴出来的 /lfs/sources/coreutils-6.12/,应该说明我是遵循这个规则的! 这个包前面的编译也是没什么问题的

作者: jerryjzm   发布时间: 2009-08-18

前面执行过什麽?

作者: d00m3d   发布时间: 2009-08-18

是完全按文档走的


5.17.1. Installation of Coreutils
There's an internal issue with Coreutils which makes some of the programs behave abnormally if you build using an
older kernel. Apply a patch to fix the issue:
patch -Np1 -i ../coreutils-6.12-old_build_kernel-1.patch
Prepare Coreutils for compilation:
./configure --prefix=/tools --enable-install-program=hostname
The meaning of the configure options:
--enable-install-program=hostname
This enables the hostname binary to be built and installed ¡§C it is disabled by default but is required by the Per
test suite.
Compile the package:
make

作者: jerryjzm   发布时间: 2009-08-18