LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (https://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   Make error for GCC in chapter 6: libmpc.so.3: cannot open shared object file: No such file or directory (https://www.linuxquestions.org/questions/linux-from-scratch-13/make-error-for-gcc-in-chapter-6-libmpc-so-3-cannot-open-shared-object-file-no-such-file-or-directory-4175654202/)

mattersonline 05-19-2019 12:20 PM

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.

drillsar 05-19-2019 09:19 PM

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..

hazel 05-20-2019 04:45 AM

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.

mattersonline 05-20-2019 11:45 AM

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


mattersonline 05-20-2019 11:58 AM

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.

hazel 05-20-2019 12:17 PM

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!

drillsar 05-20-2019 06:48 PM

Yes for sure something is wrong. You may have to start all over again unless you saved tool set before chapter 6 adjustments.

drillsar 05-20-2019 06:50 PM

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.

mattersonline 05-20-2019 10:35 PM

Alright, thank you so much. I went ahead and started over. This time I'll be much more careful.

Luridis 05-21-2019 03:22 PM

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


All times are GMT -5. The time now is 06:00 AM.