]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
Binutils/GCC: Add clang LTO support to AR, NM and RANLIB
authorH.J. Lu <hjl.tools@gmail.com>
Mon, 22 Sep 2025 20:24:00 +0000 (04:24 +0800)
committerH.J. Lu <hjl.tools@gmail.com>
Thu, 25 Sep 2025 04:30:13 +0000 (12:30 +0800)
commit10deea6e2fc1b9ec5818b5fa1bc510c63ff5b2e2
treeec0b3e629bfb1226b3baf51fd8c7b3ed24a34e92
parent72efdf166aa0ed72ecc69fc2349af6591a7a19c0
Binutils/GCC: Add clang LTO support to AR, NM and RANLIB

Add CLANG_PLUGIN_FILE to find the clang plugin file and pass it to
--plugin for ar, nm and ranlib so that binutils can be built with
clang LTO.  Run CLANG_PLUGIN_FILE before GCC_PLUGIN_OPTION since
GCC_PLUGIN_OPTION may return the wrong PLUGIN_OPTION with clang.

PR binutils/33470
* Makefile.in: Regenerated.
* Makefile.tpl (NM): Add @NM_PLUGIN_OPTION@.
* configure: Regenerated.
* configure.ac: Include config/clang-plugin.m4.
Run CLANG_PLUGIN_FILE before GCC_PLUGIN_OPTION to set
PLUGIN_OPTION.  Set and subst NM_PLUGIN_OPTION.
* libtool.m4 (_LT_CMD_OLD_ARCHIVE): Use CLANG_PLUGIN_FILE and
GCC_PLUGIN_OPTION.

config/

PR binutils/33470
* clang-plugin.m4: New file.

libbacktrace/

PR binutils/33470
* Makefile.in: Regenerated.
* aclocal.m4: Likewise.
* configure: Likewise.

libiberty/

PR binutils/33470
* aclocal.m4: Regenerated.
* configure: Likewise.
* configure.ac: Move GCC_PLUGIN_OPTION after GCC_NO_EXECUTABLES.
Run CLANG_PLUGIN_FILE before GCC_PLUGIN_OPTION to set
PLUGIN_OPTION.  Don't add the redundant --plugin option.

zlib/

PR binutils/33470
* Makefile.in: Regenerated.
* aclocal.m4: Likewise.
* configure: Likewise.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
15 files changed:
Makefile.in
Makefile.tpl
config/clang-plugin.m4 [new file with mode: 0644]
configure
configure.ac
libbacktrace/Makefile.in
libbacktrace/aclocal.m4
libbacktrace/configure
libiberty/aclocal.m4
libiberty/configure
libiberty/configure.ac
libtool.m4
zlib/Makefile.in
zlib/aclocal.m4
zlib/configure