LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 10-01-2014, 11:03 AM   #1
hixos
LQ Newbie
 
Registered: Oct 2014
Posts: 22

Rep: Reputation: Disabled
GCC compiling isssue


While compiling GCC I get the following error:
Code:
...
checking whether  /mnt/lfs/sources/gcc-build/./prev-gcc/xgcc -B/mnt/lfs/sources/gcc-build/./prev-gcc/ -B/tools/x86_64-unknown-linux-gnu/bin/ -B/tools/x86_64-unknown-linux-gnu/bin/ -B/tools/x86_64-unknown-linux-gnu/lib/ -isystem /tools/x86_64-unknown-linux-gnu/include -isystem /tools/x86_64-unknown-linux-gnu/sys-include    is gcc... yes
checking compiler  /mnt/lfs/sources/gcc-build/./prev-gcc/xgcc -B/mnt/lfs/sources/gcc-build/./prev-gcc/ -B/tools/x86_64-unknown-linux-gnu/bin/ -B/tools/x86_64-unknown-linux-gnu/bin/ -B/tools/x86_64-unknown-linux-gnu/lib/ -isystem /tools/x86_64-unknown-linux-gnu/include -isystem /tools/x86_64-unknown-linux-gnu/sys-include    -g -O2 -gtoggle ... no
checking for none-unknown-linux-gnu-gcc...  /mnt/lfs/sources/gcc-build/./prev-gcc/xgcc -B/mnt/lfs/sources/gcc-build/./prev-gcc/ -B/tools/x86_64-unknown-linux-gnu/bin/ -B/tools/x86_64-unknown-linux-gnu/bin/ -B/tools/x86_64-unknown-linux-gnu/lib/ -isystem /tools/x86_64-unknown-linux-gnu/include -isystem /tools/x86_64-unknown-linux-gnu/sys-include   
checking whether the C compiler works... no
configure: error: in `/mnt/lfs/sources/gcc-build/gmp':
configure: error: C compiler cannot create executables
See `config.log' for more details
make[2]: *** [configure-stage2-gmp] Error 77
make[2]: Leaving directory `/mnt/lfs/sources/gcc-build'
make[1]: *** [stage2-bubble] Error 2
make[1]: Leaving directory `/mnt/lfs/sources/gcc-build'
make: *** [all] Error 2
and in config.log:
Code:
...
Thread model: posix
gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1) 
configure:4246: $? = 0
configure:4235: gcc -V >&5
gcc: error: unrecognized command line option '-V'
gcc: fatal error: no input files
compilation terminated.
configure:4246: $? = 4
configure:4235: gcc -qversion >&5
gcc: error: unrecognized command line option '-qversion'
gcc: fatal error: no input files
compilation terminated.
...
Any ideas of the possible issue/solution?
 
Old 10-01-2014, 12:17 PM   #2
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,876
Blog Entries: 13

Rep: Reputation: 4929Reputation: 4929Reputation: 4929Reputation: 4929Reputation: 4929Reputation: 4929Reputation: 4929Reputation: 4929Reputation: 4929Reputation: 4929Reputation: 4929
Capital V is not a correct command line option for gcc.
Code:
$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/i686-linux-gnu/4.6/lto-wrapper
Target: i686-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.6.3-1ubuntu5' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.6 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --enable-objc-gc --enable-targets=all --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=i686-linux-gnu --host=i686-linux-gnu --target=i686-linux-gnu
Thread model: posix
gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) 
$
$ gcc -V
gcc: error: unrecognized option ‘-V’
gcc: fatal error: no input files
compilation terminated.
So something is wrong with your configure script near line 4246, or rather just before where the gcc version check is performed. Search your configure for the capital V and change it. I suspect that you ought to be fairly wary of that because of this. Can you instead install it by a package? Where exactly did you get this source?
 
1 members found this post helpful.
Old 10-01-2014, 12:18 PM   #3
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Are you sure you have a complete gcc install on your OS ?

A full gcc install is : $ sudo apt-get install g++ libc6-dev linux-libc-dev
 
Old 10-01-2014, 02:55 PM   #4
hixos
LQ Newbie
 
Registered: Oct 2014
Posts: 22

