LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (http://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   "C preprocessor... ...fails sanity check" in LFS 7.0 chapter 6.17 (http://www.linuxquestions.org/questions/linux-from-scratch-13/c-preprocessor-fails-sanity-check-in-lfs-7-0-chapter-6-17-a-915142/)

nerdy117 11-23-2011 12:49 PM

"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

corp769 11-23-2011 12:54 PM

You could always upload to pastebin and copy/paste the URL for is, it would make it a hell lot easier.

spiky0011 11-23-2011 12:54 PM

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

nerdy117 11-23-2011 01:33 PM

Quote:

Originally Posted by spiky0011 (Post 4531897)
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?

spiky0011 11-23-2011 02:00 PM

did you run the version script against ubuntu there were a few failures I had

nerdy117 11-23-2011 04:46 PM

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 :redface: 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?

spiky0011 11-23-2011 05:20 PM

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

druuna 11-24-2011 12:52 PM

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 :redface: 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?

nerdy117 11-24-2011 06:27 PM

Quote:

Originally Posted by spiky0011 (Post 4532137)
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 :)

druuna 11-25-2011 12:38 AM

Hi,
Quote:

Originally Posted by nerdy117 (Post 4533138)
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


All times are GMT -5. The time now is 05:42 PM.