X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=config%2Fpicflag.m4;h=8b106f9af8868e6816633a0edf4dbcfad729520e;hb=87f83f20023bf366c14ec4e0fd307948d96caaee;hp=f6f1b444e40bf0db73e4a966af2c262c57bf9c6f;hpb=9a39e74125ad39b0c8c1bd83d89ae77371534d2f;p=deliverable%2Fbinutils-gdb.git diff --git a/config/picflag.m4 b/config/picflag.m4 index f6f1b444e4..8b106f9af8 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. @@ -17,9 +23,11 @@ case "${$2}" in hppa*64*-*-hpux*) # PIC is the default for 64-bit PA HP-UX. ;; - i[[34567]]86-*-cygwin* | i[[34567]]86-*-mingw* | x86_64-*-mingw*) + i[[34567]]86-*-cygwin* | x86_64-*-cygwin*) ;; - i[[34567]]86-*-interix3*) + i[[34567]]86-*-mingw* | x86_64-*-mingw*) + ;; + i[[34567]]86-*-interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; @@ -48,12 +56,6 @@ case "${$2}" in i[[34567]]86-*-* | x86_64-*-*) $1=-fpic ;; - m68k-*-*) - $1=-fpic - ;; - s390*-*-*) - $1=-fpic - ;; # FIXME: Override -fPIC default in libgcc only? sh-*-linux* | sh[[2346lbe]]*-*-linux*) $1=-fpic