Original Poster
Rep: Reputation: Disabled
My configure file is the one in the gcc sources in http://ftp.gnu.org/gnu/gcc/gcc-4.9.1/gcc-4.9.1.tar.bz2 and I didn't change it.
What I have there is:
Code:
for ac_option in --version -v -V -qversion; do
  { { ac_try="$ac_compiler $ac_option >&5"
case "(($ac_try" in
  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  *) ac_try_echo=$ac_try;;
esac
what's wrong with it?

In config.log I also get:
Code:
conftest.c:10:27: fatal error: cloog/version.h: No such file or directory
To knudfl:
I tried your suggestion and some of the packages were upgraded, etc. but I still have the same issue.

Last edited by hixos; 10-01-2014 at 03:09 PM.
 
Old 10-01-2014, 03:28 PM   #5
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Assume LFS-7.5 , Pass 1 : 5.5.1 .

Are you sure your environment have been set up correctly ?
See 4.4 http://www.linuxfromscratch.org/lfs/...vironment.html

And "Host System Requirements" ?
http://www.linuxfromscratch.org/lfs/.../hostreqs.html
Important : /bin/sh must be a symbolic link to bash.

And : "To see whether your host system has all the appropriate versions,
and the ability to compile programs, run the following "
→ "version-check.sh" → → ? What is your result ?

Are you sure that your configure line is exactly like :
"Prepare GCC for compilation:"
http://www.linuxfromscratch.org/lfs/...gcc-pass1.html

-
 
Old 10-01-2014, 04:55 PM   #6
hixos
LQ Newbie
 
Registered: Oct 2014
Posts: 22

Original Poster
Rep: Reputation: Disabled
I checked again and fixed some issues. version-check seems OK. Now I get this error:
Code:
...
checking for MPFR... no
configure: error: libmpfr not found or uses a different ABI (including static vs shared).
make[1]: *** [configure-mpc] Error 1
 
Old 10-01-2014, 06:06 PM   #7
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
← #6 .

Did you type exactly this :
--with-mpfr-include=$(pwd)/../gcc-4.8.2/mpfr/src \
--with-mpfr-lib=$(pwd)/mpfr/src/.libs

* I.e. you are not supposed to replace "$(pwd)" with a path for mpfr.

-
 
Old 10-01-2014, 06:17 PM   #8
hixos
LQ Newbie
 
Registered: Oct 2014
Posts: 22

Original Poster
Rep: Reputation: Disabled
Result of the version-check script:

Code:
bash, version 4.3.11(1)-release
/bin/sh -> /bin/bash
Binutils: (GNU Binutils for Ubuntu) 2.24
bison (GNU Bison) 3.0.2
/usr/bin/yacc -> /usr/bin/bison.yacc
bzip2,  Version 1.0.6, 6-Sept-2010.
Coreutils:  8.21
diff (GNU diffutils) 3.3
find (GNU findutils) 4.4.2
GNU Awk 4.0.1
/usr/bin/awk -> /usr/bin/gawk
gcc (Ubuntu 4.8.2-19ubuntu1) 4.8.2
g++ (Ubuntu 4.8.2-19ubuntu1) 4.8.2
(Ubuntu EGLIBC 2.19-0ubuntu6.1) 2.19
grep (GNU grep) 2.16
gzip 1.6
Linux version 3.13.0-34-generic (buildd@allspice) (gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1) ) #60-Ubuntu SMP Wed Aug 13 15:45:27 UTC 2014
m4 (GNU M4) 1.4.17
GNU Make 3.81
GNU patch 2.7.1
Perl version='5.18.2';
sed (GNU sed) 4.2.2
tar (GNU tar) 1.27.1
xz (XZ Utils) 5.1.0alpha
g++ compilation OK
 
Old 10-02-2014, 03:55 AM   #9
hixos
LQ Newbie
 
Registered: Oct 2014
Posts: 22

Original Poster
Rep: Reputation: Disabled
[Solved]
I am working on LFS 7.6. Following the instructions more carefully it seems to work now. My make install finished without errors.
I was not sure about what "complete gcc" means, but you helped me with the command
Code:
$ sudo apt-get install g++ libc6-dev linux-libc-dev

Last edited by hixos; 10-02-2014 at 03:56 AM.
 
Old 10-02-2014, 04:53 AM   #10
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
← #9 .

Short :

A complete gcc means (for LFS) a gcc that can compile any C, C++ code.
( Other contexts could also include gcc-fortran.)
→ → →
{ gcc, g++ } and the headers required for compiling, provided by:
{ libc6-dev linux-libc-dev }.
Without those "headers.h packages", gcc »cannot create executables«.

-
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
How to selectively use GCC 3.4 -OR- GCC 4.1 in FC6 when compiling? rylan76 Fedora 2 11-21-2006 11:36 PM
Error compiling gcc 3.3.6 with 64bit gcc 4.0.3 cs-cam Linux - Software 0 04-22-2006 05:20 AM
Compiling gcc without any gcc installed my_kappa Linux - Software 5 01-30-2006 12:15 AM
Kernel compiling: gcc-3.3 is 586, should be gcc-3.3 386 Erik Plaggenmar Linux - Software 0 10-01-2004 11:38 AM
Various Compiling Errors (GCC compiling Openal, GUIlib, xmms-wma) gregorya Linux - Software 2 08-27-2004 05:03 AM

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

All times are GMT -5. The time now is 01:49 AM.

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