Unable to compile GCC-4.4.3, Pass 1

John Stephens jstephens at jkstephens.net
Fri Mar 26 04:04:27 PDT 2010

Thanks for the reply.  I've spent a lot of time in chapters 4 and 5.
I'm finding the book (6.6) a little unclear in certain areas which is
probably what is throwing me off to some degree.

For example, look at 5.5.1, first box.  It says:

tar -jxf ../mpfr-2.4.2.tar.bz2
mv -v mpfr-2.4.2 mpfr
tar -jxf ../gmp-5.0.0.tar.bz2
mv -v ../gmp-5.0.0 gmp

What is the point of reference for "../pkg-name"?  If I am in my
/mnt/lfs/sources dir, then the ../ takes me up to /mnt/lfs and the
source tarball is not there.

I haven't found any reference as to where I should be sitting
(directory wise...) when I issue the commands.

On Fri, Mar 26, 2010 at 12:29 AM, Chris Staub <chris at beaker67.com> wrote:
> On 03/25/2010 10:45 PM, John Stephens wrote:
>> Greetings,
>> I am attempting to build my first LFS project, but can't see to get past
>> the GCC, pass 1 compile.  FWIW, Linux is not new to me.  I have had an
>> interest in working through a LFS project for several years, and now I
>> actually have some time to do it.
>> I suspect I have a configuration setting gone wrong, however I am unable
>> to see what is going wrong.
>> I have a Ubuntu 9.10 host (AMD Athlon CPU, 1G memory).  I've defined an
>> lsf user and have a separate 50G partition mounted at /mnt/lfs.  All the
>> suggested symlinks are in place.
>> At this point, I believe all is OK.  GCC is then unpacked in
>> $LFS/gcc-build, mpfr-3.4.3 and gmp-5.0.0 are unpacked into
>> $LFS/gcc-build/gcc-4.4.3 as mpfr and gmp respectively.
>> GCC is then configured using:
>> lfs at Carina:/mnt/lfs/gcc-build/gcc-4.4.3$ ../gcc-4.4.3/configure
>> --target=$LFS_TGT --disable-nls --disable-shared --disable-multilib
>> --disable-decimal-float --disable-threads --disable-libmudflap
>> --disable-libssp --disable-libgomp --enable-languages=c
>> ...snip...
>> configure: creating ./config.status
>> config.status: creating Makefile
> I see 3 problems here...
> 1. The LFS book does not say to create gcc-build before unpacking the
> source tarball. Seems you need to take a close look at page 5.3, in
> particular the very last "Note" there - it says that you are to unpack
> the source tarball, cd into the created directory, *then* follow the
> instructions on the page.

Page 5.5.1 *DOES* say exactly that:
"The GCC documentation recommends building GCC outside of the source
directory in a dedicated build directory."

Then in the next box:
mkdir -v ../gcc-build
cd ../gcc-build

The line above the first box states that GCC requires GMP and MPFR.
Now, if mpfr and gmp are unpacked in /mnt/lfs/sources, GCC has no
access to them. The only way I could get GCC to do anything was to
move both pkgs into /mnt/lfs/gcc-build/gcc-4.4.3/.  But I am concerned
about that.

> 2. The gcc-build directory is not in $LFS/sources, so that means that

Correct, but that is contrary to the instructions.

> either you have become root (or used sudo) to create it, or you have
> chowned/chmodded $LFS, neither of which you should be doing. If you did
> this because you were getting permissions errors attempting to create
> gcc-build, see #1 above that will solve that issue. Also, do not use
> root/sudo at any point in Chapter 5 until you are told to, and if you
> did chown/chmod $LFS, change it back (owned by root, 755 permissions).

I've tried so many different things trying to get this to work that I
will go back and rebuild the environment again.  I don't believe I
have had any permission problems, but I will backtrack just to be sure

> 3. You forgot --prefix on that configure command. That would explain the
> permission errors on make install.

Funny thing... during my last attempt (which I used to get the
messages for this posting) I did forget the --prefix.

> I don't recognize the particular error you are getting and don't know
> whether it's related to any of the above issues, but the fact that you
> did miss those is an indicator that you do need to read a bit more
> closely. The compile errors you are getting are likely due to some other
> detail you've overlooked. Remove the GCC source and build dirs and try
> again, this time reading more slowly and carefully. If that still
> doesn't work, rm -rf /tools/* and go back to the beginning of Chapter 5.

I'll check the prereqs again and rebuild the environment (again.... :)
I've gone back and forth over chapters 4 and 5 so often that I can
almost quote them.  But obviously, I am missing something either
conceptually or I am mis-interpreting something.

>> If I try to do a "make install", I get the following:
>> lfs at Carina:/mnt/lfs/gcc-build/gcc-4.4.3$ make install
>> make[1]: Entering directory `/mnt/lfs/gcc-build/gcc-4.4.3'
>> /bin/bash ./mkinstalldirs /usr/local /usr/local
>> make[2]: Entering directory
>> `/mnt/lfs/gcc-build/gcc-4.4.3/host-i686-pc-linux-gnu/fixincludes'
>> rm -rf /usr/local/libexec/gcc/i686-lfs-linux-gnu/4.4.3/install-tools
>> /bin/bash ../.././fixincludes/../mkinstalldirs
>> /usr/local/libexec/gcc/i686-lfs-linux-gnu/4.4.3/install-tools
>> mkdir -p -- /usr/local/libexec/gcc/i686-lfs-linux-gnu/4.4.3/install-tools
>> mkdir: cannot create directory `/usr/local/libexec': Permission denied
>> make[2]: *** [install] Error 1
>> make[2]: Leaving directory
>> `/mnt/lfs/gcc-build/gcc-4.4.3/host-i686-pc-linux-gnu/fixincludes'
>> make[1]: *** [install-fixincludes] Error 2
>> make[1]: Leaving directory `/mnt/lfs/gcc-build/gcc-4.4.3'
>> make: *** [install] Error 2
> Obviously make install won't work if make has errors.

Yeah, but I included it for completeness....

>> Can anyone shed some light on this for me?
>> Thanks in advance.
>> John Stephens
> Bruce is right about gawk, and more generally that you have missed a
> page about Host System Requirements. I don't believe it affects GCC, but
> it does need to be addressed as otherwise it will cause problems later.
> --

More information about the lfs-support mailing list