[PATCH] D155326: [Clang][lld][RISCV] Passing 'mattr' to lld/llvmgold
Yingwei Zheng via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 14 12:11:43 PDT 2023
dtcxzyw created this revision.
dtcxzyw added reviewers: MaskRay, jrtc27, kito-cheng, craig.topper.
dtcxzyw added projects: lld, clang.
Herald added subscribers: jobnoorman, VincentWu, vkmr, luismarques, sameer.abuasal, s.egerton, Jim, benna, psnobl, PkmX, rogfer01, shiva0217, simoncook, arichardson, emaste.
Herald added a project: All.
dtcxzyw requested review of this revision.
Herald added subscribers: llvm-commits, cfe-commits, wangpc, eopXD.
Herald added a project: LLVM.
When building applications with LTO/ThinLTO, lld and llvmgold emit wrong `.riscv.attributes` sections due to the lack of sub-target features (`codegen::getMAttrs()` returns empty).
This patch adds a new plugin option `mattr` for lld and llvmgold, to get right module-level sub-target features for temporary ELF objects generated from llvm bitcode.
I think it is a better solution than merging func-level sub-target features like D142191 <https://reviews.llvm.org/D142191>.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D155326
Files:
clang/lib/Driver/ToolChains/Arch/CSKY.cpp
clang/lib/Driver/ToolChains/Arch/CSKY.h
clang/lib/Driver/ToolChains/CommonArgs.cpp
lld/ELF/Driver.cpp
lld/ELF/Options.td
llvm/tools/gold/gold-plugin.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D155326.540420.patch
Type: text/x-patch
Size: 6555 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230714/cb9e703b/attachment.bin>
More information about the llvm-commits
mailing list