I'm having some issues using busybox and dns lookups. I found a claim that this a glibc problem. I'm on gentoo. I would like to compile busybox against uClibc, without replacing glibc on the system.
Clarification
Host system
Gentoo system, packages build against glibc. I have busybox installed as a statically linked binary against glibc. Edit: Architecture is x86_64, nomultilib.
Goal
I want to link busybox against uClibc, without messing with the host system's libc. I prefer to achieve this using gentoo's native tools, like emerge. But, suggestions that involve some manual scripting are also welcome. The target host is the same architecture.
Tried
- use
emerge --root=/..
option. But linking still seems to be done against glibc in/
- Use the gentoo prefix project, but I just end up with another glibc based stage 3, in a prefixed installation path.
- I've found the option of
gcc -Xlinker -rpath=/default/path/to/libraries -Xlinker -I/default/path/to/libraries/ld.so program.c
. But I have no clue how to use this in gentoo'smake.conf
or in a regularmake
based build like busybox'.
Edit; More tries:
- Set
USE="-static
on busybox to build a dynamic linked version. Find it's library dependencies usingldd /bin/busybox
. Stangly,ldd
does not return any of thenss*.so
libs. So I copied them the the image manually. Bit still,nslookup
ofping example.com
would result in an error. - Download an uClibc stage from https://www.gentoo.org/downloads/. Configure and re-build the busybox binary in a chroot. This works, but is a definite overkill for building the +/- 1MB busybox binary vs a stage3 of 144MB.
genkernel
, I can build busybox without static linking into the initrd. If you aren't using busybox on your host, have you considered using a crossbuild environment? See Also: Vapier's uClibc FAQ. Of specific importance is: I've downloaded and installed crossdev but there is no target for uClibc. How am I supposed to build a cross-toolchain for gentoo? This might be overkill for one package but it's native as you requested.nslookup
would work from the genkernel rescue shell? If so, I'd be seriously interested what their magic is to make it work.