summaryrefslogtreecommitdiff
path: root/zlib
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2021-01-09 06:43:11 -0800
committerH.J. Lu <hjl.tools@gmail.com>2021-01-09 06:51:51 -0800
commit50ad1254d5030d0804cbf89c758359ae202e8d55 (patch)
treed99205ba73874f43469734356f4f2d71ff8e428b /zlib
parenta9fd212a2416406f8503efe9e449718d0becfcb2 (diff)
downloadbinutils-gdb-50ad1254d5030d0804cbf89c758359ae202e8d55.tar.gz
GCC: Pass --plugin to AR and RANLIB
Detect GCC LTO plugin. Pass --plugin to AR and RANLIB to support LTO build. * Makefile.tpl (AR): Add @AR_PLUGIN_OPTION@ (RANLIB): Add @RANLIB_PLUGIN_OPTION@. * configure.ac: Include config/gcc-plugin.m4. AC_SUBST AR_PLUGIN_OPTION and RANLIB_PLUGIN_OPTION. * libtool.m4 (_LT_CMD_OLD_ARCHIVE): Pass --plugin to AR and RANLIB if possible. * Makefile.in: Regenerated. * configure: Likewise. config/ * gcc-plugin.m4 (GCC_PLUGIN_OPTION): New. libiberty/ * Makefile.in (AR): Add @AR_PLUGIN_OPTION@ (RANLIB): Add @RANLIB_PLUGIN_OPTION@. (configure_deps): Depend on ../config/gcc-plugin.m4. * aclocal.m4: Include ../config/gcc-plugin.m4. * configure.ac: AC_SUBST AR_PLUGIN_OPTION and RANLIB_PLUGIN_OPTION. * configure: Regenerated. zlib/ * configure: Regenerated.
Diffstat (limited to 'zlib')
-rw-r--r--zlib/ChangeLog.bin-gdb4
-rwxr-xr-xzlib/configure27
2 files changed, 29 insertions, 2 deletions
diff --git a/zlib/ChangeLog.bin-gdb b/zlib/ChangeLog.bin-gdb
index 57f1ac7e193..e30e67dbaa7 100644
--- a/zlib/ChangeLog.bin-gdb
+++ b/zlib/ChangeLog.bin-gdb
@@ -1,3 +1,7 @@
+2021-01-09 H.J. Lu <hongjiu.lu@intel.com>
+
+ * configure: Regenerated.
+
2020-02-19 Andrew Burgess <andrew.burgess@embecosm.com>
* configure: Regenerate.
diff --git a/zlib/configure b/zlib/configure
index b124acf9259..79a79c5d9e7 100755
--- a/zlib/configure
+++ b/zlib/configure
@@ -5407,6 +5407,19 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown
+plugin_option=
+plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll"
+for plugin in $plugin_names; do
+ plugin_so=`${CC} ${CFLAGS} --print-prog-name $plugin`
+ if test x$plugin_so = x$plugin; then
+ plugin_so=`${CC} ${CFLAGS} --print-file-name $plugin`
+ fi
+ if test x$plugin_so != x$plugin; then
+ plugin_option="--plugin $plugin_so"
+ break
+ fi
+done
+
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
set dummy ${ac_tool_prefix}ar; ac_word=$2
@@ -5500,6 +5513,11 @@ else
fi
test -z "$AR" && AR=ar
+if test -n "$plugin_option"; then
+ if $AR --help 2>&1 | grep -q "\--plugin"; then
+ AR="$AR $plugin_option"
+ fi
+fi
test -z "$AR_FLAGS" && AR_FLAGS=cru
@@ -5704,6 +5722,11 @@ else
fi
test -z "$RANLIB" && RANLIB=:
+if test -n "$plugin_option" && test "$RANLIB" != ":"; then
+ if $RANLIB --help 2>&1 | grep -q "\--plugin"; then
+ RANLIB="$RANLIB $plugin_option"
+ fi
+fi
@@ -10634,7 +10657,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 10637 "configure"
+#line 10660 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -10740,7 +10763,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 10743 "configure"
+#line 10766 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H