Unable to compile GCC-4.4.3, Pass 1

Chris Staub chris at beaker67.com
Fri Mar 26 04:18:05 PDT 2010


On 03/26/2010 07:04 AM, John Stephens wrote:
> Chris,
> 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.

It is very clear, and not only did I say where it's stated in the book, 
I explicitly spelled it out...
>
> 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:
>>>
>>> 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.
>
I know exactly what the book says. I will repeat what I just said 
above...if you look at the last note on page 5.3, it says that before 
you follow any of the instructions on a package installation page, you 
are to unpack that package's source and cd into the source directory. 
So, for GCC, you unpack the gcc-4.4.3 tarball, cd gcc-4.4.3, *then* do 
what the GCC page says. Again, this is in page 5.3 - however it is not 
the *only* important piece of info on that page, so be sure to go there 
and read it carefully - in fact, you might just want to keep page 5.3 
open and re-read it before every package.

>>
>> 2. The gcc-build directory is not in $LFS/sources, so that means that
>
> Correct, but that is contrary to the instructions.

Following what I just said above, if you are following the instructions 
given on page 5.3, which means you are starting from the GCC source 
directory (gcc-4.4.3) then gcc-build *will* be in $LFS/sources.

Similarly, since the GCC page says to unpack GMP and MPFR *before* 
gcc-build is created, that means you are in the GCC source dir when you 
do so.

So, to recap, unpack the GCC tarball, cd gcc-4.4.3, then do as stated on 
the GCC installation page, starting with unpacking GMP and MPFR and 
renaming their source dirs, then create and cd ../gcc-build. It is the 
exact same procedure for every package - you unpack the tarball, cd into 
the created source directory, then do as stated on the package's page, 
followed by removing the source and (and build, if created) dirs (which 
is explained in another note on page 5.3). For the same reason, 
binutils-build should also be located in $LFS/sources.



More information about the lfs-support mailing list