summaryrefslogtreecommitdiff
path: root/config/picflag.m4
diff options
context:
space:
mode:
Diffstat (limited to 'config/picflag.m4')
-rw-r--r--config/picflag.m414
1 files changed, 9 insertions, 5 deletions
diff --git a/config/picflag.m4 b/config/picflag.m4
index 836523d67c9..2f5b9721eb2 100644
--- a/config/picflag.m4
+++ b/config/picflag.m4
@@ -7,11 +7,15 @@ AC_DEFUN([_GCC_PICFLAG], [
case "${$2}" 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.
- $1='-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*) $1='-fno-common -mno-dynamic-no-pic' ;;
+ *) $1=-fno-common ;;
+ esac
;;
alpha*-dec-osf5*)
# PIC is the default.