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

Eli Friedman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 17 12:54:24 PST 2019


efriedma added a comment.

> Unfortunately on RISCV, the ABI info is only derived from -mabi option and the target triple does not encode ABI info (same to gcc).

How does gcc decide the default ABI for a target?  Do you explicitly specify it at configure time?

> example 1:
>  What's expected behavior? user specifics -mabi=lp64f so the result object ABI is lp64f?

I think the expected behavior is a fatal error.  There isn't any reason to let people shoot themselves in the foot like this.  (module flags have builtin support for producing such an error.)

> example 2:
>  What's expected behavior? The result object is -mabi=lp64f because they have same ABI in module metadata?

Yes.

> there is no problem (I think) when overwriting the original ABI. (so the mixing ABI is not a problem)

clang emits different IR for hardfloat vs. softfloat targets; if you try to overwrite the ABI of a bitcode file, we'll generate wrong code.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D71387/new/

https://reviews.llvm.org/D71387





More information about the cfe-commits mailing list