check for ld support of -Bsymbolic-functions; disable shared if not avail
authorRich Felker <dalias@aerifal.cx>
Thu, 7 Jun 2012 04:32:22 +0000 (00:32 -0400)
committerRich Felker <dalias@aerifal.cx>
Thu, 7 Jun 2012 04:32:22 +0000 (00:32 -0400)
this issue affects the last gpl2 version of binutils, which some
people are still using out of aversion to gpl3. musl requires
-Bsymbolic-functions because it's the only way to make a libc.so
that's able to operate prior to dynamic linking but that still behaves
correctly with respect to global vars that may be moved to the main
program via copy relocations.

configure

index f765ca7294c3e5e3f136f6b06c01a8a9510a39e6..7e5a8dfb1b2097689a47c141f2f41306b90ffb3f 100755 (executable)
--- a/configure
+++ b/configure
@@ -267,6 +267,13 @@ fi
 tryflag CFLAGS_AUTO -fno-stack-protector
 tryldflag LDFLAGS_AUTO -Wl,--hash-style=sysv
 
+# Disable dynamic linking if ld is broken and can't do -Bsymbolic-functions
+LDFLAGS_DUMMY=
+tryldflag LDFLAGS_DUMMY -Wl,-Bsymbolic-functions || {
+printf "warning: disabling dynamic linking support\n"
+shared=no
+}
+
 
 printf "creating config.mak... "