Add -Zno-jump-tables
This flag mimics GCC/Clang's `-fno-jump-tables` [1][2], which makes the codegen backend avoid generating jump tables when lowering switches. In the case of LLVM, the `"no-jump-tables"="true"` function attribute is added to every function. The kernel currently needs it for x86 when enabling IBT [3], as well as for Alpha (plus VDSO objects in MIPS/LoongArch). [1] https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#index-fno-jump-tables [2] https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-fjump-tables [3] https://github.com/torvalds/linux/blob/v6.1/arch/x86/Makefile#L75-L83 Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
This commit is contained in:
parent
9c07efe84f
commit
a65ec44779
6 changed files with 69 additions and 0 deletions
|
@ -1421,6 +1421,8 @@ options! {
|
|||
"run all passes except codegen; no output"),
|
||||
no_generate_arange_section: bool = (false, parse_no_flag, [TRACKED],
|
||||
"omit DWARF address ranges that give faster lookups"),
|
||||
no_jump_tables: bool = (false, parse_no_flag, [TRACKED],
|
||||
"disable the jump tables and lookup tables that can be generated from a switch case lowering"),
|
||||
no_leak_check: bool = (false, parse_no_flag, [UNTRACKED],
|
||||
"disable the 'leak check' for subtyping; unsound, but useful for tests"),
|
||||
no_link: bool = (false, parse_no_flag, [TRACKED],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue