diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2021-11-13 06:11:41 -0800 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2021-12-15 14:18:10 -0800 |
commit | bf8cdd35117dea2049abbeebcdf14de11b323ef7 (patch) | |
tree | 2a9b15300ca8bc1b3497086f2e0010a2fd9306c7 /libtool.m4 | |
parent | 807ad4bc854caea407aaa09993e4a3220290b0f0 (diff) | |
download | gcc-bf8cdd35117dea2049abbeebcdf14de11b323ef7.zip gcc-bf8cdd35117dea2049abbeebcdf14de11b323ef7.tar.gz gcc-bf8cdd35117dea2049abbeebcdf14de11b323ef7.tar.bz2 |
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/
* 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.
* configure.ac: AC_SUBST AR_PLUGIN_OPTION and
RANLIB_PLUGIN_OPTION.
* aclocal.m4: Regenerated.
* configure: Likewise.
zlib/
* configure: Regenerated.
Diffstat (limited to 'libtool.m4')
-rw-r--r-- | libtool.m4 | 25 |
1 files changed, 24 insertions, 1 deletions
@@ -1325,8 +1325,26 @@ need_locks="$enable_libtool_lock" # _LT_CMD_OLD_ARCHIVE # ------------------- m4_defun([_LT_CMD_OLD_ARCHIVE], -[AC_CHECK_TOOL(AR, ar, false) +[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 + +AC_CHECK_TOOL(AR, ar, false) 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 _LT_DECL([], [AR], [1], [The archiver]) _LT_DECL([], [AR_FLAGS], [1]) @@ -1337,6 +1355,11 @@ _LT_DECL([], [STRIP], [1], [A symbol stripping program]) AC_CHECK_TOOL(RANLIB, ranlib, :) 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 _LT_DECL([], [RANLIB], [1], [Commands used to install an old-style archive]) |