LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-13-2014, 07:27 PM   #1
Skorpius7
LQ Newbie
 
Registered: May 2014
Posts: 20

Rep: Reputation: Disabled
Linux from Scratch Error installing GCC in Chapter 6


Hello All, I'm doing LFS through the LiveCD and Virtualbox for ease of installation and making mistakes. All has been well until now. I have reached the GCC installation in Chapter 6 and am receiving the following errors and am having trouble figuring out what's causing it:

Code:
     ./regex.o ./cplus-dem.o ./cp-demangle.o ./md5.o ./alloca.o ./argv.o ./choose-temp.o ./concat.o ./cp-demint.o ./dyn-string.o ./fdmatch.o ./fibheap.o ./floatformat.o ./fnmatch.o ./fopen_unlocked.o ./getopt.o ./getopt1.o ./getpwd.o ./getruntime.o ./hashtab.o ./hex.o ./lbasename.o ./lrealpath.o ./make-relative-prefix.o ./make-temp-file.o ./objalloc.o ./obstack.o ./partition.o ./pexecute.o ./physmem.o ./pex-common.o ./pex-one.o ./pex-unix.o ./safe-ctype.o ./sort.o ./spaces.o ./splay-tree.o ./strerror.o ./strsignal.o ./ternary.o ./unlink-if-ordinary.o ./xatexit.o ./xexit.o ./xmalloc.o ./xmemdup.o ./xstrdup.o ./xstrerror.o ./xstrndup.o  ./mkstemps.o
ar: error while loading shared libraries: libbfd-2.17.so: cannot open shared object file: No such file or directory
make[2]: *** [libiberty.a] Error 127
make[2]: Leaving directory `/sources/gcc-build/libiberty'
make[1]: *** [all-libiberty] Error 2
make[1]: Leaving directory `/sources/gcc-build'
make: *** [all] Error 2
I thought libiberty was suppressed? Thanks in advance!
 
Old 08-13-2014, 08:31 PM   #2
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,438

Rep: Reputation: 2842Reputation: 2842Reputation: 2842Reputation: 2842Reputation: 2842Reputation: 2842Reputation: 2842Reputation: 2842Reputation: 2842Reputation: 2842Reputation: 2842
Well the error seems strange to me as I would assume the version of libbfd would be the same as your copy of binutils.

That being said, your binutils install is the issue if this library cannot be seen.

As for libiberty, 127 errors are generally ignored and so the Error 2 I believe would be related to the libbfd issue.
 
Old 08-14-2014, 12:33 AM   #3
Skorpius7
LQ Newbie
 
Registered: May 2014
Posts: 20

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by grail View Post
Well the error seems strange to me as I would assume the version of libbfd would be the same as your copy of binutils.

That being said, your binutils install is the issue if this library cannot be seen.

As for libiberty, 127 errors are generally ignored and so the Error 2 I believe would be related to the libbfd issue.

This is what I get if I do a find:

Code:
root:/# find / -name libbfd-2.17.so
/sources/binutils-build/bfd/.libs/libbfd-2.17.so
/usr/lib/libbfd-2.17.so
Any ideas? I reverted to a snapshot of binutils but got the same error the second time through :/
 
Old 08-14-2014, 01:57 AM   #4
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,438

Rep: Reputation: 2842Reputation: 2842Reputation: 2842Reputation: 2842Reputation: 2842Reputation: 2842Reputation: 2842Reputation: 2842Reputation: 2842Reputation: 2842Reputation: 2842
My next guess would be to check your toolchain adjusting was all successful as it would appear that even though you have these items you are not linking to them.

I would also have a look at the output of:
Code:
ldd /path/to/ar
This will tell you where it is looking for the library.

Also, are you using the latest LFS book? I ask as binutils is 2.24 and I would think this would be under your /tools/lib directory??
 
Old 08-14-2014, 09:35 AM   #5
Skorpius7
LQ Newbie
 
Registered: May 2014
Posts: 20

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by grail View Post
My next guess would be to check your toolchain adjusting was all successful as it would appear that even though you have these items you are not linking to them.

I would also have a look at the output of:
Code:
ldd /path/to/ar
This will tell you where it is looking for the library.

Also, are you using the latest LFS book? I ask as binutils is 2.24 and I would think this would be under your /tools/lib directory??
Code:
root:/# ldd /path/to/ar
ldd: /path/to/ar: No such file or directory
root:/# echo $LFS
/mnt/lfs
Seems not to be finding the toolchain? hmm...So I went back a couple of snapshots and realized that this error for libbfd is occurring at the end of the pass of the binutils installation...Also, since this is the liveCD, this is binutils version 2.17.

EDIT: Did some digging and found that ldconfig was a solution. It seems to have worked for binutils, but when I get to gcc again, I run into another set of errors:

Code:
/usr/include/bits/local_lim.h:36:26: error: linux/limits.h: No such file or directory
make[2]: *** [crtbegin.o] Error 1
make[2]: Leaving directory `/sources/gcc-build/gcc'
make[1]: *** [all-gcc] Error 2
make[1]: Leaving directory `/sources/gcc-build'
make: *** [all] Error 2
Follow up to this error:


Code:
root:/# find / -name limits.h
/include/linux/limits.h
/sources/linux-2.6.22.1/include/linux/limits.h
/sources/linux-2.6.22.1/include/asm-arm26/limits.h
/sources/linux-2.6.22.1/include/asm-arm/limits.h
/sources/linux-2.6.22.1/usr/include/linux/limits.h
/sources/linux-2.6.22.1/dest/include/linux/limits.h
/sources/gcc-4.1.2/fixincludes/tests/base/sys/limits.h
/sources/gcc-4.1.2/libstdc++-v3/include/c_compatibility/limits.h
/sources/glibc-2.5.1/include/limits.h
/sources/gcc-build/gcc/include/limits.h
/usr/include/limits.h
/tools/include/linux/limits.h
/tools/include/limits.h
/tools/lib/gcc/x86_64-unknown-linux-gnu/4.1.2/include/limits.h
/tools/lib/gcc/x86_64-unknown-linux-gnu/4.1.2/install-tools/include/limits.h

Last edited by Skorpius7; 08-14-2014 at 09:57 AM.
 
Old 08-14-2014, 10:40 AM   #6
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,438

Rep: Reputation: 2842Reputation: 2842Reputation: 2842Reputation: 2842Reputation: 2842Reputation: 2842Reputation: 2842Reputation: 2842Reputation: 2842Reputation: 2842Reputation: 2842
hmmm ... we seem to be missing each other here.

Let me try again ...

The LiveCD contains binutils version 2.17, however, by the time you reach chapter 6 you are working from your temp system created in chapter 5, so assuming you are following the instructions from the latest LFS book (here then would have installed 2.24 of binutils and that should be the one in your temp system.

When referring to '/path/to/ar', I was hoping you would replace 'path' and 'to' with the actual path to the copy of ar you have installed in your temp system. I would guess something like:
Code:
$LFS/tools/bin/ar
Again this might not be the correct location, but I hope it is clearer as to what I was after. As another example, on my current system I would execute the following:
Code:
$ ldd /usr/bin/ar
	linux-vdso.so.1 (0x00007fffeb591000)
	libbfd-2.24.so => /usr/lib/libbfd-2.24.so (0x00007ff2e6587000)
	libc.so.6 => /usr/lib/libc.so.6 (0x00007ff2e61d9000)
	libdl.so.2 => /usr/lib/libdl.so.2 (0x00007ff2e5fd5000)
	libz.so.1 => /usr/lib/libz.so.1 (0x00007ff2e5dbf000)
	/lib64/ld-linux-x86-64.so.2 (0x00007ff2e68a0000)
Your latest error for limits would imply that your compilation is not looking in the correct location for the file.
This may also be part of the toolchain issue??
 
Old 08-14-2014, 11:01 AM   #7
Skorpius7
LQ Newbie
 
Registered: May 2014
Posts: 20

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by grail View Post
hmmm ... we seem to be missing each other here.

Let me try again ...

The LiveCD contains binutils version 2.17, however, by the time you reach chapter 6 you are working from your temp system created in chapter 5, so assuming you are following the instructions from the latest LFS book (here then would have installed 2.24 of binutils and that should be the one in your temp system.

When referring to '/path/to/ar', I was hoping you would replace 'path' and 'to' with the actual path to the copy of ar you have installed in your temp system. I would guess something like:
Code:
$LFS/tools/bin/ar
Again this might not be the correct location, but I hope it is clearer as to what I was after. As another example, on my current system I would execute the following:
Code:
$ ldd /usr/bin/ar
	linux-vdso.so.1 (0x00007fffeb591000)
	libbfd-2.24.so => /usr/lib/libbfd-2.24.so (0x00007ff2e6587000)
	libc.so.6 => /usr/lib/libc.so.6 (0x00007ff2e61d9000)
	libdl.so.2 => /usr/lib/libdl.so.2 (0x00007ff2e5fd5000)
	libz.so.1 => /usr/lib/libz.so.1 (0x00007ff2e5dbf000)
	/lib64/ld-linux-x86-64.so.2 (0x00007ff2e68a0000)
Your latest error for limits would imply that your compilation is not looking in the correct location for the file.
This may also be part of the toolchain issue??

Oh ok, I gotcha - yeah this is what I got:

Code:
/sources/binutils-build/binutils/.libs/ar
/usr/bin/ar
/tools/x86_64-unknown-linux-gnu/bin/ar
/tools/bin/ar
root:/# ldd /tools/bin/ar
        libc.so.6 => /tools/lib/libc.so.6 (0x00002b9930d7d000)
        /tools/lib64/ld-linux-x86-64.so.2 (0x00002b9930c61000)
As far as the version goes, I've been doing binutils-2.17 because thats what came in the source folder on the LiveCD - I am going by the old Guide ( Version SVN-x86_64-20070807)
 
Old 08-14-2014, 11:23 AM   #8
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,438

Rep: Reputation: 2842Reputation: 2842Reputation: 2842Reputation: 2842Reputation: 2842Reputation: 2842Reputation: 2842Reputation: 2842Reputation: 2842Reputation: 2842Reputation: 2842
Well as you can see from the output, your copy of ar has not been compiled with libbfd for some reason, so you will need to go back to chapter 5 as it would appear you must have missed a step

Whilst there is good support out there for most versions of LFS, I would probably recommend using the latest stable version (see my previous link) from online as your guide as something from 2007 may be harder to get the necessary support.
 
Old 08-14-2014, 12:49 PM   #9
Skorpius7
LQ Newbie
 
Registered: May 2014
Posts: 20

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by grail View Post
Well as you can see from the output, your copy of ar has not been compiled with libbfd for some reason, so you will need to go back to chapter 5 as it would appear you must have missed a step

Whilst there is good support out there for most versions of LFS, I would probably recommend using the latest stable version (see my previous link) from online as your guide as something from 2007 may be harder to get the necessary support.

Alright- thanks for everything so far! So as far as redoing Chapter 5 goes, can I just redo a portion of Chapter 5 to fix the problem, or would I need to start over from the beginning? I guess my question is, does redoing something from an earlier portion of LFS "break" the current system?
 
Old 08-15-2014, 05:23 AM   #10
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,438

Rep: Reputation: 2842Reputation: 2842Reputation: 2842Reputation: 2842Reputation: 2842Reputation: 2842Reputation: 2842Reputation: 2842Reputation: 2842Reputation: 2842Reputation: 2842
As chapter 5 creates the temp system, you will be deleting everything except for your initial setup from chapter 4.

So it is basically starting again, because binutils is the very first item compiled and as it is the trouble area, everything done after
that may be affected.
 
Old 08-15-2014, 05:47 AM   #11
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,838

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
Have you checked your system for "Host Requirements" as stated at beginning of book?
 
  


Reply

Tags
chapter, gcc, install, lfs, libiberty


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
gnu-gcc: command not found error after installing glibc in chapter 5.7 of LFS 7.2 Black Death Linux From Scratch 13 10-22-2014 10:47 AM
[SOLVED] Gcc error building tools on 7.4.rc1 chapter 5.10. GCC-4.8.1 - Pass 2 Keith Hedger Linux From Scratch 3 08-29-2013 11:30 AM


All times are GMT -5. The time now is 07:52 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration