LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (https://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   Creating a symlink to libgcc.a (https://www.linuxquestions.org/questions/linux-from-scratch-13/creating-a-symlink-to-libgcc-a-888490/)

Brandonkb 06-26-2011 08:02 PM

Creating a symlink to libgcc.a
 
Section 5.5.1 in LFS Version 6.8 and I'm using Fedora 15 as the host system.

Quote:

Using - - disable- shared means that the libgcc_ eh. a file isn't created and installed. The Glibc package
depends on this library as it uses - lgcc_ eh within its build system. This dependency can be satisfied by creating a
symlink to libgcc. a, since that file will end up containing the objects normally contained in libgcc_ eh. a:
Code:

ln -vs libgcc.a `$LFS_TGT-gcc -print-libgcc-file-name | \
    sed 's/libgcc/&_eh/'`


This command gives me the following error:

Code:

ln: failed to create symbolic link 'x86_64-lfs-linux-gnu-gcc -print-libgcc-file-name | sed \'s/libgcc/&_eh\'': No such file or directory
I ran a couple of finds and came up with these locations:

Code:

/mnt/lfs/tools/bin/x86_64-lfs-linux-gnu-gcc
and

Code:

/mnt/lfs/sources/gcc-build/gcc/libgcc.a
/mnt/lfs/sources/gcc-build/x86_64-lfs-linux-gnu/libgcc/libgcc.a
/mnt/lfs/tools/lib/gcc/x86_64-lfs-linux-gnu/4.5.2/libgcc.a
/usr/lib/gcc/x86_64-redhat-linux/4.6.0/32/libgcc.a
/usr/lib/gcc/x86_64-redhat-linux/4.6.0/libgcc.a

This is second time I've run into this problem. The first time I found http://www.linuxquestions.org/questi...talled-764479/ and decided just to start over.

Is this a place where I'll have to deviate from the book because I'm using x86_64? If so, how would I modify the command and where can I learn more about why?

Snark1994 06-27-2011 10:32 AM

I would guess it's complaining that libgcc.a doesn't exist in the directory you're running it in. What directory are you in? And which should you be in?

Brandonkb 06-27-2011 10:58 AM

The book was unclear about it.
I've tried /mnt/lfs/sources/gcc-build/ because that's where I already was.

I didn't want to create a seemingly correct link and screw up glibc later so I haven't tried any others.

Would /mnt/lfs/tools/lib/gcc/x86_64-lfs-linux-gnu/4.5.2/ be the correct one?
Or maybe /mnt/lfs/tools/bin/?

druuna 06-27-2011 11:20 AM

Hi,

This looks strange:
Quote:

ln: failed to create symbolic link 'x86_64-lfs-linux-gnu-gcc -print-libgcc-file-name | sed \'s/libgcc/&_eh\'': No such file or directory
It shows the commands and not the output of the command (which is a directory and a file).

Are you sure you used back-ticks and not single quotes? I.e.:
Code:

`$LFS_TGT-gcc -print-libgcc-file-name | sed 's/libgcc/&_eh/'`
vs
'$LFS_TGT-gcc -print-libgcc-file-name | sed 's/libgcc/&_eh/'' -> this is wrong

About the ln -sv .... command: It doesn't matter where you execute it from. The link is created from libgcc.a (the actual existing file) to libgcc_eh.a in the directory that the above command produces (on my system that is: (/mnt/lfs)/tools/lib/gcc/x86_64-lfs-linux-gnu/4.5.2).

There's no need to deviate from the book at any point, it works as described.

Brandonkb 06-27-2011 11:49 AM

I wasn't aware that there was a difference between backticks and single quotes.
You'd figure I would have learned that in school at some point...

I'll jump right on it when I get home from work and I'll let you know how it goes.
Thank you both for your help.

druuna 06-27-2011 11:50 AM

You're welcome :)

Brandonkb 06-27-2011 05:32 PM

Worked first try.


All times are GMT -5. The time now is 08:10 PM.