aboutsummaryrefslogtreecommitdiff
path: root/intl/configure
diff options
context:
space:
mode:
authorNick Alcock <nick.alcock@oracle.com>2021-02-02 15:39:26 +0000
committerNick Alcock <nick.alcock@oracle.com>2021-02-10 15:26:57 +0000
commit53d4244ec0ac70438d75abf3326cb3392bb9c828 (patch)
tree4d9cbb3622894ee2f0419c74af424f0131363122 /intl/configure
parentadda0248ed0f7a2245f53a79ef6dbc2093a1be22 (diff)
downloadfsf-binutils-gdb-53d4244ec0ac70438d75abf3326cb3392bb9c828.zip
fsf-binutils-gdb-53d4244ec0ac70438d75abf3326cb3392bb9c828.tar.gz
fsf-binutils-gdb-53d4244ec0ac70438d75abf3326cb3392bb9c828.tar.bz2
intl: always picify
libintl is included in several shared libraries (at least libinproctrace.so and libctf.so): unconditionally picify with code borrowed from libiberty configure. (It's not performance-critical, so don't bother making separate PIC and non-PIC libraries like libiberty does.) intl/ChangeLog 2021-02-02 Nick Alcock <nick.alcock@oracle.com> * aclocal.m4: include picflag.m4. * configure.ac (PICFLAG): Add and substitute. * Makefile.in (PICFLAG): New. (COMPILE): Use it. * configure: Regenerate.
Diffstat (limited to 'intl/configure')
-rwxr-xr-xintl/configure86
1 files changed, 86 insertions, 0 deletions
diff --git a/intl/configure b/intl/configure
index d69767b..6498a39 100755
--- a/intl/configure
+++ b/intl/configure
@@ -624,6 +624,7 @@ ac_subst_vars='LTLIBOBJS
LIBOBJS
BISON3_NO
BISON3_YES
+PICFLAG
INCINTL
LIBINTL_DEP
MAINT
@@ -6793,6 +6794,91 @@ case $USE_INCLUDED_LIBINTL in
;;
esac
+# intl is sometimes linked into shared libraries even without --enable-shared
+# (e.g. gdbsupport's inprocess agent): so always PICify, just in case.
+
+
+
+
+case "${host}" in
+ # PIC is the default on some targets or must not be used.
+ *-*-darwin*)
+ # 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.
+ ;;
+ hppa*64*-*-hpux*)
+ # PIC is the default for 64-bit PA HP-UX.
+ ;;
+ i[34567]86-*-cygwin* | x86_64-*-cygwin*)
+ ;;
+ 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.
+ ;;
+ i[34567]86-*-nto-qnx*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ PICFLAG='-fPIC -shared'
+ ;;
+ i[34567]86-pc-msdosdjgpp*)
+ # DJGPP does not support shared libraries at all.
+ ;;
+ ia64*-*-hpux*)
+ # On IA64 HP-UX, PIC is the default but the pic flag
+ # sets the default TLS model and affects inlining.
+ PICFLAG=-fPIC
+ ;;
+ mips-sgi-irix6*)
+ # PIC is the default.
+ ;;
+ rs6000-ibm-aix* | powerpc-ibm-aix*)
+ # All AIX code is PIC.
+ ;;
+
+ # Some targets support both -fPIC and -fpic, but prefer the latter.
+ # FIXME: Why?
+ i[34567]86-*-* | x86_64-*-*)
+ PICFLAG=-fpic
+ ;;
+ # FIXME: Override -fPIC default in libgcc only?
+ sh-*-linux* | sh[2346lbe]*-*-linux*)
+ PICFLAG=-fpic
+ ;;
+ # FIXME: Simplify to sh*-*-netbsd*?
+ sh-*-netbsdelf* | shl*-*-netbsdelf* | sh5-*-netbsd* | sh5l*-*-netbsd* | \
+ sh64-*-netbsd* | sh64l*-*-netbsd*)
+ PICFLAG=-fpic
+ ;;
+ # Default to -fPIC unless specified otherwise.
+ *)
+ PICFLAG=-fPIC
+ ;;
+esac
+
+# If the user explicitly uses -fpic/-fPIC, keep that.
+case "${CFLAGS}" in
+ *-fpic*)
+ PICFLAG=-fpic
+ ;;
+ *-fPIC*)
+ PICFLAG=-fPIC
+ ;;
+esac
+
+
+
BISON3_YES='#'
BISON3_NO=
if test "$INTLBISON" != :; then