mirror of
https://github.com/torvalds/linux.git
synced 2026-06-04 20:46:48 +02:00
LoongArch: Make LTO case independent in Makefile
LTO is not only used for Clang, but maybe also used for Rust, make LTO case out of CONFIG_CC_HAS_ANNOTATE_TABLEJUMP in Makefile. This is preparation for later patch, no function changes. Cc: stable@vger.kernel.org Suggested-by: WANG Rui <wangrui@loongson.cn> Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
This commit is contained in:
parent
539d7344d4
commit
b15212824a
|
|
@ -102,16 +102,16 @@ KBUILD_CFLAGS += $(call cc-option,-mthin-add-sub) $(call cc-option,-Wa$(comma)
|
||||||
|
|
||||||
ifdef CONFIG_OBJTOOL
|
ifdef CONFIG_OBJTOOL
|
||||||
ifdef CONFIG_CC_HAS_ANNOTATE_TABLEJUMP
|
ifdef CONFIG_CC_HAS_ANNOTATE_TABLEJUMP
|
||||||
|
KBUILD_CFLAGS += -mannotate-tablejump
|
||||||
|
else
|
||||||
|
KBUILD_CFLAGS += -fno-jump-tables # keep compatibility with older compilers
|
||||||
|
endif
|
||||||
|
ifdef CONFIG_LTO_CLANG
|
||||||
# The annotate-tablejump option can not be passed to LLVM backend when LTO is enabled.
|
# The annotate-tablejump option can not be passed to LLVM backend when LTO is enabled.
|
||||||
# Ensure it is aware of linker with LTO, '--loongarch-annotate-tablejump' also needs to
|
# Ensure it is aware of linker with LTO, '--loongarch-annotate-tablejump' also needs to
|
||||||
# be passed via '-mllvm' to ld.lld.
|
# be passed via '-mllvm' to ld.lld.
|
||||||
KBUILD_CFLAGS += -mannotate-tablejump
|
|
||||||
ifdef CONFIG_LTO_CLANG
|
|
||||||
KBUILD_LDFLAGS += -mllvm --loongarch-annotate-tablejump
|
KBUILD_LDFLAGS += -mllvm --loongarch-annotate-tablejump
|
||||||
endif
|
endif
|
||||||
else
|
|
||||||
KBUILD_CFLAGS += -fno-jump-tables # keep compatibility with older compilers
|
|
||||||
endif
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
KBUILD_RUSTFLAGS += --target=loongarch64-unknown-none-softfloat -Ccode-model=small
|
KBUILD_RUSTFLAGS += --target=loongarch64-unknown-none-softfloat -Ccode-model=small
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user