So once again I'm trying to add readelf and ldd to my cross compiler toolchain, to run on the host but examine target binaries, and I'm having problems.
I pointed at this back in February 2007: Let's start with adding "readelf" and "ldd" to the cross compiler. This means they need to run on the host, and interpret target binaries. So let's try doing a non-cross-compile "make utils" on an x86-64 host with an armv4l config file: > $ make utils > CC utils/readelf > cc1: error: unrecognized command line option "-mlittle-endian" > make[1]: *** [../utils/readelf] Error 1 > make: *** [utils] Error 2 Doesn't work. When the config file is for armv4l, "make utils" is not building a host version, it's trying to build a target version. Ok, so let's try this: make distclean make defconfig make utils Much header linking scrolls by, and then: > AS lib/crt1.o > AS lib/Scrt1.o > AS lib/crti.o > AS lib/crtn.o > CC libc/sysdeps/linux/x86_64/brk.os > In file included from libc/sysdeps/linux/x86_64/brk.c:22: > ./include/sys/syscall.h:32:25: error: bits/sysnum.h: No such file or > directory libc/sysdeps/linux/x86_64/brk.c: In function 'brk': > libc/sysdeps/linux/x86_64/brk.c:34: error: '__NR_brk' undeclared (first use > in this function) libc/sysdeps/linux/x86_64/brk.c:34: error: (Each > undeclared identifier is reported only once > libc/sysdeps/linux/x86_64/brk.c:34: error: for each function it appears > in.) make[2]: *** [libc/sysdeps/linux/x86_64/brk.os] Error 1 > make[1]: *** [../lib/libc.so.0] Error 2 > make: *** [utils] Error 2 Ok, so it's trying to build the uClibc libraries (and dying because I didn't supply kernel headers) even though I told it just to build the utils and not the whole library. The host is a glibc system. I want readelf and ldd to link against that host library, because it's going to run on the host. When building this cross compiler, I didn't build an x86 version of uClibc, I built an arm or mips or ppc version of uClibc. I don't want "make utils" to try to build an entire host version of uClibc just so readelf can link against it. Does anybody have a suggestion? Am I doing something wrong? Rob _______________________________________________ uClibc mailing list [email protected] http://busybox.net/cgi-bin/mailman/listinfo/uclibc
