Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
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.


  Search this Thread
Old 01-27-2009, 10:56 PM   #1
LQ Newbie
Registered: Dec 2006
Distribution: Arch Linux, Ubuntu, Gentoo, Zenwalk
Posts: 26

Rep: Reputation: 16
GCC fails to compile - Chapter 6.14 - C preprocessor "/lib/cpp" fails sanity check

While in the chrooted environment, at the stage of GCC 4.3.2 compilation this error was produced and make failed.

Checking multilib configuration for libgcc...
mkdir -p -- i686-pc-linux-gnu/libgcc
Configuring in i686-pc-linux-gnu/libgcc
configure: creating cache ./config.cache
checking for --enable-version-specific-runtime-libs... no
checking for a BSD-compatible install... /tools/bin/install -c
checking for gawk... gawk
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking for i686-pc-linux-gnu-ar... ar
checking for i686-pc-linux-gnu-lipo... lipo
checking for i686-pc-linux-gnu-nm... /sources/gcc-build/./gcc/nm
checking for i686-pc-linux-gnu-ranlib... ranlib
checking for i686-pc-linux-gnu-strip... strip
checking whether ln -s works... yes
checking for i686-pc-linux-gnu-gcc... /sources/gcc-build/./gcc/xgcc -B/sources/gcc-build/./gcc/ -B/usr/i686-pc-linux-gnu/bin/ -B/usr/i686-pc-linux-gnu/lib/ -isystem /usr/i686-pc-linux-gnu/include -isystem /usr/i686-pc-linux-gnu/sys-include
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether /sources/gcc-build/./gcc/xgcc -B/sources/gcc-build/./gcc/ -B/usr/i686-pc-linux-gnu/bin/ -B/usr/i686-pc-linux-gnu/lib/ -isystem /usr/i686-pc-linux-gnu/include -isystem /usr/i686-pc-linux-gnu/sys-include accepts -g... yes
checking for /sources/gcc-build/./gcc/xgcc -B/sources/gcc-build/./gcc/ -B/usr/i686-pc-linux-gnu/bin/ -B/usr/i686-pc-linux-gnu/lib/ -isystem /usr/i686-pc-linux-gnu/include -isystem /usr/i686-pc-linux-gnu/sys-include option to accept ANSI C... none needed
checking how to run the C preprocessor... /lib/cpp
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 have attached the config.log file. I searched for this and found that this error was common at the ncurses compilation stage, and usually because there is no c++ compiler. But isn't that what is being compiled at this stage..? Or does it mean that the host system does not have c++...? the host is Arch linux and has gcc 4.3.2.

Until this error everything went as per book, including the running of all test suites for previous packages.

Is there a way out..?
Attached Files
File Type: txt config.txt (24.2 KB, 32 views)

Last edited by jaydoc; 01-28-2009 at 02:03 AM.
Old 01-28-2009, 05:17 PM   #2
Registered: Aug 2003
Location: france
Distribution: suse/fedora
Posts: 105

Rep: Reputation: 15
i can't understand why you want to compile 4.3.2 when you already have 4.3.2? there is little advantage in recompiling gcc unless you can't install a binary package, you will get bits of one gcc in /usr/bin and others in /usr/local/bin, also it takes a long time and rather too much disk space.

have you created a directory called (say) /usr/local/build/
then done cd /usr/local/build/
finally sh ../gcc4.3.2/configure ; make
if you are sick of waiting for gcc to compile things a native compile won't help much - use tcc which is about 20 times faster, but is still a little wobbly.


check, gcc, lfs, libcpp, sanity

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
error: C++ preprocessor "/lib/cpp" fails sanity check watcher69b Linux - Software 1 07-03-2008 04:09 AM
error: C preprocessor "/lib/cpp" fails sanity check Virtuality Debian 13 01-12-2008 04:37 AM
error: C preprocessor "/lib/cpp" fails sanity check Virtuality Linux - Software 21 01-06-2008 09:35 PM
error: C++ preprocessor "/lib/cpp" fails sanity check Linux - Software 3 03-06-2007 02:24 AM
error: C preprocessor "/lib/cpp" fails sanity check ankit4u1 Linux - Software 2 04-02-2006 12:24 PM > Forums > Linux Forums > Linux - Distributions > Linux From Scratch

All times are GMT -5. The time now is 10:24 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration