LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 05-19-2019, 12:20 PM   #1
mattersonline
LQ Newbie
 
Registered: May 2019
Posts: 4

Rep: Reputation: Disabled
Make error for GCC in chapter 6: libmpc.so.3: cannot open shared object file: No such file or directory


While compiling gcc in chapter 6.21, I'm getting the following make error:
Code:
make[2]: Entering directory '/sources/gcc-8.2.0/build/gcc'
/sources/gcc-8.2.0/build/./gcc/xgcc -B/sources/gcc-8.2.0/build/./gcc/ -xc -nostdinc /dev/null -S -o /dev/null -fself-test=../../gcc/testsuite/selftests
/sources/gcc-8.2.0/build/./gcc/cc1: error while loading shared libraries: libmpc.so.3: cannot open shared object file: No such file or directory
make[2]: *** [Makefile:1976: s-selftest-c] Error 1
make[2]: Leaving directory '/sources/gcc-8.2.0/build/gcc'
make[1]: *** [Makefile:4271: all-gcc] Error 2
make[1]: Leaving directory '/sources/gcc-8.2.0/build'
make: *** [Makefile:906: all] Error 2
I found libmpc.so.3 in /usr/lib, so I figure that gcc is looking in the wrong place and the few articles I've found on this subject say that I'm missing a symbolic link but I'm not really sure what to do.
 
Old 05-19-2019, 09:19 PM   #2
drillsar
Member
 
Registered: Jan 2017
Posts: 144

Rep: Reputation: Disabled
I would retry.. what commands did you use? I would go back and check 6.10. Adjusting the Toolchain if those all check out go to 6.19 and reinstall..
 
Old 05-20-2019, 04:45 AM   #3
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,637
Blog Entries: 19

Rep: Reputation: 4469Reputation: 4469Reputation: 4469Reputation: 4469Reputation: 4469Reputation: 4469Reputation: 4469Reputation: 4469Reputation: 4469Reputation: 4469Reputation: 4469
Try
Code:
ls /usr/lib|grep mpc
You should get three hits:
Code:
libmpc.so
libmpc.so.3
libmpc.so.3.1.0
The first two are links, the third is the actual library.
 
Old 05-20-2019, 11:45 AM   #4
mattersonline
LQ Newbie
 
Registered: May 2019
Posts: 4

Original Poster
Rep: Reputation: Disabled
After running the command this is what I got.
Code:
(lfs chroot) root:/sources/gcc-8.2.0/build# ls /usr/lib|grep mpc
libmpc.la
libmpc.so
libmpc.so.3
libmpc.so.3.1.0
As for the commands I used, I copy pasted them from the book.
Code:
case $(uname -m) in
  x86_64)
    sed -e '/m64=/s/lib64/lib/' \
        -i.orig gcc/config/i386/t-linux64
  ;;
esac

rm -f /usr/lib/gcc

SED=sed                               \
../configure --prefix=/usr            \
             --enable-languages=c,c++ \
             --disable-multilib       \
             --disable-bootstrap      \
             --disable-libmpx         \
             --with-system-zlib
 
Old 05-20-2019, 11:58 AM   #5
mattersonline
LQ Newbie
 
Registered: May 2019
Posts: 4

Original Poster
Rep: Reputation: Disabled
I did the first couple of commands 6.10 but there was no adjusted linker to move so I undid them. I'm afraid of amending the specs file and doing something I can't undo easily because my gcc is not working right now because I installed the broken compiler.
What's happening is I get past the cc command with no errors but the readelf produces no output. In fact I did all of the checks on the dummy.log file after installing gcc and they all pass.
 
Old 05-20-2019, 12:17 PM   #6
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,637
Blog Entries: 19

Rep: Reputation: 4469Reputation: 4469Reputation: 4469Reputation: 4469Reputation: 4469Reputation: 4469Reputation: 4469Reputation: 4469Reputation: 4469Reputation: 4469Reputation: 4469
Well, you've answered it yourself then. You did something wrong at an earlier stage. I hope you saved your tool set as suggested before making the chapter 6 adjustments. If so, you can clear everything except $LFS/sources, reinstall $LFS/tools and start chapter 6 again. Otherwise, you'll need to start from the beginning.

Not unusual for a first try at LFS!
 
Old 05-20-2019, 06:48 PM   #7
drillsar
Member
 
Registered: Jan 2017
Posts: 144

Rep: Reputation: Disabled
Yes for sure something is wrong. You may have to start all over again unless you saved tool set before chapter 6 adjustments.
 
Old 05-20-2019, 06:50 PM   #8
drillsar
Member
 
Registered: Jan 2017
Posts: 144

Rep: Reputation: Disabled
LFS you need to really be careful step by step. Another way is use JHALFS which is automated but takes the fun out of it. Also make sure always save your tool set very important before moving to chapter 6.
 
Old 05-20-2019, 10:35 PM   #9
mattersonline
LQ Newbie
 
Registered: May 2019
Posts: 4

Original Poster
Rep: Reputation: Disabled
Alright, thank you so much. I went ahead and started over. This time I'll be much more careful.
 
Old 05-21-2019, 03:22 PM   #10
Luridis
Member
 
Registered: Mar 2014
Location: Texas
Distribution: LFS 9.0 Custom, Merged Usr, Linux 4.19.x
Posts: 616

Rep: Reputation: 167Reputation: 167
At the end of chapter 5, right after the chroot -R root:root /tools do this:

cd $LFS
tar -cJvpf sources/lfs-8.3-tools.tar.xz tools

If you ever need to replace them:

cd $LFS && rm -rf /tools
tar -xvpf sources/lfs-8.3-tools.tar.xz
 
  


Reply



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
"Cannot load library icui18n: (icui18n: cannot open shared object file: No such file or directory)" BW-userx Slackware 1 04-19-2019 08:13 AM
[SOLVED] ??? Error: libXp.so.6: cannot open shared object file: No such file or directory castles Linux - Newbie 9 03-26-2018 04:31 AM
apt-config:error while loading shared libraries: libgcc_s.so.1 cannot open shared object file: No such file or directory wenyumei Ubuntu 1 07-20-2016 10:58 AM
[SOLVED] cannot open shared object file: No such file or directory - but the file is there! Ook Slackware 5 08-24-2011 05:13 PM
Error: "libdmx.so.1: cannot open shared object file: No such file or directory" ESC201 Linux - Software 4 11-01-2008 08:38 PM

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

All times are GMT -5. The time now is 04:15 PM.

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