[lld] [llvm] [RISCV] add new relocation type for global array accesses with non-constant indices (PR #207901)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 29 01:01:10 PDT 2026


MaskRay wrote:

> > * One for llvm changes, and we should guard it by an option (`-mllvm`).
> > * One for Clang driver, in which we will decide if we should add the `-mllvm` option.
> 
> `-mllvm` options are not really compatible with LTO (though, i guess this is a linker thing...). I think it might be reasonable to turn the clang option into a target feature, like we do for e.g. relaxation, as target features are handled with LTO much better than `-mllvm` options.

For LTO just use `-flto -Wl,-plugin-opt=-xxx`, which will set the cl::opt option `xxx` for both lld and LLVMgold.so (used by GNU ld)

https://github.com/llvm/llvm-project/pull/207901


More information about the llvm-commits mailing list