LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (https://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   problem with gcc compilation! (https://www.linuxquestions.org/questions/linux-from-scratch-13/problem-with-gcc-compilation-805953/)

freemanpolys 05-04-2010 05:49 PM

problem with gcc compilation!
 
Hi,
i'm making my one distribution by using the LFS book version 6.4 and i have a problem with the building of gcc ! in fact it needs gmp and mpfr. i've download them but can't build them because of errors!! Somebody help me !:(

paulsm4 05-04-2010 05:56 PM

Hi -

In the future, please try to give more details, including:

* LFS version, and where you got it
* Platform specifics
* GCC version
* the exact text of your error message(s)
* etc.

But to get past this problem, perhaps the easiest thing might be to just download GCC from here:

http://www.linuxfromscratch.org/blfs...neral/gcc.html

'Hope that helps .. PSM

freemanpolys 05-04-2010 06:02 PM

when building gcc
****************************************************************
checking for correct version of gmp.h... no
configure: error: Building GCC requires GMP 4.1+ and MPFR 2.3.0+.
Try the --with-gmp and/or --with-mpfr options to specify their locations.
Copies of these libraries' source code 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 and/or MPFR 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.
********************************************************************
when building gmp

checking for suitable m4... configure: error: No usable m4 in $PATH or /usr/5bin (see config.log for reasons).

*********************************************************************************
lfs@ametchia:/mnt/lfs/sources/gmp$ echo $PATH
/tools/bin:/bin:/usr/bin

druuna 05-05-2010 03:00 AM

Hi,

I have to assume you are stuck at chapter 5.5.1 (please tell us this information).

Did you install both GMP and MPFR as shown in this chapter?

In short:

- From your sources dir ($LFS/sources) unpack gcc,
- enter the created gcc dir,
- unpack and move both GMP and MPFR as shown in the book,
- follow the rest of the chapter starting with: mkdir -v ../gcc-build
cd ../gcc-build

Hope this helps.

freemanpolys 05-05-2010 05:10 AM

Thank you guys!

*LFS version : 6.4 download from a search with google
* Platform specifics : Linux ametchia 2.6.32-21-generic #32-Ubuntu SMP Fri Apr 16 08:10:02 UTC 2010 i686 GNU/Linux
* GCC version : gcc-4.1.2

yes druuna, it is at chapter 5.5.1.

i've download the gcc from http://www.linuxfromscratch.org/blfs...neral/gcc.html and i've build it!! now it's the make command which generate errors!


make[2]: execvp: touch: Too many levels of symbolic links
make[2]: *** [stamp-picdir] Error 127
make[2]: Leaving directory `/mnt/lfs/sources/gcc-build/libiberty'
make[1]: *** [all-libiberty] Error 2
make[1]: Leaving directory `/mnt/lfs/sources/gcc-build'
make: *** [all] Error 2

freemanpolys 05-05-2010 05:33 AM

Here are my gmp and mpfr version

gmp-4.2.4.tar.bz2
mpfr-2.3.2.tar.bz2

is them alright?

druuna 05-05-2010 06:47 AM

Hi,

Do _not_ use BLFS packages when building LFS!!

Just follow the steps I mentioned in post #4 (i.e.: follow the book!).

Remove that what you have done so far, including the gcc dir and the gcc build dir, and start at the top of chapter 5.5.

Hope this helps.

crts 05-05-2010 09:22 AM

Quote:

Originally Posted by freemanpolys (Post 3957451)
when building gcc
****************************************************************
checking for correct version of gmp.h... no
configure: error: Building GCC requires GMP 4.1+ and MPFR 2.3.0+.
Try the --with-gmp and/or --with-mpfr options to specify their locations.
Copies of these libraries' source code 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 and/or MPFR 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.
********************************************************************
when building gmp

checking for suitable m4... configure: error: No usable m4 in $PATH or /usr/5bin (see config.log for reasons).

*********************************************************************************
lfs@ametchia:/mnt/lfs/sources/gmp$ echo $PATH
/tools/bin:/bin:/usr/bin

Hi,

you are not supposed to build gmp and mpfr separately. Just untar them into gcc's source directory and rename them as stated in the book. The only configure command that you run is gcc's configure. It will automatically configure gmp and mpfr, too.

AlphaBravo 05-05-2010 03:45 PM

LFS 6.4? You should use either 6.6 or SVN. Preferably SVN.

Quote:

Originally Posted by druuna (Post 3957959)
Hi,

Do _not_ use BLFS packages when building LFS!!

As long as you install them late in the process (like, after gettext), and don't forget dependencies, it will be okay. I always install PAM & Cracklib before Shadow, along with PCRE + Reinstall Grep around that time.

druuna 05-06-2010 01:26 AM

Hi,
Quote:

Originally Posted by AlphaBravo (Post 3958468)
LFS 6.4? You should use either 6.6 or SVN. Preferably SVN.

Could you tell me why? There is nothing wrong with using LFS 6.4, although the newest stable version is 6.6. If the OP has 6.4 handy, why should s/he get 6.6?

Quote:

As long as you install them late in the process (like, after gettext), and don't forget dependencies, it will be okay. I always install PAM & Cracklib before Shadow, along with PCRE + Reinstall Grep around that time.
This is BS! And it will NOT be ok!

The OP is setting up the temporary environment (LFS chapter 5). Gettext and grep are installed later in that chapter (the order in which things are installed are for a specific reason), PAM and PCRE aren't even part of LFS (they are BLFS specific).

@freemanpolys: Just follow the book and all will be fine. Deviating from the book will get you in to trouble in the long run. If you have specific issues, just ask!

Hope this helps.

AlphaBravo 05-06-2010 02:16 AM

Quote:

Originally Posted by druuna (Post 3958883)
Hi,

Could you tell me why? There is nothing wrong with using LFS 6.4, although the newest stable version is 6.6. If the OP has 6.4 handy, why should s/he get 6.6?

Because 6.4 is outdated. 6.6 & SVN are freely available on the Internet. For installing BLFS packages while booted, that's what you have Chroot for. You can easily install an X WM & a Browser inside it.

Quote:

Originally Posted by druuna (Post 3958883)
This is BS! And it will NOT be ok!

The OP is setting up the temporary environment (LFS chapter 5). Gettext and grep are installed later in that chapter (the order in which things are installed are for a specific reason), PAM and PCRE aren't even part of LFS (they are BLFS specific).

I thank he was in Chapter 6. My mistake. Yes, in C5 you only do what the book says. but late in 6 you CAN install BLFS or packages - like Cloog-PPL (as long you first compile GCC w/o PPL then build it and recompile GCC - you need the C++ Headers).

And while PAM & PCRE are not part of LFS, that means nothing.

Also, MPFR & GMP are in LFS. And finally, if you're installing 6.6, remember to use Zlib 1.2.5 (instead of 1.2.4, which does not exist on the maintainers site), and change this line (6.11, installing zlib)
Code:

ln -sfv ../../lib/libz.so.1.2.4 /usr/lib/libz.so
Into this:
Code:

ln -sfv ../../lib/libz.so.1.2.5 /usr/lib/libz.so

druuna 05-06-2010 02:24 AM

Hi,

Quote:

Originally Posted by AlphaBravo (Post 3958924)
Because 6.4 is outdated. 6.6 & SVN are freely available on the Internet. For installing BLFS packages while booted, that's what you have Chroot for. You can easily install an X WM & a Browser inside it.

Most people install LFS as an exercise to learn more about linux and the way things are done. LFS 6.4 is not outdated (yes, it does use some older packages, I know). And like I already said: If the OP has LFS 6.4 handy and maybe s/he hasn't got a good/fast internet connection installing 6.4 doesn't do any harm whatsoever.

I don't get what you are trying to say about chrooted environments and BLFS and window managers. The OP clearly isn't at that point yet, so why bother with BLFS packages and workarounds that might or might not work?

Quote:

I thank he was in Chapter 6. My mistake. Yes, in C5 you only do what the book says. but late in 6 you CAN install BLFS or packages - like Cloog-PPL (as long you first compile GCC w/o PPL then build it and recompile GCC - you need the C++ Headers).

And while PAM & PCRE are not part of LFS, that means nothing.
This doesn't have anything to do with the OP's original question and is probably confusing.

Lets stay on topic here.

AlphaBravo 05-06-2010 04:31 AM

Quote:

Originally Posted by druuna (Post 3958930)
Hi,


Most people install LFS as an exercise to learn more about linux and the way things are done. LFS 6.4 is not outdated (yes, it does use some older packages, I know). And like I already said: If the OP has LFS 6.4 handy and maybe s/he hasn't got a good/fast internet connection installing 6.4 doesn't do any harm whatsoever.

I don't get what you are trying to say about chrooted environments and BLFS and window managers. The OP clearly isn't at that point yet, so why bother with BLFS packages and workarounds that might or might not work?


This doesn't have anything to do with the OP's original question and is probably confusing.

Lets stay on topic here.

The Chroot & WM was because you probably want to install X, and it's kinda hard to download packages while accessing the Internet in CLI (Although I'm sure EMACS can do it, with EMACS-W3M & EMACS Command Line Mode)

EDIT: EMACS can really do it. With a little help with EMACS-W3M.

freemanpolys 05-07-2010 01:47 AM

hi
I've build gcc packet! but i don't have the library libgcc.a in my gcc-build directory! is everything ok?

the result is that i can't create the soft link like this :

ln -vs libgcc.a `gcc -print-libgcc-file-name | \
sed 's/libgcc/&_eh/'`

here is the last output of the make install command:

make[3]: Leaving directory `/mnt/lfs/sources/gcc-build/i686-pc-linux-gnu/libiberty'
make[3]: Entering directory `/mnt/lfs/sources/gcc-build/i686-pc-linux-gnu/libiberty/testsuite'
make[3]: Nothing to be done for `install'.
make[3]: Leaving directory `/mnt/lfs/sources/gcc-build/i686-pc-linux-gnu/libiberty/testsuite'
make[2]: Leaving directory `/mnt/lfs/sources/gcc-build/i686-pc-linux-gnu/libiberty'
make[1]: Leaving directory `/mnt/lfs/sources/gcc-build'

druuna 05-07-2010 02:01 AM

Hi,

Assuming that you are still working on LFS 6.4, gcc pass 1 chapter 5.5.1, first a few questions:

- Did anything go wrong with the ./configure or the make steps?

- Is the output posted (the make install step) all the output that was shown?

- Did you do all the commands (except the mpfr and gmp steps) from the gcc-build directory ($LFS/sources/gcc-build, and not $LFS/sources/gcc-4.3.2)?

- Did you do as I suggested and use the LFS packages (and _not_ the blfs packages)?


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