X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=config%2Fpicflag.m4;h=2f5b9721eb2fa8f6058beb9a15585612df49bb13;hb=a025b477cc466112af0b120c5f2bf5d62a62017e;hp=3bcdbf1de307fb1e918238d6e94f4ccfdc780819;hpb=f0c897ef0a1aa2c4983cd216a4aadff82dcbad4a;p=deliverable%2Fbinutils-gdb.git diff --git a/config/picflag.m4 b/config/picflag.m4 index 3bcdbf1de3..2f5b9721eb 100644 --- a/config/picflag.m4 +++ b/config/picflag.m4 @@ -7,9 +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 - $1=-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*) $1='-fno-common -mno-dynamic-no-pic' ;; + *) $1=-fno-common ;; + esac ;; alpha*-dec-osf5*) # PIC is the default.