LinuxQuestions.org
Visit Jeremy's Blog.
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 07-18-2012, 01:51 AM   #1
E-Kami
Member
 
Registered: Jul 2012
Posts: 56

Rep: Reputation: Disabled
LFS - compiling GCC


Hello everyone.
I'm actually trying to compile GCC 4.6.2 with the source from LFS website ftp server.
Following LFS book version 7.1, I applied the patch given with the packages but I'm having some issues .
I compiled each gmp, mpc and mpfr separately and thus, I gave their full path while running the configure command as follow:
Code:
./configure --target=$LFS_TGT --prefix=$LFS/build/gcc-build --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/temp/mpfr-build/include --with-mpfr-lib=/mnt/LFS/temp/mpfr-build/lib --with-gmp-include=/mnt/LFS/temp/gmp-build/include --with-gmp-lib=/mnt/LFS/temp/gmp-build/lib --with-mpc-include=/mnt/LFS/temp/mpc-build/include --with-mpc-lib=/mnt/LFS/temp/mpc-build/lib
But once I run:
Code:
make -j4
I get the following error:
Code:
checking for suffix of object files... configure: error: in `/mnt/LFS/source/gcc-4.6.2/x86_64-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/source/gcc-4.6.2'
make: *** [all] Error 2
I'm using gcc 4.6.3 (I know that it is not recommended but it is the default version of my host). I also tried to find the error in the config.log file but without success =/. Someone already had this problem? Someone can help me? Thanks in advance.
 
Old 07-18-2012, 02:40 AM   #2
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 Did u make the gcc-build dir and cd in to before running configure command. Also why deviatd from the book. Post output of version check

Last edited by spiky0011; 07-18-2012 at 02:43 AM.
 
Old 07-18-2012, 03:26 AM   #3
E-Kami
Member
 
Registered: Jul 2012
Posts: 56

Original Poster
Rep: Reputation: Disabled
Hello,
Thanks a lot for you quick answer. The reason I deviated from the book was because the command it gave did not work:
Code:
../gcc-4.6.2/configure \
    --target=$LFS_TGT --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=$(pwd)/../gcc-4.6.2/mpfr/src \
    --with-mpfr-lib=$(pwd)/mpfr/src/.libs
At the end I had something like "missing mpg and/or gmp".
So as you suggested, I tried to run the configure command from the gcc-build dir without using the --prefix argument which gave me... another error:
Code:
configure: error: building out of tree but /mnt/LFS/source/gcc-4.6.2 contains host-x86_64-unknown-linux-gnu.
Use a pristine source tree when building in a separate tree
And echo $LFS_TGT give me:
x86_64-lfs-linux-gnu
So now I'm totally lost >.<.
For version check output are you meaning this?
Code:
make -v
GNU Make 3.81
Copyright (C) 2006  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.

This program built for x86_64-pc-linux-gnu
Code:
gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.6/lto-wrapper
Target: x86_64-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 --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)
Thanks again for your help.

EDIT: I just noticed the check.sh inside $LFS/source which give me:
autoconf-2.68.tar.bz2 misssing
automake-1.11.3.tar.xz misssing
bash-4.2.tar.gz misssing
binutils-2.22.tar.bz2 misssing
bison-2.5.tar.bz2 misssing
bzip2-1.0.6.tar.gz misssing
check-0.9.8.tar.gz misssing
coreutils-8.15.tar.xz misssing
dejagnu-1.5.tar.gz misssing
diffutils-3.2.tar.gz misssing
e2fsprogs-1.42.tar.gz misssing
expect5.45.tar.gz misssing
file-5.10.tar.gz misssing
findutils-4.4.2.tar.gz misssing
flex-2.5.35.tar.bz2 misssing
gawk-4.0.0.tar.bz2 misssing
gcc-4.6.2.tar.bz2 misssing
gdbm-1.10.tar.gz misssing
gettext-0.18.1.1.tar.gz misssing
glibc-2.14.1.tar.bz2 misssing
gmp-5.0.4.tar.xz misssing
grep-2.10.tar.xz misssing
groff-1.21.tar.gz misssing
grub-1.99.tar.gz misssing
gzip-1.4.tar.gz misssing
iana-etc-2.30.tar.bz2 misssing
inetutils-1.9.1.tar.gz misssing
iproute2-3.2.0.tar.xz misssing
kbd-1.15.2.tar.gz misssing
kmod-5.tar.xz misssing
less-444.tar.gz misssing
lfs-bootscripts-20120229.tar.bz2 misssing
libpipeline-1.2.0.tar.gz misssing
libtool-2.4.2.tar.gz misssing
linux-3.2.6.tar.xz misssing
m4-1.4.16.tar.bz2 misssing
make-3.82.tar.bz2 misssing
man-db-2.6.1.tar.gz misssing
man-pages-3.35.tar.gz misssing
mpc-0.9.tar.gz misssing
mpfr-3.1.0.tar.bz2 misssing
ncurses-5.9.tar.gz misssing
patch-2.6.1.tar.bz2 misssing
perl-5.14.2.tar.bz2 misssing
procps-3.2.8.tar.gz misssing
psmisc-22.15.tar.gz misssing
readline-6.2.tar.gz misssing
sed-4.2.1.tar.bz2 misssing
shadow-4.1.5.tar.bz2 misssing
sysklogd-1.5.tar.gz misssing
sysvinit-2.88dsf.tar.bz2 misssing
tar-1.26.tar.bz2 misssing
tcl8.5.11-src.tar.gz misssing
texinfo-4.13a.tar.gz misssing
udev-181.tar.xz misssing
udev-config-20100128.tar.bz2 misssing
util-linux-2.20.1.tar.bz2 misssing
vim-7.3.tar.bz2 misssing
xz-5.0.3.tar.bz2 misssing
zlib-1.2.6.tar.bz2 misssing

Last edited by E-Kami; 07-18-2012 at 03:33 AM.
 
Old 07-18-2012, 03:45 AM   #4
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 Have a look in the preface chapter host system Requirements
 
Old 07-18-2012, 08:33 AM   #5
stoat
Member
 
Registered: May 2007
Distribution: LFS
Posts: 628

Rep: Reputation: 185Reputation: 185
Quote:
Originally Posted by E-Kami

The reason I deviated from the book was because the command it gave did not work:
Code:
../gcc-4.6.2/configure \
    --target=$LFS_TGT --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=$(pwd)/../gcc-4.6.2/mpfr/src \
    --with-mpfr-lib=$(pwd)/mpfr/src/.libs
At the end I had something like "missing mpg and/or gmp".
Quote:
Originally Posted by The LFS book, section 5.5. GCC-4.6.2 - Pass 1

Note

There are frequent misunderstandings about this chapter. The procedures are the same as every other chapter
as explained earlier (Package build instructions). First extract the gcc tarball from the sources directory and
then change to the directory created. Only then should you proceed with the instructions below.
Hello E-Kami and everybody,

Of course do what you think is best, but I think it was a mistake to change the book's steps. There is nothing wrong with them. You botched something; probably during the untarring of those three packages that were missing (GMP, MPFR and MPC) and the subsequent renaming of their folders. From there, well, you went off on a wild goose chase IMO.

I would stop, back up, delete the untarred folders in your source directory, gather up the four tarballs again, and follow the book's steps without thinking about them. Put all four tarballs in your source directory. Untar gcc. Change directories to the gcc-4.6.2 directory just untarred. Start copying and pasting the book's commands into your terminal. It will work.

All of the above was meant in the kindest possible way. Feel free to completely ignore me and press on with what you are doing.

Last edited by stoat; 07-18-2012 at 02:27 PM.
 
Old 07-18-2012, 12:21 PM   #6
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
I wouldn't ignore stoat's remarks, this from your first post:
Quote:
Originally Posted by E-Kami View Post
I compiled each gmp, mpc and mpfr separately and thus, I gave their full path while running the configure command as follow:
Code:
./configure --target=$LFS_TGT --prefix=$LFS/build/gcc-build --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/temp/mpfr-build/include --with-mpfr-lib=/mnt/LFS/temp/mpfr-build/lib --with-gmp-include=/mnt/LFS/temp/gmp-build/include --with-gmp-lib=/mnt/LFS/temp/gmp-build/lib --with-mpc-include=/mnt/LFS/temp/mpc-build/include --with-mpc-lib=/mnt/LFS/temp/mpc-build/lib
That is the earliest indication that you did something which is not in the LFS Book and the probable cause of the problems that followed.

A tip: I see you use the -j 4 option, which is fine but be careful when using this flag when running the make test/make check steps in chapter 6. A few tests fail due to this flag (some (sub)test aren't meant to be run in parallel).
 
Old 07-18-2012, 10:57 PM   #7
E-Kami
Member
 
Registered: Jul 2012
Posts: 56

Original Poster
Rep: Reputation: Disabled
Thanks a lot for your answers guys. But I followed the book, step by step... 3 times... and it didn't work either.
I'll try again. I hope it will work :s . I'll update this post if I get some errors again. But do you think the errors
can come from my missing packages and/or my 4.6.7 version of gcc? Thanks again
 
Old 07-19-2012, 02:27 AM   #8
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
post the output of version check
 
Old 07-19-2012, 02:44 AM   #9
E-Kami
Member
 
Registered: Jul 2012
Posts: 56

Original Poster
Rep: Reputation: Disabled
Excuse me spiky0011, here is the output of my version-check:
bash, version 4.2.24(1)-release
/bin/sh -> /bin/dash
Binutils: (GNU Binutils for Ubuntu) 2.22
bison (GNU Bison) 2.5
/usr/bin/yacc -> /usr/bin/bison.yacc
bzip2, Version 1.0.6, 6-Sept-2010.
Coreutils: 8.13
diff (GNU diffutils) 3.2
find (GNU findutils) 4.4.2
GNU Awk 3.1.8
/usr/bin/awk -> /usr/bin/gawk
gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
(Ubuntu EGLIBC 2.15-0ubuntu10) 2.15
grep (GNU grep) 2.10
gzip 1.4
Linux version 3.2.0-23-generic (buildd@crested) (gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu4) ) #36-Ubuntu SMP Tue Apr 10 20:39:51 UTC 2012
m4 (GNU M4) 1.4.16
GNU Make 3.81
patch 2.6.1
Perl version='5.14.2';
GNU sed version 4.2.1
tar (GNU tar) 1.26
Texinfo: makeinfo (GNU texinfo) 4.13
xz (XZ Utils) 5.1.0alpha
gcc compilation OK
 
Old 07-19-2012, 03:14 AM   #10
E-Kami
Member
 
Registered: Jul 2012
Posts: 56

Original Poster
Rep: Reputation: Disabled
I just noticed:
/bin/sh -> /bin/dash
I just changed it to bash. I'm trying to recompile gcc,
step by step.
 
Old 07-19-2012, 03:17 AM   #11
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
Dose every thing else pass
 
Old 07-19-2012, 03:29 AM   #12
E-Kami
Member
 
Registered: Jul 2012
Posts: 56

Original Poster
Rep: Reputation: Disabled
Bad news, I switched to bash, followed EXACTLY the same steps as those on the book and I still get:
Code:
checking for x86_64-lfs-linux-gnu-gcc... /mnt/LFS/source/gcc-build/./gcc/xgcc -B/mnt/LFS/source/gcc-build/./gcc/ -B/tools/x86_64-lfs-linux-gnu/bin/ -B/tools/x86_64-lfs-linux-gnu/lib/ -isystem /tools/x86_64-lfs-linux-gnu/include -isystem /tools/x86_64-lfs-linux-gnu/sys-include   
checking for suffix of object files... configure: error: in `/mnt/LFS/source/gcc-build/x86_64-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/source/gcc-build'
make: *** [all] Error 2
with:

