Tuesday, June 1, 2010

Chapter 5.5 GCC

Unpack gcc from within $LFS/sources/ and enter directory $LFS/sources/gcc-4.4.3 The first time, something went wrong and that is when I realized the purpose of the tools directory. But I will review what I did first. Unpack in the $LFS/sources directory. CD into the gcc directory. There is a patch, which I am unfamiliar with, so I applied this command from within gcc directory (sorry to be repetitive but it is really important to keep track of where one is):  

patch -Np1 -i ../gcc-4.4.3-startfiles_fix-1.patch

I get message, patching file ..../sources/gcc-4.4.3/gcc.c Followed the rest of the instructions from the book until I got to the ln command. I knew this was a soft link and whenever I have done this in the past, I always created the link assuming that it would be made in the directory from which I ran the command. But, everything in sources/ was to be deleted so this did not make sense. I ran it and got an error, something about libgcc.a not being found. Oh. I tried using locate libgcc.a but that only found the one in /usr/lib which I am not supposed to use. This is when I looked at the tools directory and realized its importance (I mentioned this also in the binutils section of this blog). I saw the ownership conflicts between lfs and root and decided that I must be doing something wrong.

I started over. Delete all created directories in sources and tools. Re-installed bin-utils. This created 10 directories and 66 files in $LFS/tools directory (using tree). Re-installed gcc. I saw that the path $LFS/tools/bin.../lib/gcc/i686-lfs.../4.4.3/ was being created and that that is where the libgcc.a was located. I ran the soft link command from the $LFS/sources/gcc-4.4.3 directory and, to my surprise, it wrote it in the directory under tools. Well, curiosity got the best of me and I read the info page:info ln. It turns out that there are three ways to make a soft link, one of which is implied. These are my least favorite kind of commands:

If the `--target-directory' (`-t') option is given, or failing that if the last file is a directory and the `--no-target-directory' (`-T') option is not given, `ln' creates a link to each TARGET file in the specified directory, using the TARGETs' names.

This a bit confusing, from my perspective. But, no errors. Next, make mrproper gives me an error. No rule to make target. Well, searched around a bit and after wasting I don't know how much time, realized that I was suppposed to move on to the next package. I was so deep in following the instructions that I did not look at the Section headers. in $LFS/tools, tree command shows: 27 directories and 135 files.

No comments:

Post a Comment