LinuxQuestions.org
Review your favorite Linux distribution.
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 08-06-2012, 09:26 AM   #1
SirWhy
LQ Newbie
 
Registered: Aug 2012
Posts: 4

Rep: Reputation: Disabled
GCC 4.7.1 Pass 1 Errors when preparing for compilation


I've been following along fine with the LFS book until it's time to prepare GCC for compile.

I enter in this as the book says
Code:
../gcc-4.7.1/configure         \
    --target=$LFS_TGT          \
    --prefix=/tools            \
    --with-sysroot=$LFS        \
    --with-newlib              \
    --without-headers          \
    --with-local-prefix=/tools \
    --with-native-system-header-dir=/tools/include \
    --disable-nls              \
    --disable-shared           \
    --disable-multilib         \
    --disable-decimal-float    \
    --disable-threads          \
    --disable-libmudflap       \
    --disable-libssp           \
    --disable-libgomp          \
    --disable-libquadmath      \
    --enable-languages=c       \
    --with-mpfr-include=$(pwd)/../gcc-4.7.1/mpfr/src \
    --with-mpfr-lib=$(pwd)/mpfr/src/.libs
After I enter this I get a list of checks and then it fails

Entire output
Code:
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking target system type... i686-lfs-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... no
checking for mawk... mawk
checking for libitm support... yes
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for g++... no
checking for c++... no
checking for gpp... no
checking for aCC... no
checking for CC... no
checking for cxx... no
checking for cc++... no
checking for cl.exe... no
checking for FCC... no
checking for KCC... no
checking for RCC... no
checking for xlC_r... no
checking for xlC... no
checking whether we are using the GNU C++ compiler... no
checking whether g++ accepts -g... no
checking for gnatbind... no
checking for gnatmake... no
checking whether compiler driver understands Ada... no
checking how to compare bootstrapped objects... cmp --ignore-initial=16 $$f1 $$f2
checking for objdir... .libs
checking for the correct version of gmp.h... no
configure: error: Building GCC requires GMP 4.2+, MPFR 2.3.1+ and MPC 0.8.0+.
Try the --with-gmp, --with-mpfr and/or --with-mpc options to specify
their locations.  Source code for these libraries can be found at
their respective hosting sites as well as at
ftp://gcc.gnu.org/pub/gcc/infrastructure/.  See also
http://gcc.gnu.org/install/prerequisites.html for additional info.  If
you obtained GMP, MPFR and/or MPC from a vendor distribution package,
make sure that you have installed both the libraries and the header
files.  They may be located in separate packages.
I have an idea of what it means, it can't find the required gmp, mpfr and mpc but I don't really know how to fix it.

Surely the code in the book can't be wrong and is missing something along the lines of
Code:
--with-gmp......
--with-mpc....
Any help is appreciated and may I say this is a fantastic community.
 
Old 08-06-2012, 09:40 AM   #2
stoat
Member
 
Registered: May 2007
Distribution: LFS
Posts: 628

Rep: Reputation: 185Reputation: 185
You're right, the book is not wrong. See the note in the yellow box on that page of the book. This happens all the time. The tarballs for GCC, GMP, MPFR and MPC all should be present in your /sources directory. Then untar only the GCC tarball and change directories to its build directory (the standard compiling steps described in section 5.3). Then start copying and pasting the book's commands into your terminal. It will work.

P.S.: To me, this misunderstanding is being caused by the wording of the first paragraph on that page (just above the yellow box with the note). It appears to be telling us to unpack the tarballs of GMP, MPFR and MPC in the GCC build directory and rename them, as though we should stop and do that before proceeding. However, that paragraph is merely describing what the next steps do (immediately following the yellow box).

Last edited by stoat; 08-06-2012 at 09:59 AM.
 
Old 08-06-2012, 10:03 AM   #3
SirWhy
LQ Newbie
 
Registered: Aug 2012
Posts: 4

Original Poster
Rep: Reputation: Disabled
Thank you.

So I should delete the ones I untarred (apart from gcc of course) and download the tarballs again and leave them packaged as is. Then go as the books says
 
Old 08-06-2012, 10:09 AM   #4
stoat
Member
 
Registered: May 2007
Distribution: LFS
Posts: 628

Rep: Reputation: 185Reputation: 185
That's right, but the tarballs should still be there. Nothing happens to those when you untar them. Just delete the three build directories created when you untarred GMP, MPFR and MPC. Then start again with those tar and mv commands on page 34.

If you deleted the tarballs, then download them again.

P.S.: I also would delete the build directory created by untarring GCC and just start over for GCC at the top of the page by untarring GCC again and changing directories to its build directory. Then go.

Last edited by stoat; 08-06-2012 at 10:22 AM.
 
Old 08-06-2012, 10:21 AM   #5
SirWhy
LQ Newbie
 
Registered: Aug 2012
Posts: 4

Original Poster
Rep: Reputation: Disabled
Well now it's compiling, hopefully without a problem but it will be a while until I find out (about 40 mins, older hardware). Will post again if all goes well
 
Old 08-06-2012, 11:08 AM   #6
SirWhy
LQ Newbie
 
Registered: Aug 2012
Posts: 4

Original Poster
Rep: Reputation: Disabled
So I left it to compile and when I came back this was on the terminal
Code:
checking whether ln -s works... yes
checking for i686-lfs-linux-gnu-gcc... /mnt/LFS/sources/gcc-build/./gcc/xgcc -B/mnt/LFS/sources/gcc-build/./gcc/ -B/tools/i686-lfs-linux-gnu/bin/ -B/tools/i686-lfs-linux-gnu/lib/ -isystem /tools/i686-lfs-linux-gnu/include -isystem /tools/i686-lfs-linux-gnu/sys-include   
checking for suffix of object files... configure: error: in `/mnt/LFS/sources/gcc-build/i686-lfs-linux-gnu/libgcc':
configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details.
make[1]: *** [configure-target-libgcc] Error 1
make[1]: Leaving directory `/mnt/LFS/sources/gcc-build'
make: *** [all] Error 2
I know it said compile errors would happen. Are these it or has something gone wrong?
 
Old 08-06-2012, 01:43 PM   #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
Talking

Hi. Can you post the output of Version check as I see it dosn,t find gawk. I expect there will be other softsare required. Also what host are you using.
 
  


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
[SOLVED] 5.5 GCC-4.5.1 - Pass 1 - c99 mode compilation error - openSUSE (host) linuxquestions2010 Linux From Scratch 5 11-17-2010 07:58 AM
5.4. GCC-4.0.3 - Pass 1 compilation error :( gothicbob Linux From Scratch 1 08-06-2007 05:21 PM
test suit errors on gcc during pass-2 rangalo Linux From Scratch 2 12-28-2005 03:33 AM
GCC First Pass throwing errors...pls help! chakkaradeepcc Linux From Scratch 2 04-11-2005 01:20 PM
GCC Compilation Errors The_Dish Programming 7 10-08-2004 04:33 PM

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

All times are GMT -5. The time now is 10:02 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