Find the answer to your Linux question:
Results 1 to 2 of 2
Hi everyone! I've got a problem installing LFS on a x86_64 machine. The standard installation procedure works out just fine, but I'd like to compile a system with up-to-date kernel ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Apr 2008
    Posts
    5

    [SOLVED] LFS chapter 5.4: GCC bootstrap fails


    Hi everyone!

    I've got a problem installing LFS on a x86_64 machine. The standard installation procedure works out just fine, but I'd like to compile a system with up-to-date kernel and compiler.
    For the installation, I chose the following versions:

    gcc-4.3.0 (the whole thing, not just core and g++)
    binutils-1.18

    The rest of it doesn't matter right now, because I don't even get past these two.

    First, the configure of gcc failed due to missing mpfr and gmp. To solve this, I downloaded gmp-4.2.2 and mpfr-2.3.1 and rebooted the computer to start the build process all over again (just to be sure).

    I installed binutils first, then gmp and then mpfr (--with-gmp=/tools). When I try to install gcc, the configure works. I use:

    Code:
    CC="gcc -B/usr/bin/" ../gcc-4.3.0/configure --prefix=/tools \
        --with-local-prefix=/tools --disable-nls --enable-shared \
        --enable-languages=c --disable-multilib --with-gmp=/tools --with-mpfr=/tools
    There is one error during the configure process, though:

    Code:
    checking for correct version of gmp.h... yes
    checking for correct version of mpfr.h... yes
    *** This configuration is not supported in the following subdirectories:
         target-libada gnattools target-libstdc++-v3 target-libgfortran target-libffi target-zlib target-libjava zlib target-libobjc target-boehm-gc
        (Any other directories should still work fine.)
    Somewhere before that, it says:

    Code:
    checking for suffix of executables...
    Without something behind it.

    Then there are two "no"s but I dont't think they are of any importance:

    Code:
    checking for gnatbind... no
    checking for gnatmake... no
    The configure script doesn't abort, though.

    When I try to
    Code:
    make bootstrap
    after that, it compiles for a while and then exits with:

    Code:
    checking for x86_64-unknown-linux-gnu-gcc... /mnt/lfs/sources/gcc-build/./gcc/xgcc -B/mnt/lfs/sources/gcc-build/./gcc/ -B/tools/x86_64-unknown-linux-gnu/bin/ -B/tools/x86_64-unknown-linux-gnu/lib/ -isystem /tools/x86_64-unknown-linux-gnu/include -isystem /tools/x86_64-unknown-linux-gnu/sys-include
    checking for suffix of object files... configure: error: cannot compute suffix of object files: cannot compile
    See `config.log' for more details.
    make[2]: *** [configure-stage1-target-libgcc] Error 1
    make[2]: Leaving directory `/mnt/lfs/sources/gcc-build'
    make[1]: *** [stage1-bubble] Error 2
    make[1]: Leaving directory `/mnt/lfs/sources/gcc-build'
    make: *** [bootstrap] Error 2
    I consulted config.log, then. There are two passages there I found interesting:

    Code:
    configure:3289: checking for suffix of executables
    configure:3291: gcc -B/usr/bin/ -o conftest  -pipe -O2 -m64 -march=athlon64   conftest.c  >&5
    configure:3294: $? = 0
    configure:3319: result:
    The configure script isn't able to detect the suffix of executables, but it is able to compute the suffix of object files right after that.
    The second passage is:

    Code:
    configure:4053: test -s conftest.o
    configure:4056: $? = 0
    configure:4082: g++ -c -g -O2  conftest.cc >&5
    conftest.cc: In function 'int main()':
    conftest.cc:13: error: 'exit' was not declared in this scope
    configure:4088: $? = 1
    configure: failed program was:
    | /* confdefs.h.  */
    |
    | #define PACKAGE_NAME ""
    | #define PACKAGE_TARNAME ""
    | #define PACKAGE_VERSION ""
    | #define PACKAGE_STRING ""
    | #define PACKAGE_BUGREPORT ""
    | /* end confdefs.h.  */
    |
    | int
    | main ()
    | {
    | exit (42);
    |   ;
    Are these to be in my scope of interest? What am I getting wrong here? It seems like somehow the configure script fails to detect suffixes of executables while the build fails to detect suffixes of object files. But what does that want to tell me? Please help, thanks in advance.

    Edit: Just read the whole thing all over again. To me (as I came just past the newbie stage) it looks like there is an error in some code called conftest.cc, which is, as it looks like, somehow used to detect the suffixes. Since these errors, make and configure fail to detect either one of the suffixes. Combined, they seem to fail both (or just one of them, but anyway) which leads to a make script trying to find some executable / object which it knows the name of, but not the suffix. So some file can't be used for something, which is a problem at that moment where the make exits.
    Am I getting this right or wrong? I want to learn something

  2. #2
    Just Joined!
    Join Date
    Apr 2008
    Posts
    5
    Hi again

    I just found out that the issue could have been a "buggy" mpfr installation. Allthough libgmp.so.3 is in my /usr/local/share directory (Yes, I reinstalled it because /tools is not a good idea for a tool not belonging in the toolchain at that moment) and the /usr/local/share directory was listed in /etc/ld.so.conf, the testsuite of mpfr failed every single test.
    I fixed this by copying all the library files installed by gmp to the /lib directory. After that, the testsuite ran just fine. To be save, I also copied the libs installed by mpfr to the /lib directory.

    Let's see if it works now, I'm waiting for the bootstrap at the moment.

    Edit: OK, the bootstrap came to stage2 this time. But in stage2, the compiler doesn't find gmp.h anymore. I'm trying it again with gmp and mpfr installed to the /tools directory, too.

    Edit 2: That worked. I had to install two patches to glibc before installing but the toolchain works properly now.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •