diff options
author | Tiezhu Yang <yangtiezhu@loongson.cn> | 2024-12-17 09:09:03 +0800 |
---|---|---|
committer | Josh Poimboeuf <jpoimboe@kernel.org> | 2025-03-12 15:43:39 -0700 |
commit | e20ab7d454ee8d1e0e8b9ff73a7c87e84c666b2f (patch) | |
tree | 70adf9d9904a0bcf193d268c5acad87f734f2176 /arch/loongarch/Makefile | |
parent | 88cbb468d4545526a33126f8a41352cac6dd0f3c (diff) |
LoongArch: Enable jump table for objtool
For now, it is time to remove -fno-jump-tables to enable jump table for
objtool if the compiler has -mannotate-tablejump, otherwise it is better
to remain -fno-jump-tables to keep compatibility with older compilers.
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
Link: https://lore.kernel.org/r/20241217010905.13054-8-yangtiezhu@loongson.cn
Acked-by: Huacai Chen <chenhuacai@loongson.cn>
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
Diffstat (limited to 'arch/loongarch/Makefile')
-rw-r--r-- | arch/loongarch/Makefile | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/arch/loongarch/Makefile b/arch/loongarch/Makefile index 567bd122a9ee..0304eabbe606 100644 --- a/arch/loongarch/Makefile +++ b/arch/loongarch/Makefile @@ -101,7 +101,11 @@ KBUILD_AFLAGS += $(call cc-option,-mthin-add-sub) $(call cc-option,-Wa$(comma) KBUILD_CFLAGS += $(call cc-option,-mthin-add-sub) $(call cc-option,-Wa$(comma)-mthin-add-sub) ifdef CONFIG_OBJTOOL -KBUILD_CFLAGS += -fno-jump-tables +ifdef CONFIG_CC_HAS_ANNOTATE_TABLEJUMP +KBUILD_CFLAGS += -mannotate-tablejump +else +KBUILD_CFLAGS += -fno-jump-tables # keep compatibility with older compilers +endif endif KBUILD_RUSTFLAGS += --target=loongarch64-unknown-none-softfloat -Ccode-model=small |