Has any thought been given to making it easier to cross-compile GLIBC?

david.hagood@gmail.com david.hagood@gmail.com
Fri Mar 13 14:53:00 GMT 2009


I have recently been building a cross-compilation environment for
arm-linux-gnueabi, and have had some real difficulties with getting
everything, including glibc, to build.

Specifically, when building glibc with the following config:

CC="arm-linux-gnueabi-gcc" AR=arm-linux-gnueabi-ar
RANLIB=arm-linux-gnueabi-ranlib \
${BASE_DIR}/glibc-2.7/configure \
         --enable-add-ons=ports,nptl   --host=arm-linux-gnueabi \
--with-tls --prefix=/usr \
--with-headers=${BUILD_PREFIX}/gcc/gcc/include-fixed:${KERNEL_HEADERS}

(where BASE_DIR, BUILD_PREFIX, and KERNEL_HEADERS are pointing to where my
sources are, where I want the built data installed, and where the Linux
kernel sources are)

then do a make && make lib && make install_root=${SYSROOT} install
install-headers

I have to:
1) copy ${BUILD_PREFIX}/glibc/ldfcn/libdl.so
${BUILD_PREFIX}/glibc/ldfcn/libdl.so.2, as the libdl.so.2 link isn't
created and it breaks the subsequent build of GCC (pass 2).
2) fix all the LD scripts created as a part of the install image (e.g.
usr/lib/libpthread.so) to use the correct path for "install_root" rather
than "/usr"

before being able to build GCC pass 2.

Everybody says "just use crosstools", but doesn't it seem, well, BROKEN to
have to use a bunch of scripts to patch, bodge, and hack(pejorative)
around the problems in glibc process?

Or am I missing something here? I've looked around, but I've NEVER found a
good tutorial on building glibc for a cross-compile environment (my
specific use case is building on my P4 workstation programs to run under
Debian on my Beagleboard).




More information about the Libc-help mailing list