Code:
bash, version 4.2.24(1)-release
/bin/sh -> /bin/bash
Binutils: (GNU Binutils for Ubuntu) 2.22
bison (GNU Bison) 2.5
/usr/bin/yacc -> /usr/bin/bison.yacc
bzip2,  Version 1.0.6, 6-Sept-2010.
Coreutils:  8.13
diff (GNU diffutils) 3.2
find (GNU findutils) 4.4.2
GNU Awk 3.1.8
/usr/bin/awk -> /usr/bin/gawk
gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
(Ubuntu EGLIBC 2.15-0ubuntu10) 2.15
grep (GNU grep) 2.10
gzip 1.4
Linux version 3.2.0-23-generic (buildd@crested) (gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu4) ) #36-Ubuntu SMP Tue Apr 10 20:39:51 UTC 2012
m4 (GNU M4) 1.4.16
GNU Make 3.81
patch 2.6.1
Perl version='5.14.2';
GNU sed version 4.2.1
tar (GNU tar) 1.26
Texinfo: makeinfo (GNU texinfo) 4.13
xz (XZ Utils) 5.1.0alpha
gcc compilation OK
 
Old 07-19-2012, 03:50 AM   #13
E-Kami
Member
 
Registered: Jul 2012
Posts: 56

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by spiky0011 View Post
Dose every thing else pass
It seems yes.
 
Old 07-19-2012, 04:17 AM   #14
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
So the error with mpfr,gmp
 
Old 07-19-2012, 04:24 AM   #15
E-Kami
Member
 
Registered: Jul 2012
Posts: 56

Original Poster
Rep: Reputation: Disabled
It seems to be with libgcc but... what cause the error?
 
  


Reply



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
error using lfs while compiling lfs book's 6.12 (gcc-4.1.2) section aditya_gpch Linux From Scratch 3 04-24-2008 04:23 PM
error while compiling gcc in lfs 6.12 aditya_gpch Linux - Newbie 3 04-19-2008 05:54 AM
error using lfs while compiling 6.12 gcc-4.1.2 aditya_gpch Programming 1 04-19-2008 04:38 AM
GCC error when compiling it for LFS safrout Linux From Scratch 1 06-14-2003 06:16 AM

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

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