]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libgcc/configure
re PR target/65351 (libiberty's pic version contains non-pic code on m32 darwin;...
[thirdparty/gcc.git] / libgcc / configure
index 9d567f9d48c4ad0db74c0066d2ef2ac8f2f392fb..08c931929c7c7ba4c3d80ff3d2c3ff04b9701da7 100644 (file)
@@ -2303,9 +2303,15 @@ case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
 case "${host}" in
     # PIC is the default on some targets or must not be used.
     *-*-darwin*)
-       # PIC is the default on this platform
-       # Common symbols not allowed in MH_DYLIB files
-       PICFLAG=-fno-common
+       # For darwin, common symbols are not allowed in MH_DYLIB files
+       case "${CFLAGS}" in
+         # If we are using a compiler supporting mdynamic-no-pic
+         # and the option has been tested as safe to add, then cancel
+         # it here, since the code generated is incompatible with shared
+         # libs.
+         *-mdynamic-no-pic*) PICFLAG='-fno-common -mno-dynamic-no-pic' ;;
+         *) PICFLAG=-fno-common ;;
+       esac
        ;;
     alpha*-dec-osf5*)
        # PIC is the default.