gcc <-> glibc circular dependency? FAQ for embedded systems

knighttof3_at_yahoo.com
Date: 04/27/05

  • Next message: Yacine: "Initramfs/tmpfs and df issue."
    Date: 27 Apr 2005 11:03:54 -0700
    
    

    Hi all,

      I've googled this topic and found numerous people in my circumstance
    but did not find a clear concise answer on how to develop the toolchain
    for cross-compiling when gcc seems to depend on glibc and glibc depends
    on gcc.

      Sorry, that was clear as mud. Here's what I am trying to do,
    following Karim Yaghmour's book. I am trying to compile gcc-4.0.0 and
    glibc-2.3.5. The _bootstrap_ gcc that I create cannot compile any C
    program (such as "main() {return 0;}") because it does not find crt1.o.

    I believe crt1.o is part of glibc, which I would compile next, except
    that during its configuration, it invokes my recently built gcc and
    fails to configure.

    Here's how I configure gcc (I've also tried --with-newlib, without
    --enable-bootstrap, without enable-cross and recompiled gcc in each
    case). I am sure I've to change the confiure options somehow so that
    the newly built gcc does not look for crt1.o, but how do I do that?

    ./i386-linux-gcc -v
    Using built-in specs.
    Target: i386-linux
    Configured with: /build-tools/gcc-4.0.0/configure --target=i386-linux
    --prefix=/mypath/tools --disable-shared --enable-cross
    --with-headers=/mypath/tools/i386-linux/include --without-newlib
    --without-glibc --enable-languages=c --enable-bootstrap
    Thread model: posix
    gcc version 4.0.0

    gcc compilation and install goes through fine (commands were 'make
    all-gcc ; make install-gcc' - should I be using something else here?).
    Next I try to configure glibc:

    ../glibc-2.3.5/configure --host=$TARGET --prefix="/usr"
    --enable-add-ons --enable-static-nss
    --with-headers=$TARGET_PREFIX/include

    This fails, config.log shows

    configure:7072: test -s conftest.o
    configure:7075: $? = 0
    configure:7086: result: yes
    configure:7089: checking size of long double
    configure:7408: i386-linux-gcc -o conftest -g -O2 conftest.c >&5
    /mypath/tools/lib/gcc/i386-linux/4.0.0/../../../../i386-linux/bin/ld:
    crt1.o: No such file: No such file or directory
    collect2: ld returned 1 exit status
    configure:7411: $? = 1
    configure: program exited with status 1

    And sure enough, there's no crt1.o in the entire toolchain yet. How do
    I configure/compile glibc or anything else using my new gcc?

    - Knight.


  • Next message: Yacine: "Initramfs/tmpfs and df issue."

    Relevant Pages

    • Re: compile with libc5
      ... > have installed the altgcc and libc5-altdev environment, but stl ... > similar and compile and set it up for the old environment, ... binaries on the old toolchain, and have not had much QA (because no ... quite possible that it's too old for even that (you probably want GCC ...
      (comp.os.linux.development.apps)
    • Re: How to enable thread-local storage?
      ... You can try to install it somewhere else and get gcc to use that. ... downloaded glibc and yesterday binutils. ... the newer glibc for when I compile stuff with it instead of the old? ...
      (comp.os.linux.misc)
    • Re: Industrial computer
      ... GCC has long taken care not to produce ... that crashes binaries linked against that glibc. ... old binutils. ... Not had an issue - so-far, but I compile asterisk, apache & php from ...
      (uk.comp.os.linux)
    • compiling the latest glibc with the latest gcc
      ... In the docs for glibc, it says to use the latest gcc if possible, so I ... So does anyone know which gcc version will compile glibc-2.3.5 ... weak_alias (__isinf, isinf) ...
      (comp.os.linux.misc)
    • weird glibc problem
      ... updated the glibc on the 7.2 m/c [originally ... the link phase, the error is: ... the dilemma is that I need to compile gcc again with ... bootstrap compile of gcc, however, even the first phase compile uses my ...
      (comp.os.linux.misc)