Fun building cross versions of ldd and readelf.
Rob Landley
rob at landley.net
Mon Feb 26 14:10:00 PST 2007
So I'm building a cross compiler toolchain, and I'd like to have ldd and
readelf in there. Unfortunately, they want to link against uClibc, and if I
just built an arm version of uClibc it's kind of silly to do a make clean and
then build an x86 version of uClibc just to link ldd and readelf against. In
fact, they seem to work linked against the host C library just fine, if I do:
$CC -Os -s -I include utils/readelf.c -o readelf
$CC -Os -s -I ldso/include utils/ldd.c -o ldd
Except that although this works fine after an x86 build and an armv4l build,
but it breaks spectacularly after a mipsel build. It can only be the
headers, so I need to make distclean && make allyesconfig.
Question #1: Why on EARTH does "make allyesconfig" (from the February 14
snapshot) stop and ask me for stuff? Isn't the _point_ of make allyesconfig
that it doesn't block? How did this break?
Quick workaround "yes '' | make allyesconfig" and... the build breaks again,
because I need to "make headers". Right. That does...
> ( cd extra/locale/; wget --passive-ftp
> http://www.uclibc.org/downloads/uClibc-locale-030818.tgz ) --15:56:23--
> http://www.uclibc.org/downloads/uClibc-locale-030818.tgz =>
> `uClibc-locale-030818.tgz'
> Resolving www.uclibc.org... 140.211.166.42
> Connecting to www.uclibc.org|140.211.166.42|:80... connected.
> HTTP request sent, awaiting response... 200 OK
> Length: 236,073 (231K) [application/x-gzip]
>
> 100%[====================================>] 236,073 321.78K/s
>
> 15:56:24 (321.11 KB/s) - `uClibc-locale-030818.tgz' saved [236073/236073]
Question #2: Why is "make headers" calling _wget_ halfway through? Since when
does the uClibc build work like buildroot and download stuff halfway through?
Anyway, the way to make it work appears to be:
make distclean
make allnoconfig
make headers KERNEL_HEADERS="${CROSS}/include"
$CC -Os -s -I include utils/readelf.c -o readelf
$CC -Os -s -I ldso/include utils/ldd.c -o ldd
Just FYI.
Rob
--
"Perfection is reached, not when there is no longer anything to add, but
when there is no longer anything to take away." - Antoine de Saint-Exupery
More information about the uClibc
mailing list