[SOLVED] GCC Compilation Error on final pass "6.20. GCC-7.1.0" - Make Fail
Linux From ScratchThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
GCC Compilation Error on final pass "6.20. GCC-7.1.0" - Make Fail
I am on the compilation of GCC for LFS and I keep getting errors ("http://www.linuxfromscratch.org/lfs/view/development/chapter06/gcc.html").
When I first started compiling with make, I got the following error:
GCC installation error configure: error: source directory already configured; run "make distclean" there first -- This was for gmp.
After going into the gmp folder and running "make distclean", I ran the GCC build again. This time It proceeded further, however I got the same error for mpfr. I went into mpfr and mpc folders and ran "make distclean".
Ran GCC again, and it had significant progress, until the following error:
***
collect2: error: ld returned 1 exit status
../../gcc/lto/Make-lang.in:81: recipe for target 'lto1' failed
make[2]: *** [lto1] Error 1
make[2]: Leaving directory '/sources/gcc-7.1.0/build3/gcc'
Makefile:4242: recipe for target 'all-gcc' failed
make[1]: *** [all-gcc] Error 2
make[1]: Leaving directory '/sources/gcc-7.1.0/build3'
Makefile:903: recipe for target 'all' failed
make: *** [all] Error 2
**
Some notes:
This is all in build3 folder, as build 1 and 2 folders contain gcc pass 1 and 2 respectively.
the mpfr, mpc and gmp folders are also in the gcc folder (there are no "build" folders within them).
Last edited by LFS_Tester; 07-17-2017 at 09:01 AM.
Reason: Grammar
Given the fact that gmp, mpfr and mpc were inside gcc source directory, it means you were reusing previously unpacked source dirs, from chapter 5. You should not do that. Remove source and build directories after you finish the build, unpack them before starting a new one. If that was indeed your case, I guess your chapter 5 build is screwed as well, I suggest you start over, keeping in mind what I just said (and what the book says, just before binutils pass 1 in chapter 5).
Given the fact that gmp, mpfr and mpc were inside gcc source directory, it means you were reusing previously unpacked source dirs, from chapter 5. You should not do that. Remove source and build directories after you finish the build, unpack them before starting a new one. If that was indeed your case, I guess your chapter 5 build is screwed as well, I suggest you start over, keeping in mind what I just said (and what the book says, just before binutils pass 1 in chapter 5).
Just to be clear, as I did not completely understand.
In GCC pass 1, I unpacked and moved gmpc, mpfr and mpc into the GCC folder. Inside a build1 folder (in the GCC folder), I compiled GCC (Pass 1). After doing this, I was supposed to delete the mpfr, mpc, gmp and build1 folders inside the GCC folders? What would I do with packages which I did not use build folders for? Are build folders required for all packages, which then have to be deleted after making them?
I guess that's why in GCC pass 2 they tar and move the gmp, mpfr and mpc folders into GCC again.
Also, when compiling gmp (6.17), mpc (6.19) and mpfr (6.18) "http://www.linuxfromscratch.org/lfs/view/development/chapter06/mpfr.html" in chapter 6, This is NOT in the GCC folder?
Just to be clear, as I did not completely understand.
In GCC pass 1, I unpacked and moved gmpc, mpfr and mpc into the GCC folder. Inside a build1 folder (in the GCC folder), I compiled GCC (Pass 1). After doing this, I was supposed to delete the mpfr, mpc, gmp and build1 folders inside the GCC folders? What would I do with packages which I did not use build folders for? Are build folders required for all packages, which then have to be deleted after making them?
I guess that's why in GCC pass 2 they tar and move the gmp, mpfr and mpc folders into GCC again.
Also, when compiling gmp (6.17), mpc (6.19) and mpfr (6.18) "http://www.linuxfromscratch.org/lfs/view/development/chapter06/mpfr.html" in chapter 6, This is NOT in the GCC folder?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.