[llvm] [MC][CodeGen] Add --large-eh-encoding flag for x86_64 ELF (PR #174508)

Farid Zakaria via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 10 08:28:34 PDT 2026


fzakaria wrote:

@MaskRay thanks for the recent approval; I did not know we were waiting on the MCTargetOptions patch. :)

I wanted to share a few updates and here what your thoughts are:
* I found out I was not able to enable this flag from Clang even with `-mllvm` in our codebase. I needed to include a driver flag. I shared my 2nd patch https://github.com/llvm/llvm-project/pull/187583 
* We have at Meta a few precompiled libraries that although this flag fixed all our from source builds did not rectify the eh_frame for those which still caused relocation overflows. I ended up having to do an auto-expansion patch similar to https://github.com/llvm/llvm-project/pull/174486 -- The code needs to read LSDA and gcc_except_table so that's net new functionality. The changes are restricted largely to two new files and gated by a new flag as well. I'm happy to upstream this as well.

I think this patch is still necessary given it's simplicity and useful as we pursue thunks for `mcmodel=small` but I needed the auto expansion patch as well.

Curious to hear your thoughts and I can update this PR as well for MCTargetOptions

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


More information about the llvm-commits mailing list