I ran in to an issue with scripts/trylink when CONFIG_EXTRA_LDLIBS
contains more than 1 library, the list gets passed to scripts/trylink
without quotes so only the first library is used.

CONFIG_EXTRA_LDLIBS="$8"

The first library is $8, the other ones are $9, etc.

I worked around it by putting the libraries in CONFIG_EXTRA_LDFLAGS
but this doesn't always work for static linking.  I applied this patch
which worked without using CONFIG_EXTRA_LDFLAGS.  I didn't try to
change the quoting in Makefile which may also work.

diff -Nru busybox-1.36.1.orig/scripts/trylink busybox-1.36.1/scripts/trylink
--- busybox-1.36.1.orig/scripts/trylink 2021-03-01 08:38:12.000000000 -0800
+++ busybox-1.36.1/scripts/trylink 2025-02-23 08:16:41.609366567 -0800
@@ -84,7 +84,8 @@
 # a real utmp library in LDLIBS, dropping it "works" but resulting binary
 # does not work properly).
 LDLIBS="$7"
-CONFIG_EXTRA_LDLIBS="$8"
+shift 7
+CONFIG_EXTRA_LDLIBS="$*"

 # The --sort-section option is not supported by older versions of ld
 SORT_SECTION="-Wl,--sort-section,alignment"
_______________________________________________
busybox mailing list
[email protected]
https://lists.busybox.net/mailman/listinfo/busybox

Reply via email to