diff options
authorRich Felker <>2015-09-22 15:45:40 +0000
committerRich Felker <>2015-09-22 15:45:40 +0000
commit2462370b4fad6f7a05abc65407369d4f621bf85e (patch)
parentc42650abb0d7040cdc427fc083fa38be6ee4a4cf (diff)
try to suppress linking if there are undefined symbols
this is always an error and usually results from failure to find/link the compiler runtime library, but it could also result from implementation errors in libc, using functions that don't (yet) exist. either way the resulting will crash mysteriously at runtime. the crash happens too early to produce a meaningful error, so these crashes are very confusing to users and waste a lot of debugging time. this commit should ensure that they do not happen.
1 files changed, 6 insertions, 0 deletions
diff --git a/configure b/configure
index 49d83844..de357bc2 100755
--- a/configure
+++ b/configure
@@ -499,6 +499,12 @@ fi
# Some patched GCC builds have these defaults messed up...
tryldflag LDFLAGS_AUTO -Wl,--hash-style=both
+# Prevent linking if there are undefined symbols; if any exist,
+# will crash at runtime during relocation processing.
+# The common way this can happen is failure to link the compiler
+# runtime library; implementation error is also a possibility.
+tryldflag LDFLAGS_AUTO -Wl,--no-undefined
test "$shared" = "no" || {
# Disable dynamic linking if ld is broken and can't do -Bsymbolic-functions