31.12.2022 14:23, David Laight wrote: []
You don't need to check whether libresolv is needed just whether it exists.
We only need to worry about all this only if nslookup applet is in use (this is already the case in the Makefile), - this is what I mean, if we don't have nslookup we don't have to check for -lresolv. Checking for -lresolv existance is done by trying to link with -lresolv because it can be in different system-specific place which is known by the linker but not by the Makefile.
The linker won't (usually) add the NEEDED entry unless the library actually defines some undefined symbols.
It is only true when --when-needed is in effect. Historically, for many decades, it werent. I think ubuntu turned it on some years back (maybe when switching from ld to gold), but that's details. FWIW. /mjt _______________________________________________ busybox mailing list busybox@busybox.net http://lists.busybox.net/mailman/listinfo/busybox