[PATCH] D71387: pass -mabi to LTO linker only in RISC-V targets, enable RISC-V LTO

Kuan Hsu Chen (Zakk) via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 11 20:46:44 PST 2019


khchen created this revision.
khchen added reviewers: efriedma, lenary, asb, shiva0217, tejohnson.
khchen added a project: clang.
Herald added subscribers: cfe-commits, luismarques, apazos, sameer.abuasal, pzheng, s.egerton, jocewei, PkmX, rkruppe, dexonsmith, the_o, brucehoult, MartinMosbeck, rogfer01, steven_wu, edward-jones, zzheng, MaskRay, jrtc27, kito-cheng, niosHD, sabuasal, simoncook, johnrusso, rbar, hiraditya, inglorion, mehdi_amini.

ABI(-mabi) is not encoded in bitcode function attribute and it is not suitable to modeled on a per-function basis because one compilation unit need to have the same ABI in risc-v .

in this patch driver will pass -mabi to LTO via option, but there is another passing way via module metadata, 
I'm not sure which solution is better.

any suggestion?


Repository:
  rC Clang

https://reviews.llvm.org/D71387

Files:
  clang/lib/Driver/ToolChains/Arch/RISCV.cpp
  clang/lib/Driver/ToolChains/Arch/RISCV.h
  clang/lib/Driver/ToolChains/CommonArgs.cpp
  clang/lib/Driver/ToolChains/RISCVToolchain.cpp
  clang/lib/Driver/ToolChains/RISCVToolchain.h
  clang/test/Driver/gold-lto.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D71387.233484.patch
Type: text/x-patch
Size: 4836 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20191212/e6331426/attachment-0001.bin>


More information about the cfe-commits mailing list