summaryrefslogtreecommitdiff
path: root/libgcc/configure
diff options
context:
space:
mode:
Diffstat (limited to 'libgcc/configure')
-rw-r--r--libgcc/configure14
1 files changed, 9 insertions, 5 deletions
diff --git a/libgcc/configure b/libgcc/configure
index 54e8712b49e..08c931929c7 100644
--- a/libgcc/configure
+++ b/libgcc/configure
@@ -2303,11 +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
- # Cancel any earlier -mdynamic-no-pic, as that makes
- # the code not suitable for shared libraries.
- PICFLAG='-fno-common -mno-dynamic-no-pic'
+ # 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.