LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Password
Linux From Scratch This Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.

Notices


Reply
  Search this Thread
Old 10-26-2009, 03:55 AM   #1
junust
Member
 
Registered: Jul 2008
Location: Israel Ramat Gan
Distribution: CentOs 5.3, SuSe 11.1, Solaris 9, Slackware 13
Posts: 81

Rep: Reputation: 15
creating a simlink after gcc-4.4.1 package has been installed


Hello,
I use LFS 6.5 book ver, my host system Centos 5.2
I did already install binutils and while installing gcc-4.4.1 package, the last thing to do is to create the symlink for libgcc_eh.a :
Code:
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:

ln -vs libgcc.a `$LFS_TGT-gcc -print-libgcc-file-name | \
sed 's/libgcc/&_eh/'`
a little bit confusing me, what is $LFS_TGT-gcc, I got $LFS_TGT variable defind and when I try to create the symlink following the command above it complaing me that:
Code:
ln -vs libgcc.a `$LFS_TGT-gcc -print-libgcc-file-name | \
> sed 's/libgcc/&_eh/'`

bash: i686-lfs-linux-gnu-gcc: command not found
create symbolic link `./libgcc.a' to `libgcc.a'
Just, I guess ,I missed something through reading the book but still could not find the problem, where $LFS_TGT-gcc definition took from
Code:
echo $ $LFS_TGT
i686-lfs-linux-gnu

Last edited by junust; 10-26-2009 at 03:59 AM.
 
Old 10-26-2009, 04:05 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

Which of these commands did you use:

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

OR

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

The second one being the correct command.

This is actually a oneliner and can also be written as:

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

Hope this helps.
 
Old 10-26-2009, 04:11 AM   #3
junust
Member
 
Registered: Jul 2008
Location: Israel Ramat Gan
Distribution: CentOs 5.3, SuSe 11.1, Solaris 9, Slackware 13
Posts: 81

Original Poster
Rep: Reputation: 15
Hi druuna

Quote:

This is actually a oneliner and can also be written as:

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

The same result...

Last edited by junust; 10-26-2009 at 04:22 AM.
 
Old 10-26-2009, 04:24 AM   #4
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

The question mark [previous post was edited during my reply] confuses me a bit. I have to assume you tried both commands and both have the same (failed) result.

What is the output of the following commands:

echo $PATH

ls -ld /tools/i686*

ls -l /tools/bin/i686*gcc
 
1 members found this post helpful.
Old 10-26-2009, 06:32 AM   #5
junust
Member
 
Registered: Jul 2008
Location: Israel Ramat Gan
Distribution: CentOs 5.3, SuSe 11.1, Solaris 9, Slackware 13
Posts: 81

Original Poster
Rep: Reputation: 15
Hi druuna
thank you for fast reply

Quote:
The question mark [previous post was edited during my reply] confuses me a bit. I have to assume you tried both commands and both have the same (failed) result.
You were rigth I did some edit to my original post

Code:

$echo $PATH
/tools/bin:/bin:/usr/bin
Quote:
ls -ld /tools/i686*

drwxr-xr-x 4 lfs lfs 4096 Oct 25 00:03 /tools/i686-lfs-linux-gnu

Code:
ls -l /tools/bin/i686*gcc
/bin/ls: i686*gcc : No such file or directory

strange, it is look like I don't have file tools/bin/i686-lfs-linux-gnu-gcc installed

By the way, I tried to install this package on another host(this time it is Suse 10 server) machine, and here there is a
Code:
 [lfs@suseLFS:/lfs> ls -l  tools/bin/i6*gcc
-rwxr-xr-x 2 lfss lfss 438499 Oct 26 20:22 tools/bin/i686-lfs-linux-gnu-gcc
I got this file
after installation has been complited, I successfully created symlink to libgcc.a file

What could be missed on my Centos 5.2 host system? Actually the quitions is why this file did not created, while compiltion and installation of gcc package

Last edited by junust; 10-26-2009 at 07:12 AM.
 
Old 10-26-2009, 07:51 AM   #6
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi again,

I can come up with 2 things:

1) Centos 5.2, as installed, isn't a suitable host for building LFS (did you do the iv. Host System Requirements step and all was ok?)

2) Something went wrong in the previous steps (either binutils or gcc).

