+ -
当前位置:首页 → 问答吧 → 为什么?????CLFS疑问----已解决

为什么?????CLFS疑问----已解决

时间:2007-11-01

来源:互联网

参考的是“Cross-Compiled Linux From Scratch - Version SVN-20070924-x86”文档档,可不知道为什么,每次到“5.8. Glibc-2.6.1”时,都是一个结果,提示内核的头文件版本太低,没理由的,要说是手误,或别的什么失误的话,一次也就算了,可我做了4次,都是一样?为什么?

clfs:/mnt/clfs/sources$ cd glibc-2.6.1
clfs:/mnt/clfs/sources/glibc-2.6.1$ patch -Np1 -i ../glibc-2.6.1-libgcc_eh-1.patch
patching file config.make.in
patching file configure.in
patching file Makeconfig
patching file configure
clfs:/mnt/clfs/sources/glibc-2.6.1$ patch -Np1 -i ../glibc-2.6.1-localedef_segfault-1.patch
patching file locale/programs/3level.h
clfs:/mnt/clfs/sources/glibc-2.6.1$ mkdir -v ../glibc-build
mkdir: created directory `../glibc-build'
clfs:/mnt/clfs/sources/glibc-2.6.1$ cd ../glibc-build
clfs:/mnt/clfs/sources/glibc-build$ echo "libc_cv_forced_unwind=yes" > config.cache
clfs:/mnt/clfs/sources/glibc-build$ echo "libc_cv_c_cleanup=yes" >> config.cacheclfs:/mnt/clfs/sources/glibc-build$ BUILD_CC="gcc" CC="${CLFS_TARGET}-gcc" \
> AR="${CLFS_TARGET}-ar" RANLIB="${CLFS_TARGET}-ranlib" \
> CFLAGS="-march=$(cut -d- -f1 <<< $CLFS_TARGET) -mtune=generic -g -O2" \
> ../glibc-2.6.1/configure --prefix=/tools \
> --host=${CLFS_TARGET} --build=${CLFS_HOST} \
> --disable-profile --enable-add-ons \
> --with-tls --enable-kernel=2.6.0 --with-__thread \
> --with-binutils=/cross-tools/bin --with-headers=/tools/include \
> --cache-file=config.cache
configure: loading cache config.cache
checking build system type... i486-cross-linux-gnu
checking host system type... i686-pc-linux-gnu
configure: running configure fragment for add-on nptl
checking sysdep dirs... sysdeps/i386/elf nptl/sysdeps/unix/sysv/linux/i386/i686 nptl/sysdeps/unix/sysv/linux/i386 sysdeps/unix/sysv/linux/i386 nptl/sysdeps/unix/sysv/linux nptl/sysdeps/pthread sysdeps/pthread sysdeps/unix/sysv/linux sysdeps/gnu sysdeps/unix/common sysdeps/unix/mman sysdeps/unix/inet sysdeps/unix/sysv/i386 nptl/sysdeps/unix/sysv sysdeps/unix/sysv sysdeps/unix/i386 nptl/sysdeps/unix sysdeps/unix sysdeps/posix sysdeps/i386/i686/fpu nptl/sysdeps/i386/i686 sysdeps/i386/i686 sysdeps/i386/i486 nptl/sysdeps/i386/i486 sysdeps/i386/fpu nptl/sysdeps/i386 sysdeps/i386 sysdeps/wordsize-32 sysdeps/ieee754/ldbl-96 sysdeps/ieee754/dbl-64 sysdeps/ieee754/flt-32 sysdeps/ieee754 sysdeps/generic/elf sysdeps/generic
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln -s works... yes
checking for i686-pc-linux-gnu-gcc... i686-pc-linux-gnu-gcc
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether i686-pc-linux-gnu-gcc accepts -g... yes
checking for i686-pc-linux-gnu-gcc option to accept ANSI C... none needed
checking for gcc... gcc
checking how to run the C preprocessor... i686-pc-linux-gnu-gcc -E
checking for i686-pc-linux-gnu-g++... no
checking for i686-pc-linux-gnu-c++... no
checking for i686-pc-linux-gnu-gpp... no
checking for i686-pc-linux-gnu-aCC... no
checking for i686-pc-linux-gnu-CC... no
checking for i686-pc-linux-gnu-cxx... no
checking for i686-pc-linux-gnu-cc++... no
checking for i686-pc-linux-gnu-cl... no
checking for i686-pc-linux-gnu-FCC... no
checking for i686-pc-linux-gnu-KCC... no
checking for i686-pc-linux-gnu-RCC... no
checking for i686-pc-linux-gnu-xlC_r... no
checking for i686-pc-linux-gnu-xlC... no
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking whether /mnt/clfs/cross-tools/bin/../lib/gcc/i686-pc-linux-gnu/4.2.1/../../../../i686-pc-linux-gnu/bin/as is GNU as... yes
checking whether /mnt/clfs/cross-tools/bin/../lib/gcc/i686-pc-linux-gnu/4.2.1/../../../../i686-pc-linux-gnu/bin/ld is GNU ld... yes
checking for /mnt/clfs/cross-tools/bin/../lib/gcc/i686-pc-linux-gnu/4.2.1/../../../../i686-pc-linux-gnu/bin/as... /mnt/clfs/cross-tools/bin/../lib/gcc/i686-pc-linux-gnu/4.2.1/../../../../i686-pc-linux-gnu/bin/as
checking version of /mnt/clfs/cross-tools/bin/../lib/gcc/i686-pc-linux-gnu/4.2.1/../../../../i686-pc-linux-gnu/bin/as... 2.18, ok
checking for /mnt/clfs/cross-tools/bin/../lib/gcc/i686-pc-linux-gnu/4.2.1/../../../../i686-pc-linux-gnu/bin/ld... /mnt/clfs/cross-tools/bin/../lib/gcc/i686-pc-linux-gnu/4.2.1/../../../../i686-pc-linux-gnu/bin/ld
checking version of /mnt/clfs/cross-tools/bin/../lib/gcc/i686-pc-linux-gnu/4.2.1/../../../../i686-pc-linux-gnu/bin/ld... 2.18, ok
checking for pwd... /bin/pwd
checking for i686-pc-linux-gnu-gcc... (cached) i686-pc-linux-gnu-gcc
checking version of i686-pc-linux-gnu-gcc... 4.2.1, ok
checking for gnumake... no
checking for gmake... no
checking for make... make
checking version of make... 3.81, ok
checking for gnumsgfmt... no
checking for gmsgfmt... no
checking for msgfmt... msgfmt
checking version of msgfmt... 0.16.1, ok
checking for makeinfo... makeinfo
checking version of makeinfo... 4.9, ok
checking for sed... sed
checking version of sed... 4.1.5, ok
checking for autoconf... autoconf
checking whether autoconf works... yes
checking whether ranlib is necessary... no
checking LD_LIBRARY_PATH variable... ok
checking whether GCC supports -static-libgcc... -static-libgcc
checking for bash... /bin/sh
checking for gawk... gawk
checking for perl... /usr/bin/perl
checking for install-info... /usr/bin/install-info
checking for bison... /usr/bin/bison
checking for signed size_t type... no
checking for libc-friendly stddef.h... yes
checking whether we need to use -P to assemble .S files... no
checking whether .text pseudo-op must be used... yes
checking for assembler global-symbol directive... .globl
checking for .set assembler directive... yes
checking for assembler .type directive prefix... @
checking for .symver assembler directive... yes
checking for ld --version-script... yes
checking for .previous assembler directive... yes
checking for .protected and .hidden assembler directive... yes
checking whether __attribute__((visibility())) is supported... yes
checking for broken __attribute__((visibility()))... no
checking for broken __attribute__((alias()))... no
checking whether to put _rtld_local into .sdata section... no
checking for .preinit_array/.init_array/.fini_array support... yes
checking for libunwind-support in compiler... no
checking whether to link against libgcc_eh... no
checking for -z nodelete option... yes
checking for -z nodlopen option... yes
checking for -z initfirst option... yes
checking for -z relro option... yes
checking for -Bgroup option... yes
checking for libgcc_s suffix...
checking for --as-needed option... no
checking whether --noexecstack is desirable for .S files... yes
checking for -z combreloc... yes
checking for -z execstack... yes
checking for -fpie... no
checking for --hash-style option... yes
checking for -fno-toplevel-reorder... yes
checking for -fstack-protector... no
checking for -fgnu89-inline... yes
checking whether cc puts quotes around section names... no
checking for assembler .weak directive... yes
checking whether CFI directives are supported... yes
checking for ld --no-whole-archive... yes
checking for gcc -fexceptions... yes
checking for __builtin_expect... yes
checking for __builtin_memset... no
checking for redirection of built-in functions... yes
checking for __thread... yes
checking for tls_model attribute... yes
checking for libgd... no
checking for is_selinux_enabled in -lselinux... no
checking for egrep... grep -E
checking for ANSI C header files... no
checking for sys/types.h... no
checking for sys/stat.h... no
checking for stdlib.h... no
checking for string.h... no
checking for memory.h... no
checking for strings.h... no
checking for inttypes.h... no
checking for stdint.h... no
checking for unistd.h... no
checking for long double... no
checking size of long double... 0
running configure fragment for sysdeps/i386/elf
checking for i386 TLS support... yes
running configure fragment for nptl/sysdeps/pthread
checking for forced unwind support... (cached) yes
checking for C cleanup handling... (cached) yes
running configure fragment for sysdeps/pthread
running configure fragment for sysdeps/unix/sysv/linux
checking for egrep... (cached) grep -E
checking installed Linux kernel header files... TOO OLD!
configure: error: GNU libc requires kernel header files from
Linux 2.0.10 or later to be installed before configuring.
The kernel header files are found usually in /usr/include/asm and
/usr/include/linux; make sure these directories use files from
Linux 2.0.10 or later. This check uses <linux/version.h>, so
make sure that file was built correctly when installing the kernel header
files. To use kernel headers not from /usr/include/linux, use the
configure option --with-headers.

作者: epvmm365   发布时间: 2007-11-01

cat /tools/include/linux/version.h
输出什么?
也许是内核头文件没装好?

作者: hohoxu_hao115   发布时间: 2007-11-01

我觉得应该不可能,绝对完全按照手册上来的

怎么没有你说的那个文件????

作者: epvmm365   发布时间: 2007-11-01

估計 headers 未裝好嫌疑最大

作者: d00m3d   发布时间: 2007-11-02

你用的那个版本的内核?
我用2.6.23.1没有问题。

作者: trublemaker   发布时间: 2007-11-02

install -dv /tools/include
cp -av include/asm-i386 /tools/include/asm
cp -av include/{asm-generic,linux} /tools/include/
难道不是这样吗?
用的是2.6.22.6

作者: epvmm365   发布时间: 2007-11-02

2.6.23.1

试下。。。

作者: epvmm365   发布时间: 2007-11-02

原来在clfs包里还有个"linux-headers-2.6.22.6-09032007.tar.bz2"包?,不是和lfs一样用内核的包,哎,,,没注意还有个头文件的包,现在好 了。。。

作者: epvmm365   发布时间: 2007-11-02