[PATCH 1/3] Binutils/GCC: Add clang LTO support to AR, NM and RANLIB

H.J. Lu hjl.tools@gmail.com
Wed Sep 24 05:55:20 GMT 2025


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.


-- 
H.J.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Binutils-GCC-Add-clang-LTO-support-to-AR-NM-and-RANL.patch
Type: text/x-patch
Size: 89376 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20250924/8e51a785/attachment-0001.bin>


More information about the Binutils mailing list