LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Password
Linux From Scratch This Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.

Notices


Reply
  Search this Thread
Old 06-19-2012, 05:08 AM   #1
iceman911
LQ Newbie
 
Registered: Dec 2004
Location: India
Posts: 13

Rep: Reputation: 0
Unhappy binutils-2.22 configure error "cannot run C compiled programs"


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.
 
Old 06-19-2012, 05:45 AM   #2
Mordillo98
LQ Newbie
 
Registered: May 2012
Posts: 27

Rep: Reputation: Disabled
I had this issue before. Normally this is a result of a typo made earlier in the instructions that didn't pass the right parameters and now makes a compilation error.

as well, make sure that you always delete the previous folders created by older instructions every time you compile. That means that when compiling gcc part 2, you should have first deleted the gcc-build and gcc-4.6.2 folders from pass-1 before doing anything else.

Finally, I would suggest to download the Live ISO I've made for LFS 7.1 and use it to copy/paste the instructions from the manual. As well, make sure your VM use the Bridge networking as supposed of the NAT to make the entire thing work.

He're my YouTube video about it. Download link in the comments.

http://youtu.be/SzaFNOoGGrw?hd=1

Last edited by Mordillo98; 06-19-2012 at 05:46 AM.
 
Old 06-19-2012, 02:40 PM   #3
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Debian
Posts: 2,511
Blog Entries: 1

Rep: Reputation: 412Reputation: 412Reputation: 412Reputation: 412Reputation: 412
Hi

What host are you using and what what kernel is installed
I see from 1 of your earlier posts that you used kernel
Quote:
uname -r = 2.6.24-19-generic
here
The requirements for lfs 7.1
Quote:
Linux Kernel-2.6.25 (having been compiled with GCC-4.1.2 or greater)

Last edited by spiky0011; 06-19-2012 at 03:08 PM.
 
1 members found this post helpful.
Old 06-21-2012, 06:30 AM   #4
iceman911
LQ Newbie
 
Registered: Dec 2004
Location: India
Posts: 13

Original Poster
Rep: Reputation: 0
Thumbs up

Hi spiky0011,
thanks, mate. I think u r right. my kernel is out of date (2.6.24-19).

Instead of using live-cd, any chance i could upgrade my existing kernel?

Last edited by iceman911; 06-21-2012 at 06:41 AM.
 
Old 06-21-2012, 06:53 AM   #5
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Debian
Posts: 2,511
Blog Entries: 1

Rep: Reputation: 412Reputation: 412Reputation: 412Reputation: 412Reputation: 412
Hi what host are you using, there must be an option to upgrade the kernel. I have used a debain live ce to build on. Or install debain as os
 
Old 06-23-2012, 05:31 AM   #6
iceman911
LQ Newbie
 
Registered: Dec 2004
Location: India
Posts: 13

Original Poster
Rep: Reputation: 0
Hi Spiky,
I am using ubuntu 8.04.1 as host.
I don't mind going for live cd or something like that, if i have to.
but if i can upgrade kernel on ubuntu, that would save me a lot of hassle.

thanks.
 
Old 06-23-2012, 06:49 AM   #7
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Debian
Posts: 2,511
Blog Entries: 1

Rep: Reputation: 412Reputation: 412Reputation: 412Reputation: 412Reputation: 412
Hi

What is the output of
Code:
uname -r
Also there will be a few other host system requirements that will need to be fixed. You should be able to upgrade the kernel in the package manager (cant remember it,s name) Why dont you use a newer version of ubuntu, I,m not trying to put you off but You have to start with everything correct in the begining, Also before you start post the output of http://www.linuxfromscratch.org/lfs/.../hostreqs.html to make sure all is ok.
 
  


Reply

Tags
binutils, lfs, pass 2



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] binutils-2.22 configure error "C compiler cannot create executables" iceman911 Linux From Scratch 4 11-06-2014 05:51 AM
Ch 5.9 Binutils Pass 2 Error: Cannot run C compiled programs strungmind Linux From Scratch 38 02-08-2013 06:08 PM
LFS 6.5 -- Binutils-2.19.1 - Pass 2 gives error: cannot run C compiled programs kamleshk1 Linux From Scratch 7 11-16-2010 08:57 AM
"dpkg error in --configure" in most all (508) programs after "apt-get dist-upgrade" fluffymuffins Debian 3 08-09-2010 03:47 AM
"Can't run C compiled programs" on clean RH9 install smirnoff Linux - Newbie 8 03-16-2004 03:11 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch

All times are GMT -5. The time now is 08:49 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration