diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2021-01-09 06:43:11 -0800 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2022-01-12 08:43:05 -0500 |
commit | d8d5dac0fe978d9b0eed3726b863d176809983cd (patch) | |
tree | eb07c3f1fabd7a6316868684f66892dc975789fe /config/gcc-plugin.m4 | |
parent | 4a3b4d50e33b48b84da6ce473a2b6fa89aa406be (diff) | |
download | newlib-d8d5dac0fe978d9b0eed3726b863d176809983cd.zip newlib-d8d5dac0fe978d9b0eed3726b863d176809983cd.tar.gz newlib-d8d5dac0fe978d9b0eed3726b863d176809983cd.tar.bz2 |
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 'config/gcc-plugin.m4')
-rw-r--r-- | config/gcc-plugin.m4 | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/config/gcc-plugin.m4 b/config/gcc-plugin.m4 index dd06a58..5e907ca 100644 --- a/config/gcc-plugin.m4 +++ b/config/gcc-plugin.m4 @@ -111,3 +111,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 +]) |