Search code examples
linuxgccarmglibc

crosscompile glibc for arm


Good day

Currently, I'm working on an embedded device based on arm-linux. I want to build GCC for my target architecture with Glibc. GCC builds successful, but I have trouble with Glibc build.

I use the latest version of Glibc (ftp.gnu.org/gnu/glibc/glibc-2.12.1.tar.gz) and port for them (ftp.gnu.org/gnu/glibc/glibc-ports-2.12.1.tar.gz)

my configuration line:

../../glibc-2.12.1/configure --host=arm-none-linux-gnueabi --prefix=/home/anatoly/Desktop/ARM/build/glibc-build --enable-add-ons --with-binutils=/home/anatoly/Desctop/ARM/toolchain/arm/bin/

configuration script work fine, but i get some compile error:

... /home/anatoly/Desktop/ARM/src/glibc-2.12.1/malloc/libmemusage_pic.a(memusage.os): In function me': /home/anatoly/Desktop/ARM/src/glibc-2.12.1/malloc/lmemusage.c:253: undefined reference to__eabi+read_tp' ...

I also tried using the old version (2.11, 2.10) but have the same error.

Does anybody know the solution for this problem?


Solution

    • Use a precompiled toolchain, like those provided by code sourcery.

    • If you want to make your own, optimised (premature optimization is the root of all evil), use crosstool-NG, which is a tool dedicated to cross-compilation toolchain building.

    • If you are not convinced, and want to do everything with your own hands, ask your question on the crosstool-NG mailing list.