LinuxQuestions.org
Review your favorite Linux distribution.
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-16-2011, 02:15 AM   #1
n1k0
LQ Newbie
 
Registered: Nov 2011
Posts: 3

Rep: Reputation: Disabled
GCC make error - lib/cpp fails sanity check


Hello. I am new to the forums, and I am in the middle of my first Linux From Scratch installation. I apologize in advance if this has been answered elsewhere, but I have been unable to find an answer either through google or on these forums for my specific question.

I am using version 7.0, and I am on chapter 6.17. My host system is Fedora 16. Up until now, everything has gone well, and all the tests and such have succeeded without error.

I am currently in a chrooted environment attempting the final install of GCC-4.6.1. When I attempt to issue the "make" command, I get the following error:

checking how to run the C preprocessor... /lib/cpp
configure: error: in `/sources/gcc-build/i686-pc-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

I am not sure what information is relevant from my config.log, so I won't post it now (but just ask if anyone wants it). I have tried a few different times, and I even copy/pasted the commands to make sure there were no typos, but I still get the same error.

I installed the necessary packages before attempting the GCC install, and I made sure to use a clean gcc-build directory and not the same one from the earlier pass (two problems that apparently caused other users the same error in the past). I'm sorta new to this, and I have been unable to figure out on my own how to fix this.

Does anyone know what may be causing this and/or how to fix it?

Any help is greatly appreciated. Thank you for your time.

Last edited by n1k0; 11-16-2011 at 02:15 AM. Reason: Added host system
 
Old 11-16-2011, 03:12 AM   #2
weibullguy
ReliaFree Maintainer
 
Registered: Aug 2004
Location: Kalamazoo, Michigan
Distribution: Slackware-current, Cross Linux from Scratch, Gentoo
Posts: 2,755
Blog Entries: 1

Rep: Reputation: 238Reputation: 238Reputation: 238
The configure script attempts to compile little snippets of code to check for the existence or operability of programs. This includes the compilers. If you look in config.log, you should be able to find the little snippet of code it was attempting to compile. There should be more information in that general vicinity as to what the problem is.
 
Old 11-16-2011, 03:40 AM   #3
n1k0
LQ Newbie
 
Registered: Nov 2011
Posts: 3

Original Poster
Rep: Reputation: Disabled
Thank you for your reply! I checked the config.log. There were some "checking for x, result: no" (i.e. bison, etc), but I figure that's just because I haven't gotten to the part where you install those yet, since I know they are installed on the host system. I found this, though, and it seems to be the cause of the error/s:

gcc version 4.6.1 (GCC)
configure:4195: $? = 0
configure:4184: gcc -V >&5
gcc: error: unrecognized option '-V'
gcc: fatal error: no input files
compilation terminated.
configure:4195: $? = 1| }
configure:5764: result: no
configure:5778: checking for version 0.11 (revision 0 or later) of PPL
configure:5795: gcc -c -g -O2 conftest.c >&5
conftest.c:10:19: fatal error: ppl_c.h: No such file or directory
compilation terminated.

configure:4184: gcc -qversion >&5
gcc: error: unrecognized option '-qversion'
gcc: fatal error: no input files
compilation terminated.
configure:4195: $? = 1
configure:4184: gcc -qversion >&5
gcc: error: unrecognized option '-qversion'
gcc: fatal error: no input files
compilation terminated.
configure:4195: $? = 1
configure:4184: gcc -qversion >&5
gcc: error: unrecognized option '-qversion'
gcc: fatal error: no input files
compilation terminated.

configure:5755: $? = 1| }
configure:5764: result: no
configure:5778: checking for version 0.11 (revision 0 or later) of PPL
configure:5795: gcc -c -g -O2 conftest.c >&5
conftest.c:10:19: fatal error: ppl_c.h: No such file or directory
compilation terminated.

configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| #define LT_OBJDIR ".libs/"
| /* end confdefs.h. */
|
| /* Override any GCC internal prototype to avoid an error.
| Use char because int might match the return type of a GCC
| builtin and then its argument prototype would still apply. */
| #ifdef __cplusplus
| extern "C"
| #endif
#endif
| char PWL_handle_timeout ();
| int
| main ()
| {
| return PWL_handle_timeout ();
| ;
| return 0;
| }
configure:5764: result: no
configure:5778: checking for version 0.11 (revision 0 or later) of PPL
configure:5795: gcc -c -g -O2 conftest.c >&5
conftest.c:10:19: fatal error: ppl_c.h: No such file or directory
compilation terminated.

------

So, admittedly having very little experience in this matter, it appears that there are a few different errors, i.e. passing the "-V" option, using the unrecognized '-qversion', a missing ppl_c.h file, and the failing confdefs.h.

I'm not sure what the "-V' option or '-qversion' mean, as I have been following the book exactly so far. Do you/anyone know why these options are either turned on or failing, and what course of action to take to address that? Ditto with the ppl_c.h file.

Secondly, regarding confdef.h, according to the conf.log, I just need to override the GCC internal prototype using "char" to avoid this error. Do you/anyone know how that can be done? Or maybe I just need to set all of those variables (PACKAGE_NAME, PACKAGE_TARNAME, etc.) somewhere...I didn't see anything regarding those in the documentation, though.

Thank you very much for your help. I know the answers are probably right in front of me, but being a noob, I can't quite figure them out.
 
Old 11-16-2011, 07:33 AM   #4
weibullguy
ReliaFree Maintainer
 
Registered: Aug 2004
Location: Kalamazoo, Michigan
Distribution: Slackware-current, Cross Linux from Scratch, Gentoo
Posts: 2,755
Blog Entries: 1

Rep: Reputation: 238Reputation: 238Reputation: 238
ppl_c.h is provided by PPL which should not be needed to build gcc. The others aren't causing your problem either.

You should see "C preprocessor "/lib/cpp" fails sanity check" somewhere in config.log. Or is this the entire config.log. Find that area or post the entire config.log wrapped in "code" tags. Something went wrong with an earlier package. Could be many things. If you Google the actual error message, you will get dozens of results. The only way to know which applies to you is config.log.

No, you don't need to override anything. That is a comment in the test program configure is using. It's not telling you to do anything, it's telling you what it's doing.
 
1 members found this post helpful.
Old 11-16-2011, 02:56 PM   #5
n1k0
LQ Newbie
 
Registered: Nov 2011
Posts: 3

Original Poster
Rep: Reputation: Disabled
Hey weibullguy, thanks very much for your reply. The config.logs didn't tell me much and had no mention of the preprocessor. However, I checked under the libgcc directory and checked the config.logs there (I probably should have just checked there in the first place ). It appears that I made an error while compiling glibc that apparently didn't show up until now.

Thankfully, I made a backup of the toolchain before adjusting it, and I was able to start over in chapter 6 and things went fine. Thanks again for pointing me in the right direction.

If anyone else has this problem, it helped to not just check the config.log but also the logs in the subdirectories and, like weibullguy advised, not just look for any error messages, but look for the specific message that caused the "make" fail, and then backtrack from there.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
lib/cpp fails sanity check angelo_maci Linux - Newbie 3 03-17-2010 05:15 PM
GCC fails to compile - Chapter 6.14 - C preprocessor "/lib/cpp" fails sanity check jaydoc Linux From Scratch 1 01-28-2009 06:17 PM
hplip configure error -- /lib/cpp fails sanity check pncowley Linux - Software 8 04-28-2006 01:08 PM
lib/cpp configure error: fails sanity check revenge80200 Linux - Newbie 5 09-28-2004 10:21 PM
/lib/cpp fails sanity check error message lansman Linux - Software 3 11-07-2003 07:37 PM


All times are GMT -5. The time now is 06: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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration