Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

kbuild: Fix Propeller build option

The '-fbasic-block-sections=labels' option has been deprecated in tip
of tree clang (20.0.0) [1]. While the option still works, a warning is
emitted:

clang: warning: argument '-fbasic-block-sections=labels' is deprecated, use '-fbasic-block-address-map' instead [-Wdeprecated]

Add a version check to set the proper option.

Link: https://github.com/llvm/llvm-project/pull/110039 [1]

Signed-off-by: Rong Xu <xur@google.com>
Reported-by: Nathan Chancellor <nathan@kernel.org>
Suggested-by: Nathan Chancellor <nathan@kernel.org>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Tested-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

authored by

Rong Xu and committed by
Masahiro Yamada
d63b8524 d5dc9583

+13 -2
+13 -2
scripts/Makefile.propeller
··· 5 5 CFLAGS_PROPELLER_CLANG := -fbasic-block-sections=list=$(CLANG_PROPELLER_PROFILE_PREFIX)_cc_profile.txt -ffunction-sections 6 6 KBUILD_LDFLAGS += --symbol-ordering-file=$(CLANG_PROPELLER_PROFILE_PREFIX)_ld_profile.txt --no-warn-symbol-ordering 7 7 else 8 - CFLAGS_PROPELLER_CLANG := -fbasic-block-sections=labels 8 + # Starting with Clang v20, the '-fbasic-block-sections=labels' option is 9 + # deprecated. Use the recommended '-fbasic-block-address-map' option. 10 + # Link: https://github.com/llvm/llvm-project/pull/110039 11 + ifeq ($(call clang-min-version, 200000),y) 12 + CFLAGS_PROPELLER_CLANG := -fbasic-block-address-map 13 + else 14 + CFLAGS_PROPELLER_CLANG := -fbasic-block-sections=labels 15 + endif 9 16 endif 10 17 11 18 # Propeller requires debug information to embed module names in the profiles. ··· 28 21 ifdef CLANG_PROPELLER_PROFILE_PREFIX 29 22 KBUILD_LDFLAGS += --lto-basic-block-sections=$(CLANG_PROPELLER_PROFILE_PREFIX)_cc_profile.txt 30 23 else 31 - KBUILD_LDFLAGS += --lto-basic-block-sections=labels 24 + ifeq ($(call test-ge, $(CONFIG_LLD_VERSION), 200000),y) 25 + KBUILD_LDFLAGS += --lto-basic-block-address-map 26 + else 27 + KBUILD_LDFLAGS += --lto-basic-block-sections=labels 28 + endif 32 29 endif 33 30 endif 34 31