Unable to compile GCC-4.4.3, Pass 1

Chris Staub chris at beaker67.com
Fri Mar 26 08:33:09 PDT 2010

On 03/26/2010 09:54 AM, John Stephens wrote:
> Chris and Phillippe,
> Thanks for the insights.  Like I stated before, I was either missing
> something conceptually or misinterpreting something.
> I took the instructions "The GCC documentation recommends building GCC
> outside of the source directory in a dedicated build directory." to
> mean outside of /mnt/lfs/source (i.e. at the /mnt/lfs level) instead
> of outside  /mnt/lfs/source/gcc-4.4.3 (i.e. at the /mnt/lfs/source
> level).  Subtle, but important difference.

Yes, this is referring specifically to GCC's source directory, not the 
$LFS/sources dir, and a few people have said they were slightly confused 
by this as well, but then I think the way it is in the book is clear 
enough as it is. I believe LFS' intended audience should be able to 
understand that distinction.

Also, the text is really just explaining why you are doing the commands, 
and the exact commands you are to be doing are right there - if you 
simply take the information on page 5.3 (which applies to all packages), 
and just go to each package and run the commands while ignoring the 
majority of the text (not recommended of course, but possible) then 
everything will likely work fine. In this case, the comment about the 
GCC docs recommending it be built in a separate dir is nothing more than 
explaining the reason for the following command, which is what actually 
creates that build directory. Technically /mnt/lfs/gcc-build also fits 
that sentence, as it is also outside the source dir, but then if you've 
been following the instructions (particularly the oft-repeated note 
about starting in the GCC source dir) then you simply are not going to 
create /mnt/lfs/gcc-build.

Also, the fact that /mnt/lfs/gcc-build is not correct should become 
fairly obvious when you simply cannot create is as the lfs user. Many 
people tend to assume at that point that the book left out a step, and 
proceed either to chown $LFS, or use sudo to create the build dir in 
/mnt/lfs. In general the first step whenever you have an error should be 
to go back and check to see whether you've followed all the 
instructions, rather than (what most people do) just make assumptions 
and proceed to do things like force it with root.

> This being the case, should the instructions on 5.5.1 (assuming I am
> sitting in /mnt/lfs/source/gcc-4.4.3 as instructed):
> 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
> really be:
> 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
> Seriously, I am not attempting to be argumentative and again I might
> be missing something here.  However this and the issue with "source
> directory" has caused me a little grief.

No, the instructions are correct as they are. Again, you are assumed (as 
per the Note on page 5.3) to be doing those commands from within the GCC 
source dir, so GMP and MPFR will be unpacked there, and that is where 
their unpacked source directories will be.

More information about the lfs-support mailing list