Skip to content

Commit d6dbbf9

Browse files
xur-llvmintel-lab-lkp
authored andcommitted
kbuild: Fix Propeller build option
The '-fbasic-block-sections=labels' option has been deprecated with the following llvm patch: llvm/llvm-project#110039 The old option still works, but with a warning like clang: warning: argument '-fbasic-block-sections=labels' \ is deprecated, use '-fbasic-block-address-map' instead [-Wdeprecated] Currently, the option change is only in the ToT clang (v20) and not yet released in v19. This patch adds a check to the Makefile to set the proper option. If the option change is later integrated in v19.x, we need to update the check accordingly. Signed-off-by: Rong Xu <[email protected]> Reported-by: Nathan Chancellor <[email protected]>
1 parent 0dcc2d1 commit d6dbbf9

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

scripts/Makefile.propeller

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,13 @@ ifdef CLANG_PROPELLER_PROFILE_PREFIX
55
CFLAGS_PROPELLER_CLANG := -fbasic-block-sections=list=$(CLANG_PROPELLER_PROFILE_PREFIX)_cc_profile.txt -ffunction-sections
66
KBUILD_LDFLAGS += --symbol-ordering-file=$(CLANG_PROPELLER_PROFILE_PREFIX)_ld_profile.txt --no-warn-symbol-ordering
77
else
8-
CFLAGS_PROPELLER_CLANG := -fbasic-block-sections=labels
8+
# Staring with clang v20, the '-fbasic-block-sections=labels' option is
9+
# deprecated. Use the recommended '-fbasic-block-address-map' option.
10+
ifeq ($(call clang-min-version, 200000),y)
11+
CFLAGS_PROPELLER_CLANG := -fbasic-block-address-map
12+
else
13+
CFLAGS_PROPELLER_CLANG := -fbasic-block-sections=labels
14+
endif
915
endif
1016

1117
# Propeller requires debug information to embed module names in the profiles.
@@ -21,7 +27,11 @@ ifdef CONFIG_LTO_CLANG_THIN
2127
ifdef CLANG_PROPELLER_PROFILE_PREFIX
2228
KBUILD_LDFLAGS += --lto-basic-block-sections=$(CLANG_PROPELLER_PROFILE_PREFIX)_cc_profile.txt
2329
else
24-
KBUILD_LDFLAGS += --lto-basic-block-sections=labels
30+
ifeq ($(call clang-min-version, 200000),y)
31+
KBUILD_LDFLAGS += --lto-basic-block-address-map
32+
else
33+
KBUILD_LDFLAGS += --lto-basic-block-sections=labels
34+
endif
2535
endif
2636
endif
2737

0 commit comments

Comments
 (0)