LinuxQuestions.org
Review your favorite Linux distribution.
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 07-17-2017, 09:00 AM   #1
LFS_Tester
LQ Newbie
 
Registered: Jul 2017
Posts: 5

Rep: Reputation: Disabled
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
 
Old 07-17-2017, 09:11 AM   #2
Krejzi
Member
 
Registered: Jan 2015
Posts: 215

Rep: Reputation: Disabled
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).
 
Old 07-17-2017, 09:26 AM   #3
LFS_Tester
LQ Newbie
 
Registered: Jul 2017
Posts: 5

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Krejzi View Post
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?
 
Old 07-17-2017, 09:28 AM   #4
Krejzi
Member
 
Registered: Jan 2015
Posts: 215

Rep: Reputation: Disabled
Quote:
Originally Posted by LFS_Tester View Post
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?
Everything you asked is answered in http://www.linuxfromscratch.org/lfs/...tructions.html, especially in the second "Important" block.
 
  


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
Got error on trying to make gcc: "In file included from ../../gcc/cp/except.c:1023:0:" bibek22 Linux From Scratch 5 05-21-2016 07:28 AM
lfs 7.7 gcc build pass 2 fail on make JulianD Linux From Scratch 2 07-31-2015 01:13 AM
[SOLVED] Compilation error in GCC Pass 1 ethervoid Linux From Scratch 3 12-16-2014 03:23 PM
GCC compilation returns a "cannot execute binary file" error Antongarou Linux - Newbie 13 01-03-2009 07:28 PM
GCC Final Pass Error... LinuxNoob75 Linux From Scratch 5 08-07-2007 01:15 PM

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

All times are GMT -5. The time now is 09:54 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