Hi there,
Had trouble with configure script of binutils-2.22 (pass-2); section-5.9 of LFS book (Version 7.1)
Command I ran:
Code:
CC="$LFS_TGT-gcc -B/tools/lib/" \
> AR=$LFS_TGT-ar RANLIB=$LFS_TGT-ranlib \
> ../binutils-2.22/configure --prefix=/tools \
> --disable-nls --with-lib-path=/tools/lib
Terminal output:
Code:
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln works... yes
checking whether ln -s works... yes
checking for a sed that does not truncate output... /bin/sed
checking for gawk... gawk
checking for gcc... i686-lfs-linux-gnu-gcc -B/tools/lib/
checking for C compiler default output file name... a.out
checking whether the C compiler works... configure: error: in `/mnt/lfs/binutils-build':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details.
Output of config.log file:
Code:
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by configure, which was
generated by GNU Autoconf 2.64. Invocation command line was
$ ../binutils-2.22/configure --prefix=/tools --disable-nls --with-lib-path=/tools/lib
## --------- ##
## Platform. ##
## --------- ##
hostname = linmachine
uname -m = i686
uname -r = 2.6.24-19-generic
uname -s = Linux
uname -v = #1 SMP Wed Jun 18 14:43:41 UTC 2008
/usr/bin/uname -p = unknown
/bin/uname -X = unknown
/bin/arch = unknown
/usr/bin/arch -k = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo = unknown
/bin/machine = unknown
/usr/bin/oslevel = unknown
/bin/universe = unknown
PATH: /tools/bin
PATH: /bin
PATH: /usr/bin
## ----------- ##
## Core tests. ##
## ----------- ##
configure:2230: checking build system type
configure:2244: result: i686-pc-linux-gnu
configure:2291: checking host system type
configure:2304: result: i686-pc-linux-gnu
configure:2324: checking target system type
configure:2337: result: i686-pc-linux-gnu
configure:2391: checking for a BSD-compatible install
configure:2459: result: /usr/bin/install -c
configure:2470: checking whether ln works
configure:2492: result: yes
configure:2496: checking whether ln -s works
configure:2500: result: yes
configure:2507: checking for a sed that does not truncate output
configure:2571: result: /bin/sed
configure:2580: checking for gawk
configure:2596: found /usr/bin/gawk
configure:2607: result: gawk
configure:3742: checking for gcc
configure:3769: result: i686-lfs-linux-gnu-gcc -B/tools/lib/
configure:3998: checking for C compiler version
configure:4007: i686-lfs-linux-gnu-gcc -B/tools/lib/ --version >&5
i686-lfs-linux-gnu-gcc (GCC) 4.6.2
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
configure:4018: $? = 0
configure:4007: i686-lfs-linux-gnu-gcc -B/tools/lib/ -v >&5
Reading specs from /mnt/lfs/tools/bin/../lib/gcc/i686-lfs-linux-gnu/4.6.2/specs
COLLECT_GCC=i686-lfs-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/mnt/lfs/tools/bin/../libexec/gcc/i686-lfs-linux-gnu/4.6.2/lto-wrapper
Target: i686-lfs-linux-gnu
Configured with: ../gcc-4.6.2/configure --target=i686-lfs-linux-gnu --prefix=/tools --disable-nls --disable-shared --disable-multilib --disable-decimal-float --disable-threads --disable-libmudflap --disable-libssp --disable-libgomp --disable-libquadmath --disable-target-libiberty --disable-target-zlib --enable-languages=c --without-ppl --without-cloog --with-mpfr-include=/mnt/lfs/gcc-build/../gcc-4.6.2/mpfr/src --with-mpfr-lib=/mnt/lfs/gcc-build/mpfr/src/.libs
Thread model: single
gcc version 4.6.2 (GCC)
configure:4018: $? = 0
configure:4007: i686-lfs-linux-gnu-gcc -B/tools/lib/ -V >&5
i686-lfs-linux-gnu-gcc: error: unrecognized option '-V'
i686-lfs-linux-gnu-gcc: fatal error: no input files
compilation terminated.
configure:4018: $? = 1
configure:4007: i686-lfs-linux-gnu-gcc -B/tools/lib/ -qversion >&5
i686-lfs-linux-gnu-gcc: error: unrecognized option '-qversion'
i686-lfs-linux-gnu-gcc: fatal error: no input files
compilation terminated.
configure:4018: $? = 1
configure:4038: checking for C compiler default output file name
configure:4060: i686-lfs-linux-gnu-gcc -B/tools/lib/ conftest.c >&5
configure:4064: $? = 0
configure:4101: result: a.out
configure:4117: checking whether the C compiler works
configure:4126: ./a.out
FATAL: kernel too old
configure:4130: $? = 1
configure:4137: error: in `/mnt/lfs/binutils-build':
configure:4141: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details.
Output of $LFS_TGT variable:
Code:
lfs@linmachine:/mnt/lfs/binutils-build$ echo $LFS_TGT
i686-lfs-linux-gnu
Adjusting toolchain (section 5.8) had gone well without any errors.
Sanity check output:
Code:
echo 'main(){}' > dummy.c
$LFS_TGT-gcc -B/tools/lib dummy.c
readelf -l a.out | grep ': /tools'
[Requesting program interpreter: /tools/lib/ld-linux.so.2]
So, no errors in section 5.8. but trying to configure binutils-2.22 pass-2 as directed, results in the above mentioned error.
Thanks for reading.
Sety.