If the first point is not the issue then I would suggest removing what you have done so far (I'm talking about chapter 5) and start over. Double check each step to see if anything odd happens.
 
Old 10-26-2009, 09:07 AM   #7
junust
Member
 
Registered: Jul 2008
Location: Israel Ramat Gan
Distribution: CentOs 5.3, SuSe 11.1, Solaris 9, Slackware 13
Posts: 81

Original Poster
Rep: Reputation: 15
Quote:
If the first point is not the issue then I would suggest removing what you have done so far (I'm talking about chapter 5) and start over. Double check each step to see if anything odd happens.

This is already the second time (and I guess the last one ) when I remove and rebuild my LFS system FROM THE SCRATCH . This time is the same to previas one, I don't know what was the problem exactly ,but cleaning the system totally helped me to install gcc pack successfuly at this time. I suppose that, it happend me throgh copy and past stuffs from the book, honestly said, I did not check things twice, so I guess, that is THE problem of mine

Big thanks to druuna for a help
 
Old 06-27-2012, 03:11 PM   #8
Noozy
LQ Newbie
 
Registered: Jun 2012
Distribution: Linux Mint 13, lubuntu 12.04, Arch
Posts: 4

Rep: Reputation: Disabled
Same problem - i686-lfs-linux-gnu-gcc: command not found

Hi all,

This is my first post in here as I am having no luck finding a resolution to this issue elsewhere. I have tried the lfs (Version 7.1) build five times now in the past two days on different machine. First was a fresh Arch VM install with all the pre-requisites, then I tried Arch native rather than a VM, then Linux Mint 13, then CentOS 6, finally today I am trying on Slackware 13.37.

Firstly, here is the output from the version check on the host:

Quote:
root@SLACK:~# bash version-check.sh
bash, version 4.1.10(2)-release
/bin/sh -> /bin/bash
Binutils: (Linux/GNU Binutils) 2.21.51.0.6.20110118
bison (GNU Bison) 2.4.3
/usr/bin/yacc -> /usr/bin/yacc
bzip2, Version 1.0.6, 6-Sept-2010.
Coreutils: 8.11
diff (GNU diffutils) 3.0
find (GNU findutils) 4.4.2
GNU Awk 3.1.8
/usr/bin/awk -> /bin/gawk-3.1.8
gcc (GCC) 4.5.2
(GNU libc) 2.13
grep (GNU grep) 2.7
gzip 1.4
Linux version 2.6.37.6 (root@midas) (gcc version 4.5.2 (GCC) ) #2 Sun Apr 10 01:09:12 CDT 2011
m4 (GNU M4) 1.4.16
GNU Make 3.82
patch 2.6.1
Perl version='5.12.3';
GNU sed version 4.2.1
tar (GNU tar) 1.26
Texinfo: makeinfo (GNU texinfo) 4.13
xz (XZ Utils) 5.0.2
gcc compilation OK
I haven't seen any errors during the building of binutils or the gcc build which finishes up with this...

Quote:
make[3]: Leaving directory `/mnt/lfs/sources/gcc-build/i686-lfs-linux-gnu/libgcc'
make[2]: Leaving directory `/mnt/lfs/sources/gcc-build/i686-lfs-linux-gnu/libgcc'
make[1]: Leaving directory `/mnt/lfs/sources/gcc-build'
Then when I try and create the symlink at the end it gives this...

Quote:
lfs:/mnt/lfs/sources/gcc-build$ ln -vs libgcc.a `$LFS_TGT-gcc -print-libgcc-file-name | sed 's/libgcc/&_eh/'`
bash: i686-lfs-linux-gnu-gcc: command not found
`./libgcc.a' -> `libgcc.a'
Not sure what other pertinent information I can provide right now, except maybe the ls output from the tools/bin directory:
Quote:
lfs:/mnt/lfs/tools/bin$ ls -l
total 52248
-rwxr-xr-x 1 lfs lfs 3238524 Jun 27 19:53 i686-lfs-linux-gnu-addr2line
-rwxr-xr-x 2 lfs lfs 3368094 Jun 27 19:53 i686-lfs-linux-gnu-ar
-rwxr-xr-x 2 lfs lfs 4773004 Jun 27 19:53 i686-lfs-linux-gnu-as
-rwxr-xr-x 1 lfs lfs 3196076 Jun 27 19:53 i686-lfs-linux-gnu-c++filt
-rwxr-xr-x 1 lfs lfs 67492 Jun 27 19:53 i686-lfs-linux-gnu-elfedit
-rwxr-xr-x 1 lfs lfs 3664125 Jun 27 19:53 i686-lfs-linux-gnu-gprof
-rwxr-xr-x 4 lfs lfs 4523674 Jun 27 19:53 i686-lfs-linux-gnu-ld
-rwxr-xr-x 4 lfs lfs 4523674 Jun 27 19:53 i686-lfs-linux-gnu-ld.bfd
-rwxr-xr-x 2 lfs lfs 3260259 Jun 27 19:53 i686-lfs-linux-gnu-nm
-rwxr-xr-x 2 lfs lfs 3853714 Jun 27 19:53 i686-lfs-linux-gnu-objcopy
-rwxr-xr-x 2 lfs lfs 4482754 Jun 27 19:53 i686-lfs-linux-gnu-objdump
-rwxr-xr-x 2 lfs lfs 3368093 Jun 27 19:53 i686-lfs-linux-gnu-ranlib
-rwxr-xr-x 1 lfs lfs 717501 Jun 27 19:53 i686-lfs-linux-gnu-readelf
-rwxr-xr-x 1 lfs lfs 3252784 Jun 27 19:52 i686-lfs-linux-gnu-size
-rwxr-xr-x 1 lfs lfs 3224506 Jun 27 19:53 i686-lfs-linux-gnu-strings
-rwxr-xr-x 2 lfs lfs 3853713 Jun 27 19:53 i686-lfs-linux-gnu-strip
Any help would be greatly appreciated and apologies for the long winded post.

Thanks.
 
Old 06-27-2012, 03:37 PM   #9
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Debian
Posts: 2,511
Blog Entries: 1

Rep: Reputation: 412Reputation: 412Reputation: 412Reputation: 412Reputation: 412
Hi

Have a look in $LFS/tools/bin. Thats where the file should be.
 
Old 06-27-2012, 03:47 PM   #10
Noozy
LQ Newbie
 
Registered: Jun 2012
Distribution: Linux Mint 13, lubuntu 12.04, Arch
Posts: 4

Rep: Reputation: Disabled
Hi,

Thanks for the quick reply...the directory listing I posted was for $LFS/tools/bin
 
Old 06-27-2012, 03:58 PM   #11
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Debian
Posts: 2,511
Blog Entries: 1

Rep: Reputation: 412Reputation: 412Reputation: 412Reputation: 412Reputation: 412
Sorry missed that, did you apply the patch which should of been in sources dir.
I have the i686-lfs-linux-gnu-gcc file in tools/bin. But I have done binutils pass2 I forgot to check when it was installed, I,m guessing it should be with gcc pass 1.
If you do rebuild gcc make sure you remove the gcc-build and gcc-4.6.2 dir.
 
Old 06-27-2012, 04:06 PM   #12
Noozy
LQ Newbie
 
Registered: Jun 2012
Distribution: Linux Mint 13, lubuntu 12.04, Arch
Posts: 4

Rep: Reputation: Disabled
Yes, I applied the patch that is mentioned in the book with...

Code:
patch -Np1 -i ../gcc-4.6.2-cross_compile-1.patch
However, I just looked back in the sources directory and there are two gcc patches. Should I apply both at this stage even though the second one is not mentioned in the Pass 1 section of the book?
Quote:
lfs:/mnt/lfs/sources$ ls -l gcc*
-rw-r--r-- 1 root root 1887 Mar 2 16:44 gcc-4.6.2-cross_compile-1.patch
-rw-r--r-- 1 root root 1446 Mar 2 16:44 gcc-4.6.2-startfiles_fix-1.patch
-rw-r--r-- 1 root root 71995338 Oct 26 2011 gcc-4.6.2.tar.bz2
 
Old 06-27-2012, 04:20 PM   #13
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Debian
Posts: 2,511
Blog Entries: 1

Rep: Reputation: 412Reputation: 412Reputation: 412Reputation: 412Reputation: 412
No just the 1 patch as mentioned.
As I said I,m not sure if i686-lfs-linux-gnu-gcc is installed although I think it should be,
Did you copy / paste the configure part.
 
Old 06-27-2012, 06:02 PM   #14
Noozy
LQ Newbie
 
Registered: Jun 2012
Distribution: Linux Mint 13, lubuntu 12.04, Arch
Posts: 4

Rep: Reputation: Disabled
Wow. Applying both patches worked.

Just finished the make install and made the symlink...

Quote:
lfs:/mnt/lfs/sources/gcc-build$ ln -vs libgcc.a `$LFS_TGT-gcc -print-libgcc-file-name | sed 's/libgcc/&_eh/'`
`/mnt/lfs/tools/bin/../lib/gcc/i686-lfs-linux-gnu/4.6.2/libgcc_eh.a' -> `libgcc.a'
I have no idea why....why are there two patches and the second one isn't documented in Chapter 5.5? Why has only applying one patch (apparently) worked for everyone else except me?

Anyway, on to the next step, thanks for your feedback. Oh, and to answer your question, yes in this as in all previous builds I copied/pasted everything from the book.

EDIT

For anyone else reading this thread with a similar problem, the contents now of the $LFS/tools/bin directory is...

Quote:
lfs:/mnt/lfs/tools/bin$ ls -l
total 54588
-rwxr-xr-x 1 lfs lfs 3238524 Jun 27 19:53 i686-lfs-linux-gnu-addr2line
-rwxr-xr-x 2 lfs lfs 3368094 Jun 27 19:53 i686-lfs-linux-gnu-ar
-rwxr-xr-x 2 lfs lfs 4773004 Jun 27 19:53 i686-lfs-linux-gnu-as
-rwxr-xr-x 1 lfs lfs 3196076 Jun 27 19:53 i686-lfs-linux-gnu-c++filt
-rwxr-xr-x 1 lfs lfs 762292 Jun 27 23:52 i686-lfs-linux-gnu-cpp
-rwxr-xr-x 1 lfs lfs 67492 Jun 27 19:53 i686-lfs-linux-gnu-elfedit
-rwxr-xr-x 2 lfs lfs 753741 Jun 27 23:52 i686-lfs-linux-gnu-gcc
-rwxr-xr-x 2 lfs lfs 753741 Jun 27 23:52 i686-lfs-linux-gnu-gcc-4.6.2
-rwxr-xr-x 1 lfs lfs 95367 Jun 27 23:52 i686-lfs-linux-gnu-gcov
-rwxr-xr-x 1 lfs lfs 3664125 Jun 27 19:53 i686-lfs-linux-gnu-gprof
-rwxr-xr-x 4 lfs lfs 4523674 Jun 27 19:53 i686-lfs-linux-gnu-ld
-rwxr-xr-x 4 lfs lfs 4523674 Jun 27 19:53 i686-lfs-linux-gnu-ld.bfd
-rwxr-xr-x 2 lfs lfs 3260259 Jun 27 19:53 i686-lfs-linux-gnu-nm
-rwxr-xr-x 2 lfs lfs 3853714 Jun 27 19:53 i686-lfs-linux-gnu-objcopy
-rwxr-xr-x 2 lfs lfs 4482754 Jun 27 19:53 i686-lfs-linux-gnu-objdump
-rwxr-xr-x 2 lfs lfs 3368093 Jun 27 19:53 i686-lfs-linux-gnu-ranlib
-rwxr-xr-x 1 lfs lfs 717501 Jun 27 19:53 i686-lfs-linux-gnu-readelf
-rwxr-xr-x 1 lfs lfs 3252784 Jun 27 19:52 i686-lfs-linux-gnu-size
-rwxr-xr-x 1 lfs lfs 3224506 Jun 27 19:53 i686-lfs-linux-gnu-strings
-rwxr-xr-x 2 lfs lfs 3853713 Jun 27 19:53 i686-lfs-linux-gnu-strip

Last edited by Noozy; 06-27-2012 at 06:06 PM.
 
Old 06-28-2012, 11:43 AM   #15
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Debian
Posts: 2,511
Blog Entries: 1

Rep: Reputation: 412Reputation: 412Reputation: 412Reputation: 412Reputation: 412
Glad you got it fixed. Still strange having to use the 2nd patch???
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to install gcc when a current gcc is installed but not responding Nadishka Linux - Newbie 6 10-15-2009 03:33 PM
LXer: Pretending a Package is Installed by Creating an Empty Package with Checkinstal LXer Syndicated Linux News 0 05-03-2009 03:10 PM
Do I need the GCC (4.0.3) package if I have Slackware 11 installed? duryodhan Linux From Scratch 9 01-31-2007 12:18 PM
package updater not finding gcc which is installed strimp099 Linux - Software 2 04-19-2006 07:41 PM
RPM package manager says package needs to be installed. But I already installed it! nick623 Linux - Software 2 05-24-2005 02:15 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch

All times are GMT -5. The time now is 03:38 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration