symlink in 5.4

Dan Nicholson dbn.lists at gmail.com
Wed Nov 7 15:48:04 PST 2007


On 11/7/07, Clyde Forrester <ccf3 at mindspring.com> wrote:
> I'm attempting LFS 6.3 using the LFS Live 6.3 CD.
> At the end of 5.4 GCC-4.1.2 - Pass 1
> I am to create a symlink.
> "ln -vs gcc /tools/bin/cc"
>
> The context puzzles me.
> I have been burned before by not reading the "! Important" parts in 5.1
> So I pay attention to those now.
> So it says "After installing each package, delete its source and build
> directories..."
>
> The way I figure, near the end of 5.4, I'm in $LFS/sources/gcc-build .
> Then I create a symlink,
> and dutifully step out of gcc-build,
> and nuke both gcc-build and gcc-4.1.2 directories from orbit,
> taking the symlink with it.
>
> So, what I'm I missing or not understanding here?
>
> Should I be deleting the source and build directories first,
> and then creating the symlink in $LFS/sources ?

Read `man ln' carefully. The ln syntax seems odd, but I assure you
that it works correctly in the LFS book. What that command says is
that you are making a link at /tools/bin/cc. That link targets "gcc".
Since "gcc" is not an absolute path, it is taken relative to the
directory of the link, /tools/bin. So, you just made a link
/tools/bin/cc -> /tools/bin/gcc, but without the absolute path to gcc.
That way, cc always points to the gcc in the same directory, so you
could move /tools/bin to /foo/bar and the link would still be valid.

--
Dan



More information about the lfs-support mailing list