[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <174198263615.14745.12782989496753781204.tip-bot2@tip-bot2>
Date: Fri, 14 Mar 2025 20:03:56 -0000
From: "tip-bot2 for Tiezhu Yang" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: Tiezhu Yang <yangtiezhu@...ngson.cn>, Huacai Chen <chenhuacai@...ngson.cn>,
Josh Poimboeuf <jpoimboe@...nel.org>, x86@...nel.org,
linux-kernel@...r.kernel.org
Subject: [tip: objtool/core] LoongArch: Enable jump table for objtool
The following commit has been merged into the objtool/core branch of tip:
Commit-ID: e20ab7d454ee8d1e0e8b9ff73a7c87e84c666b2f
Gitweb: https://git.kernel.org/tip/e20ab7d454ee8d1e0e8b9ff73a7c87e84c666b2f
Author: Tiezhu Yang <yangtiezhu@...ngson.cn>
AuthorDate: Tue, 17 Dec 2024 09:09:03 +08:00
Committer: Josh Poimboeuf <jpoimboe@...nel.org>
CommitterDate: Wed, 12 Mar 2025 15:43:39 -07:00
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@...ngson.cn>
Link: https://lore.kernel.org/r/20241217010905.13054-8-yangtiezhu@loongson.cn
Acked-by: Huacai Chen <chenhuacai@...ngson.cn>
Signed-off-by: Josh Poimboeuf <jpoimboe@...nel.org>
---
arch/loongarch/Kconfig | 3 +++
arch/loongarch/Makefile | 6 +++++-
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/arch/loongarch/Kconfig b/arch/loongarch/Kconfig
index 2b8bd27..15aaa2e 100644
--- a/arch/loongarch/Kconfig
+++ b/arch/loongarch/Kconfig
@@ -291,6 +291,9 @@ config AS_HAS_LBT_EXTENSION
config AS_HAS_LVZ_EXTENSION
def_bool $(as-instr,hvcl 0)
+config CC_HAS_ANNOTATE_TABLEJUMP
+ def_bool $(cc-option,-mannotate-tablejump)
+
menu "Kernel type and options"
source "kernel/Kconfig.hz"
diff --git a/arch/loongarch/Makefile b/arch/loongarch/Makefile
index 567bd12..0304eab 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
Powered by blists - more mailing lists