Linux From ScratchThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
"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.
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?
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?
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
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?
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
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
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.