[clang] [clang-repl] Fix PLT offset too large linker error on ARM (PR #78959)

Stefan Gränitz via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 23 04:56:01 PST 2024


weliveindetail wrote:

> I don't really know more about the issue that requires --long-plt at the moment and why it's only needed for clang-repl

clang-repl binary size is ~3.7G in debug mode and this seems to exceed the branch range of default ARM PLT slots. The instruction sequence that's necessary for long-range PLT slots is likely more expensive. I guess this situation is too much of an edge-case to make the effort and detect it upfront, so they just bail out if it happens an ask for the flag.

> If you'd want it to hit more universally, perhaps just remove the architecture check - if we test that the linker does support `--long-plt` without erroring out, we probably can add it, even if we don't really know the exact architecture we're linking for?

Yes, that sounds like the better option. We give it a try later today.

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


More information about the cfe-commits mailing list