LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (https://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   Solved Problem Second GCC-Pass(or gettext sanity check problem) (https://www.linuxquestions.org/questions/linux-from-scratch-13/solved-problem-second-gcc-pass-or-gettext-sanity-check-problem-360083/)

hoes 09-04-2005 10:20 AM

Solved Problem Second GCC-Pass(or gettext sanity check problem)
 
I had a problem and I was wondering if other people experienced the same.
I solved mine but hope that other may have something about my solution to the problem.

I compiled a lot of stuff until I got to chapter 5.22: Compiling gettext.
I ran the configure script but always got an error:
Code:

checking whether we are using the GNU C++ compiler... no
checking whether g++ accepts -g... no
checking dependency style of g++... none
checking how to run the C++ preprocessor... /tools/bin/cpp -x c++
configure: error: C++ preprocessor "/tools/bin/cpp -x c++" fails sanity check
See `config.log' for more details.
configure: error: /bin/sh './configure' failed for gettext-runtime


I tried to give options to cpp to let it use c++. I tried:
Code:

export CXXCPPFLAGS='-x c++'
,
and similar commands to set the language to c++ through variables.
That didn't work so I started to do some check for myself.
After reading about the -x option of gcc, I came up with a good check.

I made a dummy-file as explained in the LFS-Book but named it dummy.cc, thus
letting the compiler think it is a c++-file. With this approach I noticed I Lacked a
c++-compiler. This was quite a surprise since I wrote all the scripts in the same way as the book. But since my LFS was useless I decided to start all over again.

Getting to the point off GCC second pass, I decided to put '' around 'c,c++' in the time-script I used for measuring the time in order to determine SBUs.
My Good time script for gcc-3.4.3:
Code:

{ time \
  {
    ../gcc-3.4.3/configure --prefix=/tools --libexecdir=/tools/lib \
    --with-local-prefix=/tools --enable-clocale=gnu --enable-shared \
    --enable-threads=posix --enable-__cxa_atexit --enable-languages='c,c++' \
    --disable-libstdcxx-pch &&
    make &&
    make -k check &&
    ../gcc-3.4.3/contrib/test_summary|grep -A7 summ > /lfs/temp/results \
    > /home/lfs/pgcc &&
    diff -u /home/lfs/pgcc /home/lfs/lfsgcc|less &&
    make install
  }

After installing gcc I did the check with dummy.cc again and it was successful.
So I am now positive I have a c++-compiler.

This has cost me a lot of time, for a problem that was solved very easy, and could have been prevented by better dummy-checks. I therefore hope that people will read this and will preform a lot of dummy-checks. Hopefully someone will point this simple check out to the LFS-people, so people know if the have a compiler on time and not after compiling a lot of other stuff before experiencing an error.

Because of the solution I have found I reckon that other people that count the time compiling takes using a script like mine are likely to experience the same problem, which is likely to be caused by the way bash interprets script.

I hope someone finds this a bit helpful.
Although it is annoying you notice the mistake very late.


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