remove attribute((const)) from arm __pthread_self inline function
[musl] / configure
index c277764..d944a47 100755 (executable)
--- a/configure
+++ b/configure
@@ -476,10 +476,18 @@ if test "x$visibility" = xauto ; then
 # - the -include option
 # - the attributes/pragmas used in vis.h
 # - linking code that takes the address of protected symbols
+# - gcc 3.x bug that wrongly claims declarations mismatch
 printf "checking whether global visibility preinclude works... "
-echo 'int (*fp)(void);' > "$tmpc"
-echo 'int foo(void) { }' >> "$tmpc"
-echo 'int bar(void) { fp = foo; return foo(); }' >> "$tmpc"
+cat > "$tmpc" <<EOF
+__attribute__((__visibility__("default")))
+extern struct a *const x;
+typedef struct a b;
+extern b *const x;
+b *const x;
+int (*fp)(void);
+int foo(void) { }
+int bar(void) { fp = foo; return foo(); }
+EOF
 if $CC $CFLAGS_C99FSE $CPPFLAGS $CFLAGS \
   -DSHARED -fPIC -I./src/internal -include vis.h \
   -nostdlib -shared -Wl,-Bsymbolic-functions \
@@ -499,6 +507,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,
+# libc.so 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
 LDFLAGS_DUMMY=
@@ -560,7 +574,6 @@ SUBARCH=${SUBARCH}-nofpu
 fi
 if trycppif __SH_FDPIC__ "$t" ; then
 SUBARCH=${SUBARCH}-fdpic
-shared=no
 fi
 fi