LinuxQuestions.org
Help answer threads with 0 replies.
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 11-23-2011, 11:49 AM   #1
nerdy117
LQ Newbie
 
Registered: Nov 2011
Posts: 4

Rep: Reputation: Disabled
"C preprocessor... ...fails sanity check" in LFS 7.0 chapter 6.17


I'm trying to follow the directions as closely as I can to build GCC-4.6.1, but I keep getting this error. The host is Ubuntu in case you're wondering, but I'm not sure that actually makes a difference in this case. I've seen other threads were people have very similar problems on different distros, and the recommendation is always to install g++, which isn't mentioned in the book. Should I be installing it on the host? Or is something wrong?

Code:
checking for /sources/gcc-build/./gcc/xgcc -B/sources/gcc-build/./gcc/ -B/usr/x86_64-unknown-linux-gnu/bin/ -B/usr/x86_64-unknown-linux-gnu/lib/ -isystem /usr/x86_64-unknown-linux-gnu/include -isystem /usr/x86_64-unknown-linux-gnu/sys-include    option to accept ISO C89... unsupported
checking how to run the C preprocessor... /lib/cpp
configure: error: in `/sources/gcc-build/x86_64-unknown-linux-gnu/libgcc':
configure: error: C preprocessor "/lib/cpp" fails sanity check
See `config.log' for more details.
make[1]: *** [configure-target-libgcc] Error 1
make[1]: Leaving directory `/sources/gcc-build'
make: *** [all] Error 2
root:/sources/gcc-build#
I'd include the config.log, but it's really big and I'm not sure how to attatch a file to the thread. If anyone needs to see it though, I'd be happy to upload it somewhere and give you guys a link.

UPDATE: I put the contents of config.log on pastebin for you guys. Here ya go:
http://pastebin.com/Znmm5Ghm

Last edited by nerdy117; 11-23-2011 at 11:58 AM. Reason: just added a link to the file
 
Old 11-23-2011, 11:54 AM   #2
corp769
LQ Guru
 
Registered: Apr 2005
Location: /dev/null
Posts: 5,818

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
You could always upload to pastebin and copy/paste the URL for is, it would make it a hell lot easier.
 
Old 11-23-2011, 11:54 AM   #3
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Debian
Posts: 2,511
Blog Entries: 1

Rep: Reputation: 412Reputation: 412Reputation: 412Reputation: 412Reputation: 412
Hi i see you are using Ubuntu as host did you make sure it was compliant http://www.linuxfromscratch.org/lfs/.../hostreqs.html
also you can use pastebin.com for large log files
 
Old 11-23-2011, 12:33 PM   #4
nerdy117
LQ Newbie
 
Registered: Nov 2011
Posts: 4

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by spiky0011 View Post
Hi i see you are using Ubuntu as host did you make sure it was compliant http://www.linuxfromscratch.org/lfs/.../hostreqs.html
also you can use pastebin.com for large log files
I checked through all the requirements, and the host has everything and at a higher version. The only questionable packages were Glibc-2.5.1 and Linux Kernel-2.6.25, neither of which I could find in the Synaptic Package Manager. I'm running Ubuntu 11.04 though, so I'm pretty sure I'm okay as far as that goes. What's a good distro to use as a host?
 
Old 11-23-2011, 01:00 PM   #5
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Debian
Posts: 2,511
Blog Entries: 1

Rep: Reputation: 412Reputation: 412Reputation: 412Reputation: 412Reputation: 412
did you run the version script against ubuntu there were a few failures I had
 
Old 11-23-2011, 03:46 PM   #6
nerdy117
LQ Newbie
 
Registered: Nov 2011
Posts: 4

Original Poster
Rep: Reputation: Disabled
I actually never noticed that there was a version script. In fact, I thought the list ended at the Linux-Kernel, so that's sort of embarassing But I ran the script, and everything turned up with a newer version than required with the exception of Texinfo, which I was missing. I satisfied that and tried to compile again, but it failed with the same error. Any other advice?
 
Old 11-23-2011, 04:20 PM   #7
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Debian
Posts: 2,511
Blog Entries: 1

Rep: Reputation: 412Reputation: 412Reputation: 412Reputation: 412Reputation: 412
When you restarted the build of GCC did you remove the gcc dir and gcc-build dir and untar gcc again? also when restarting did you carry out chapter 2.4/ making sure echo $LFS is correct. Then chapter 6.2 then enter chroot 6.4
 
Old 11-24-2011, 11:52 AM   #8
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
Hi,

Quote:
Originally Posted by nerdy117
I've seen other threads were people have very similar problems on different distros, and the recommendation is always to install g++, which isn't mentioned in the book. Should I be installing it on the host?
Yes, you should.

Quote:
Originally Posted by nerdy117
I actually never noticed that there was a version script. In fact, I thought the list ended at the Linux-Kernel, so that's sort of embarassing But I ran the script, and everything turned up with a newer version than required with the exception of Texinfo, which I was missing. I satisfied that and tried to compile again, but it failed with the same error. Any other advice?
Even though you are already working on chapter 6 and most of the requirements aren't valid any more ,you're using what has been build in chapter 5, but for a few exceptions; Can you post the output of the version-check.sh script?
 
Old 11-24-2011, 05:27 PM   #9
nerdy117
LQ Newbie
 
Registered: Nov 2011
Posts: 4

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by spiky0011 View Post
When you restarted the build of GCC did you remove the gcc dir and gcc-build dir and untar gcc again? also when restarting did you carry out chapter 2.4/ making sure echo $LFS is correct. Then chapter 6.2 then enter chroot 6.4
This WORKED! More specifically, removing the gcc-4.6.1 folder and untarring the archive again. I'll definitely keep this in mind for the next time I plan on doing this, and I really hope this thread helps out anybody that has the same problem as me. Thanks for your help
 
Old 11-24-2011, 11:38 PM   #10
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
Hi,
Quote:
Originally Posted by nerdy117 View Post
This WORKED! More specifically, removing the gcc-4.6.1 folder and untarring the archive again. I'll definitely keep this in mind for the next time I plan on doing this, and I really hope this thread helps out anybody that has the same problem as me. Thanks for your help
This is mentioned in the LFS book: Last important box, point e
 
  


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
[SOLVED] "C preprocessor "/lib/cpp" fails sanity check" every single time. masmddr Linux - Software 3 08-03-2010 10:37 AM
GCC fails to compile - Chapter 6.14 - C preprocessor "/lib/cpp" fails sanity check jaydoc Linux From Scratch 1 01-28-2009 05:17 PM
error: C++ preprocessor "/lib/cpp" fails sanity check marek345 Linux - Software 4 11-06-2008 09:49 AM
error: C++ preprocessor "/lib/cpp" fails sanity check i.you Linux - Software 3 03-06-2007 02:24 AM
error: C preprocessor "/lib/cpp" fails sanity check Master Fox Linux - Software 0 10-14-2004 03:39 PM

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

All times are GMT -5. The time now is 03:51 AM.

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