LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 09-15-2013, 02:35 AM   #1
aashish_delhi
LQ Newbie
 
Registered: Aug 2012
Location: India
Distribution: Ubuntu 11.10
Posts: 12

Rep: Reputation: Disabled
Error buiding gcc pass 1


Hi All,
I am having issues building gcc pass 1 while following the lfs book. this is the error I get:
{code}
-fexceptions -fnon-call-exceptions -fvisibility=hidden -DHIDE_EXPORTS
/mnt/lfs/sources/gcc-build/./gcc/xgcc -B/mnt/lfs/sources/gcc-build/./gcc/ -B/tools/i686-lfs-linux-gnu/bin/ -B/tools/i686-lfs-linux-gnu/lib/ -isystem /tools/i686-lfs-linux-gnu/include -isystem /tools/i686-lfs-linux-gnu/sys-include -g -O2 -O2 -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -fpic -mlong-double-80 -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector -Dinhibit_libc -fpic -mlong-double-80 -I. -I. -I../.././gcc -I../../../gcc-4.8.1/libgcc -I../../../gcc-4.8.1/libgcc/. -I../../../gcc-4.8.1/libgcc/../gcc -I../../../gcc-4.8.1/libgcc/../include -I../../../gcc-4.8.1/libgcc/../libdecnumber/no -I../../../gcc-4.8.1/libgcc/../libdecnumber -DHAVE_CC_TLS -DUSE_TLS -o _udivmoddi4.o -MT _udivmoddi4.o -MD -MP -MF _udivmoddi4.dep -DL_udivmoddi4 -c ../../../gcc-4.8.1/libgcc/libgcc2.c \
-fexceptions -fnon-call-exceptions -fvisibility=hidden -DHIDE_EXPORTS
/mnt/lfs/sources/gcc-build/./gcc/xgcc -B/mnt/lfs/sources/gcc-build/./gcc/ -B/tools/i686-lfs-linux-gnu/bin/ -B/tools/i686-lfs-linux-gnu/lib/ -isystem /tools/i686-lfs-linux-gnu/include -isystem /tools/i686-lfs-linux-gnu/sys-include -g -O2 -O2 -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -fpic -mlong-double-80 -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector -Dinhibit_libc -fpic -mlong-double-80 -I. -I. -I../.././gcc -I../../../gcc-4.8.1/libgcc -I../../../gcc-4.8.1/libgcc/. -I../../../gcc-4.8.1/libgcc/../gcc -I../../../gcc-4.8.1/libgcc/../include -I../../../gcc-4.8.1/libgcc/../libdecnumber/no -I../../../gcc-4.8.1/libgcc/../libdecnumber -DHAVE_CC_TLS -DUSE_TLS -o decContext.o -MT decContext.o -MD -MP -MF decContext.dep -c ../../../gcc-4.8.1/libgcc/../libdecnumber/decContext.c
../../../gcc-4.8.1/libgcc/../libdecnumber/decContext.c:33:43: fatal error: string.h: No such file or directory
#include <string.h> /* for strcmp */
^
compilation terminated.
make[2]: *** [decContext.o] Error 1
make[2]: Leaving directory `/mnt/lfs/sources/gcc-build/i686-lfs-linux-gnu/libgcc'
make[1]: *** [all-target-libgcc] Error 2
make[1]: Leaving directory `/mnt/lfs/sources/gcc-build'
make: *** [all] Error 2

{code}

The lfs book version is 7.4. My host system is Linux Mint Release 15.
Before this problem I faced build issues with binutils-2.23.2 also, but I did not record the error. Googling around a bit gave me a hint to user MAKEINFO=true option with make, and it worked.

Back to the gcc build issue. I tried the build multiple times and did a make clean between attempts. The configure command I copied directly from the book after trying to build after typing it all by hand.
Please, please help me with this. If there is any other info that I must provide, please let me know.

Thanks in advance!
Aashish
 
Old 09-15-2013, 03:17 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Quote:
Originally Posted by aashish_delhi View Post
Before this problem I faced build issues with binutils-2.23.2 also, but I did not record the error. Googling around a bit gave me a hint to user MAKEINFO=true option with make, and it worked.
You need to forget about the gcc issue and go back to binutils.

All the commands needed are in the book and there is no need to add or subtract any commands. If you do encounter an error then the chances are that you did something wrong (unless it is mentioned in the book or the errata).

If you "fix" a problem by doing extra stuff not mentioned in the book then the chances are that it will come around and bite you later on.
 
Old 09-15-2013, 04:09 AM   #3
aashish_delhi
LQ Newbie
 
Registered: Aug 2012
Location: India
Distribution: Ubuntu 11.10
Posts: 12

Original Poster
Rep: Reputation: Disabled
Hi Drruna,
I agree that the book should be having all commands 'exactly' the way it is meant to be. It was all fine until I ran into the binutils issue. I have checked and rechecked, but I haven't been able to spot a mistake until that step. As per the LFS website there is no errata for the latest (7.4) book.
The workaround that I mentioned, I found it here:
https://lists.gnu.org/archive/html/b.../msg00025.html

Please take a look.
I'm now trying to run configure and make again for binutils. Will update soon.
Appreciate your help! :-)
Aashish
 
Old 09-15-2013, 04:52 AM   #4
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
To be honest, there's no point in looking at the solution you found. LFS works without having to do extra stuff that isn't in the book. There also hasn't been any mention of problems with binutils on the LFS mailing list.

Are you 100% sure that your host is compliant? Post the output of the version-check.sh script so we can have a look.

Also: Without any indication what went wrong with binutils we aren't able to help. Post the error shown (including +/- 10 lines leading up to the error).
 
Old 09-15-2013, 06:41 AM   #5
aashish_delhi
LQ Newbie
 
Registered: Aug 2012
Location: India
Distribution: Ubuntu 11.10
Posts: 12

Original Poster
Rep: Reputation: Disabled
I went back to building binutils first, and for some reason it worked just fine with make and make install. It must have been something I missed the first time around.

My host is Mint Linux which is forked out of Ubuntu, so I'm guessing it should work just fine. I'm really not sure what I'm missing here: I've been following the book to the very letter. No deviations at all.
Attaching outputs of version-check and configure of gcc-4.8.1.

Thanks!
Attached Files
File Type: txt version-check-out.txt (785 Bytes, 20 views)
File Type: txt configure_out.txt (4.5 KB, 16 views)
 
Old 09-15-2013, 07:14 AM   #6
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Its not entirely clear to me what you did or did not do: After successfully building Binutils-2.23.2 - Pass 1, did you remove the gcc and gcc-build directory before retrying GCC-4.8.1 - Pass 1 (as mentioned here: General Compilation Instructions)?

The gcc configure output you attached doesn't show any errors and in your first post you seem to have posted the output of the make command.
 
Old 09-15-2013, 07:30 AM   #7
aashish_delhi
LQ Newbie
 
Registered: Aug 2012
Location: India
Distribution: Ubuntu 11.10
Posts: 12

Original Poster
Rep: Reputation: Disabled
Sorry for all that confusion. Let me explain:
The make output in the first post shows the error that I got during gcc build. The build failed after running for a long time (not 5-10 mins). Outputs of version-check script and gcc configure were attached in my previous post. As you mentioned, there seems to be nothing wrong with gcc configure.

By my previous post I had gone back to binutils-build, did a make clean, configure, and then make and make install. As I said, it worked this time. But even after that the gcc build had failed with the same error.

As of writing this post I have deleted my gcc and gcc-build directories (to start over with gcc). I then extracted gcc from the tarball and then followed all the steps exactly as mentioned in the book (including making a new gcc-build directory, etc). I have started a new gcc build, which is in progress. Will post and update on that soon.

Thanks for your time!
Aashish.
 
Old 09-15-2013, 08:00 AM   #8
aashish_delhi
LQ Newbie
 
Registered: Aug 2012
Location: India
Distribution: Ubuntu 11.10
Posts: 12

Original Poster
Rep: Reputation: Disabled
It worked this time. I'm pretty sure I didn't do anything different from the last time when I started from scratch. Still, having said that, I'll be even more careful now to follow the book exactly.
Thanks for the prompt response! :-)
Aashish
 
  


Reply

Tags
gcc-4.8.1



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
[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
gcc-4.5.2 - Pass 1 error -gcc command not found ?? adi_30stm Linux From Scratch 20 11-17-2011 12:23 PM
Error GCC - pass 2 [Chapter 5.10] manya Linux From Scratch 1 09-06-2009 01:42 AM
GCC pass 1 error mugwump84 Linux From Scratch 2 05-10-2005 05:21 PM

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

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