aboutsummaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2021-11-13 06:11:41 -0800
committerArsen Arsenović <arsen@gcc.gnu.org>2023-08-07 22:59:36 +0200
commit126f707efbb5184178701cbdc753a10fd831374e (patch)
tree052a59070b171198ea6b8f5dae7e4084aedd436d /config
parent432c6f05b00702303730b212c14f364b263ba4b1 (diff)
Sync with binutils: GCC: Pass --plugin to AR and RANLIB
Sync with binutils for building binutils with LTO: 50ad1254d50 GCC: Pass --plugin to AR and RANLIB Detect GCC LTO plugin. Pass --plugin to AR and RANLIB to support LTO build. ChangeLog: * 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/ChangeLog: * gcc-plugin.m4 (GCC_PLUGIN_OPTION): New. libiberty/ChangeLog: * Makefile.in (AR): Add @AR_PLUGIN_OPTION@ (RANLIB): Add @RANLIB_PLUGIN_OPTION@. (configure_deps): Depend on ../config/gcc-plugin.m4. * configure.ac: AC_SUBST AR_PLUGIN_OPTION and RANLIB_PLUGIN_OPTION. * aclocal.m4: Regenerated. * configure: Likewise. zlib/ChangeLog: * configure: Regenerated. gcc/ChangeLog: * configure: Regenerate. libatomic/ChangeLog: * configure: Regenerate. libbacktrace/ChangeLog: * configure: Regenerate. libcc1/ChangeLog: * configure: Regenerate. libffi/ChangeLog: * configure: Regenerate. libgfortran/ChangeLog: * configure: Regenerate. libgm2/ChangeLog: * configure: Regenerate. libgomp/ChangeLog: * configure: Regenerate. libitm/ChangeLog: * configure: Regenerate. libobjc/ChangeLog: * configure: Regenerate. libphobos/ChangeLog: * configure: Regenerate. libquadmath/ChangeLog: * configure: Regenerate. libsanitizer/ChangeLog: * configure: Regenerate. libssp/ChangeLog: * configure: Regenerate. libstdc++-v3/ChangeLog: * configure: Regenerate. libvtv/ChangeLog: * configure: Regenerate. lto-plugin/ChangeLog: * configure: Regenerate.
Diffstat (limited to 'config')
-rw-r--r--config/gcc-plugin.m428
1 files changed, 28 insertions, 0 deletions
diff --git a/config/gcc-plugin.m4 b/config/gcc-plugin.m4
index 2ccb9ca7258..d782d52858e 100644
--- a/config/gcc-plugin.m4
+++ b/config/gcc-plugin.m4
@@ -129,3 +129,31 @@ AC_DEFUN([GCC_ENABLE_PLUGINS],
fi
fi
])
+
+dnl
+dnl
+dnl GCC_PLUGIN_OPTION
+dnl (SHELL-CODE_HANDLER)
+dnl
+AC_DEFUN([GCC_PLUGIN_OPTION],[dnl
+AC_MSG_CHECKING([for -plugin option])
+
+plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll"
+plugin_option=
+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 "$plugin_option"; then
+ $1="$plugin_option"
+ AC_MSG_RESULT($plugin_option)
+else
+ AC_MSG_RESULT([no])
+fi
+])