Skip to content

Commit 668c35f

Browse files
committed
Merge tag 'kbuild-v4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild
Pull Kbuild updates from Masahiro Yamada: "Kbuild core: - remove unneeded $(call cc-option,...) switches - consolidate Clang compiler flags into CLANG_FLAGS - announce the deprecation of SUBDIRS - fix single target build for external module - simplify the dependencies of 'prepare' stage targets - allow fixdep to directly write to .*.cmd files - simplify dependency generation for CONFIG_TRIM_UNUSED_KSYMS - change if_changed_rule to accept multi-line recipe - move .SECONDARY special target to scripts/Kbuild.include - remove redundant 'set -e' - improve parallel execution for CONFIG_HEADERS_CHECK - misc cleanups Treewide fixes and cleanups - set Clang flags correctly for PowerPC boot images - fix UML build error with CONFIG_GCC_PLUGINS - remove unneeded patterns from .gitignore files - refactor firmware/Makefile - remove unneeded rules for *offsets.s - avoid unneeded regeneration of intermediate .s files - clean up ./Kbuild Modpost: - remove unused -M, -K options - fix false positive warnings about section mismatch - use simple devtable lookup instead of linker magic - misc cleanups Coccinelle: - relax boolinit.cocci checks for overall consistency - fix warning messages of boolinit.cocci Other tools: - improve -dirty check of scripts/setlocalversion - add a tool to generate compile_commands.json from .*.cmd files" * tag 'kbuild-v4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (51 commits) kbuild: remove unused cmd_gentimeconst kbuild: remove $(obj)/ prefixes in ./Kbuild treewide: add intermediate .s files to targets treewide: remove explicit rules for *offsets.s firmware: refactor firmware/Makefile firmware: remove unnecessary patterns from .gitignore scripts: remove unnecessary ihex2fw and check-lc_ctypes from .gitignore um: remove unused filechk_gen_header in Makefile scripts: add a tool to produce a compile_commands.json file kbuild: add -Werror=implicit-int flag unconditionally kbuild: add -Werror=strict-prototypes flag unconditionally kbuild: add -fno-PIE flag unconditionally scripts: coccinelle: Correct warning message scripts: coccinelle: only suggest true/false in files that already use them kbuild: handle part-of-module correctly for *.ll and *.symtypes kbuild: refactor part-of-module kbuild: refactor quiet_modtag kbuild: remove redundant quiet_modtag for $(obj-m) kbuild: refactor Makefile.asm-generic user/Makefile: Fix typo and capitalization in comment section ...
2 parents d8372ba + dec28d8 commit 668c35f

37 files changed

Lines changed: 543 additions & 562 deletions

File tree

‎Documentation/kbuild/kbuild.txt‎

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,7 @@ KBUILD_EXTMOD
8181
--------------------------------------------------
8282
Set the directory to look for the kernel source when building external
8383
modules.
84-
The directory can be specified in several ways:
85-
1) Use "M=..." on the command line
86-
2) Environment variable KBUILD_EXTMOD
87-
3) Environment variable SUBDIRS
88-
The possibilities are listed in the order they take precedence.
89-
Using "M=..." will always override the others.
84+
Setting "M=..." takes precedence over KBUILD_EXTMOD.
9085

9186
KBUILD_OUTPUT
9287
--------------------------------------------------

‎Kbuild‎

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,7 @@ bounds-file := include/generated/bounds.h
1616
always := $(bounds-file)
1717
targets := kernel/bounds.s
1818

19-
# We use internal kbuild rules to avoid the "is up to date" message from make
20-
kernel/bounds.s: kernel/bounds.c FORCE
21-
$(call if_changed_dep,cc_s_c)
22-
23-
$(obj)/$(bounds-file): kernel/bounds.s FORCE
19+
$(bounds-file): kernel/bounds.s FORCE
2420
$(call filechk,offsets,__LINUX_BOUNDS_H__)
2521

2622
#####
@@ -30,15 +26,11 @@ timeconst-file := include/generated/timeconst.h
3026

3127
targets += $(timeconst-file)
3228

33-
quiet_cmd_gentimeconst = GEN $@
34-
define cmd_gentimeconst
35-
(echo $(CONFIG_HZ) | bc -q $< ) > $@
36-
endef
3729
define filechk_gentimeconst
3830
(echo $(CONFIG_HZ) | bc -q $< )
3931
endef
4032

41-
$(obj)/$(timeconst-file): kernel/time/timeconst.bc FORCE
33+
$(timeconst-file): kernel/time/timeconst.bc FORCE
4234
$(call filechk,gentimeconst)
4335

4436
#####
@@ -50,12 +42,9 @@ offsets-file := include/generated/asm-offsets.h
5042
always += $(offsets-file)
5143
targets += arch/$(SRCARCH)/kernel/asm-offsets.s
5244

53-
# We use internal kbuild rules to avoid the "is up to date" message from make
54-
arch/$(SRCARCH)/kernel/asm-offsets.s: arch/$(SRCARCH)/kernel/asm-offsets.c \
55-
$(obj)/$(timeconst-file) $(obj)/$(bounds-file) FORCE
56-
$(call if_changed_dep,cc_s_c)
45+
arch/$(SRCARCH)/kernel/asm-offsets.s: $(timeconst-file) $(bounds-file)
5746

58-
$(obj)/$(offsets-file): arch/$(SRCARCH)/kernel/asm-offsets.s FORCE
47+
$(offsets-file): arch/$(SRCARCH)/kernel/asm-offsets.s FORCE
5948
$(call filechk,offsets,__ASM_OFFSETS_H__)
6049

6150
#####
@@ -77,7 +66,7 @@ missing-syscalls: scripts/checksyscalls.sh $(offsets-file) FORCE
7766

7867
extra-$(CONFIG_GDB_SCRIPTS) += build_constants_py
7968

80-
build_constants_py: $(obj)/$(timeconst-file) $(obj)/$(bounds-file)
69+
build_constants_py: $(timeconst-file) $(bounds-file)
8170
@$(MAKE) $(build)=scripts/gdb/linux $@
8271

8372
# Keep these three files during make clean

‎Makefile‎

Lines changed: 51 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,10 @@ endif
186186
# Old syntax make ... SUBDIRS=$PWD is still supported
187187
# Setting the environment variable KBUILD_EXTMOD take precedence
188188
ifdef SUBDIRS
189+
$(warning ================= WARNING ================)
190+
$(warning 'SUBDIRS' will be removed after Linux 5.3)
191+
$(warning Please use 'M=' or 'KBUILD_EXTMOD' instead)
192+
$(warning ==========================================)
189193
KBUILD_EXTMOD ?= $(SUBDIRS)
190194
endif
191195

@@ -422,10 +426,10 @@ LINUXINCLUDE := \
422426
-I$(objtree)/include \
423427
$(USERINCLUDE)
424428

425-
KBUILD_AFLAGS := -D__ASSEMBLY__
426-
KBUILD_CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
427-
-fno-strict-aliasing -fno-common -fshort-wchar \
428-
-Werror-implicit-function-declaration \
429+
KBUILD_AFLAGS := -D__ASSEMBLY__ -fno-PIE
430+
KBUILD_CFLAGS := -Wall -Wundef -Werror=strict-prototypes -Wno-trigraphs \
431+
-fno-strict-aliasing -fno-common -fshort-wchar -fno-PIE \
432+
-Werror-implicit-function-declaration -Werror=implicit-int \
429433
-Wno-format-security \
430434
-std=gnu89
431435
KBUILD_CPPFLAGS := -D__KERNEL__
@@ -487,18 +491,18 @@ endif
487491

488492
ifneq ($(shell $(CC) --version 2>&1 | head -n 1 | grep clang),)
489493
ifneq ($(CROSS_COMPILE),)
490-
CLANG_TARGET := --target=$(notdir $(CROSS_COMPILE:%-=%))
494+
CLANG_FLAGS := --target=$(notdir $(CROSS_COMPILE:%-=%))
491495
GCC_TOOLCHAIN_DIR := $(dir $(shell which $(LD)))
492-
CLANG_PREFIX := --prefix=$(GCC_TOOLCHAIN_DIR)
496+
CLANG_FLAGS += --prefix=$(GCC_TOOLCHAIN_DIR)
493497
GCC_TOOLCHAIN := $(realpath $(GCC_TOOLCHAIN_DIR)/..)
494498
endif
495499
ifneq ($(GCC_TOOLCHAIN),)
496-
CLANG_GCC_TC := --gcc-toolchain=$(GCC_TOOLCHAIN)
500+
CLANG_FLAGS += --gcc-toolchain=$(GCC_TOOLCHAIN)
497501
endif
498-
KBUILD_CFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC) $(CLANG_PREFIX)
499-
KBUILD_AFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC) $(CLANG_PREFIX)
500-
KBUILD_CFLAGS += $(call cc-option, -no-integrated-as)
501-
KBUILD_AFLAGS += $(call cc-option, -no-integrated-as)
502+
CLANG_FLAGS += -no-integrated-as
503+
KBUILD_CFLAGS += $(CLANG_FLAGS)
504+
KBUILD_AFLAGS += $(CLANG_FLAGS)
505+
export CLANG_FLAGS
502506
endif
503507

504508
RETPOLINE_CFLAGS_GCC := -mindirect-branch=thunk-extern -mindirect-branch-register
@@ -510,9 +514,6 @@ RETPOLINE_VDSO_CFLAGS := $(call cc-option,$(RETPOLINE_VDSO_CFLAGS_GCC),$(call cc
510514
export RETPOLINE_CFLAGS
511515
export RETPOLINE_VDSO_CFLAGS
512516

513-
KBUILD_CFLAGS += $(call cc-option,-fno-PIE)
514-
KBUILD_AFLAGS += $(call cc-option,-fno-PIE)
515-
516517
# check for 'asm goto'
517518
ifeq ($(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-goto.sh $(CC) $(KBUILD_CFLAGS)), y)
518519
CC_HAVE_ASM_GOTO := 1
@@ -828,12 +829,6 @@ KBUILD_CFLAGS += $(call cc-option,-fno-stack-check,)
828829
# conserve stack if available
829830
KBUILD_CFLAGS += $(call cc-option,-fconserve-stack)
830831

831-
# disallow errors like 'EXPORT_GPL(foo);' with missing header
832-
KBUILD_CFLAGS += $(call cc-option,-Werror=implicit-int)
833-
834-
# require functions to have arguments in prototypes, not empty 'int foo()'
835-
KBUILD_CFLAGS += $(call cc-option,-Werror=strict-prototypes)
836-
837832
# Prohibit date/time macros, which would make the build non-deterministic
838833
KBUILD_CFLAGS += $(call cc-option,-Werror=date-time)
839834

@@ -1026,14 +1021,13 @@ cmd_link-vmlinux = \
10261021
$(if $(ARCH_POSTLINK), $(MAKE) -f $(ARCH_POSTLINK) $@, true)
10271022

10281023
vmlinux: scripts/link-vmlinux.sh autoksyms_recursive $(vmlinux-deps) FORCE
1029-
ifdef CONFIG_HEADERS_CHECK
1030-
$(Q)$(MAKE) -f $(srctree)/Makefile headers_check
1031-
endif
10321024
ifdef CONFIG_GDB_SCRIPTS
10331025
$(Q)ln -fsn $(abspath $(srctree)/scripts/gdb/vmlinux-gdb.py)
10341026
endif
10351027
+$(call if_changed,link-vmlinux)
10361028

1029+
targets := vmlinux
1030+
10371031
# Build samples along the rest of the kernel. This needs headers_install.
10381032
ifdef CONFIG_SAMPLES
10391033
vmlinux-dirs += samples
@@ -1051,7 +1045,7 @@ $(sort $(vmlinux-deps)): $(vmlinux-dirs) ;
10511045
# Error messages still appears in the original language
10521046

10531047
PHONY += $(vmlinux-dirs)
1054-
$(vmlinux-dirs): prepare scripts
1048+
$(vmlinux-dirs): prepare
10551049
$(Q)$(MAKE) $(build)=$@ need-builtin=1
10561050

10571051
define filechk_kernel.release
@@ -1066,7 +1060,7 @@ include/config/kernel.release: $(srctree)/Makefile FORCE
10661060
# Carefully list dependencies so we do not try to build scripts twice
10671061
# in parallel
10681062
PHONY += scripts
1069-
scripts: scripts_basic scripts_dtc asm-generic gcc-plugins $(autoksyms_h)
1063+
scripts: scripts_basic scripts_dtc
10701064
$(Q)$(MAKE) $(build)=$(@)
10711065

10721066
# Things we need to do before we recursively start building the kernel
@@ -1099,22 +1093,23 @@ prepare2: prepare3 outputmakefile asm-generic
10991093
prepare1: prepare2 $(version_h) $(autoksyms_h) include/generated/utsrelease.h
11001094
$(cmd_crmodverdir)
11011095

1102-
archprepare: archheaders archscripts prepare1 scripts_basic
1096+
archprepare: archheaders archscripts prepare1 scripts
11031097

1104-
prepare0: archprepare gcc-plugins
1098+
prepare0: archprepare
1099+
$(Q)$(MAKE) $(build)=scripts/mod
11051100
$(Q)$(MAKE) $(build)=.
11061101

11071102
# All the preparing..
11081103
prepare: prepare0 prepare-objtool
11091104

11101105
# Support for using generic headers in asm-generic
1106+
asm-generic := -f $(srctree)/scripts/Makefile.asm-generic obj
1107+
11111108
PHONY += asm-generic uapi-asm-generic
11121109
asm-generic: uapi-asm-generic
1113-
$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.asm-generic \
1114-
src=asm obj=arch/$(SRCARCH)/include/generated/asm
1110+
$(Q)$(MAKE) $(asm-generic)=arch/$(SRCARCH)/include/generated/asm
11151111
uapi-asm-generic:
1116-
$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.asm-generic \
1117-
src=uapi/asm obj=arch/$(SRCARCH)/include/generated/uapi/asm
1112+
$(Q)$(MAKE) $(asm-generic)=arch/$(SRCARCH)/include/generated/uapi/asm
11181113

11191114
PHONY += prepare-objtool
11201115
prepare-objtool: $(objtool_target)
@@ -1199,6 +1194,10 @@ headers_check: headers_install
11991194
$(Q)$(MAKE) $(hdr-inst)=include/uapi dst=include HDRCHECK=1
12001195
$(Q)$(MAKE) $(hdr-inst)=arch/$(SRCARCH)/include/uapi $(hdr-dst) HDRCHECK=1
12011196

1197+
ifdef CONFIG_HEADERS_CHECK
1198+
all: headers_check
1199+
endif
1200+
12021201
# ---------------------------------------------------------------------------
12031202
# Kernel selftest
12041203

@@ -1283,7 +1282,7 @@ modules.builtin: $(vmlinux-dirs:%=%/modules.builtin)
12831282

12841283
# Target to prepare building external modules
12851284
PHONY += modules_prepare
1286-
modules_prepare: prepare scripts
1285+
modules_prepare: prepare
12871286

12881287
# Target to install modules
12891288
PHONY += modules_install
@@ -1551,9 +1550,6 @@ else # KBUILD_EXTMOD
15511550

15521551
# We are always building modules
15531552
KBUILD_MODULES := 1
1554-
PHONY += crmodverdir
1555-
crmodverdir:
1556-
$(cmd_crmodverdir)
15571553

15581554
PHONY += $(objtree)/Module.symvers
15591555
$(objtree)/Module.symvers:
@@ -1565,7 +1561,7 @@ $(objtree)/Module.symvers:
15651561

15661562
module-dirs := $(addprefix _module_,$(KBUILD_EXTMOD))
15671563
PHONY += $(module-dirs) modules
1568-
$(module-dirs): crmodverdir $(objtree)/Module.symvers
1564+
$(module-dirs): prepare $(objtree)/Module.symvers
15691565
$(Q)$(MAKE) $(build)=$(patsubst _module_%,%,$@)
15701566

15711567
modules: $(module-dirs)
@@ -1604,10 +1600,9 @@ help:
16041600
@echo ' clean - remove generated files in module directory only'
16051601
@echo ''
16061602

1607-
# Dummies...
1608-
PHONY += prepare scripts
1609-
prepare: ;
1610-
scripts: ;
1603+
PHONY += prepare
1604+
prepare:
1605+
$(cmd_crmodverdir)
16111606
endif # KBUILD_EXTMOD
16121607

16131608
clean: $(clean-dirs)
@@ -1712,36 +1707,33 @@ else
17121707
target-dir = $(if $(KBUILD_EXTMOD),$(dir $<),$(dir $@))
17131708
endif
17141709

1715-
%.s: %.c prepare scripts FORCE
1710+
%.s: %.c prepare FORCE
17161711
$(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
1717-
%.i: %.c prepare scripts FORCE
1712+
%.i: %.c prepare FORCE
17181713
$(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
1719-
%.o: %.c prepare scripts FORCE
1714+
%.o: %.c prepare FORCE
17201715
$(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
1721-
%.lst: %.c prepare scripts FORCE
1716+
%.lst: %.c prepare FORCE
17221717
$(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
1723-
%.s: %.S prepare scripts FORCE
1718+
%.s: %.S prepare FORCE
17241719
$(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
1725-
%.o: %.S prepare scripts FORCE
1720+
%.o: %.S prepare FORCE
17261721
$(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
1727-
%.symtypes: %.c prepare scripts FORCE
1722+
%.symtypes: %.c prepare FORCE
17281723
$(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
1729-
%.ll: %.c prepare scripts FORCE
1724+
%.ll: %.c prepare FORCE
17301725
$(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
17311726

17321727
# Modules
1733-
/: prepare scripts FORCE
1734-
$(cmd_crmodverdir)
1728+
/: prepare FORCE
17351729
$(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \
17361730
$(build)=$(build-dir)
17371731
# Make sure the latest headers are built for Documentation
17381732
Documentation/ samples/: headers_install
1739-
%/: prepare scripts FORCE
1740-
$(cmd_crmodverdir)
1733+
%/: prepare FORCE
17411734
$(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \
17421735
$(build)=$(build-dir)
1743-
%.ko: prepare scripts FORCE
1744-
$(cmd_crmodverdir)
1736+
%.ko: prepare FORCE
17451737
$(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \
17461738
$(build)=$(build-dir) $(@:.ko=.o)
17471739
$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
@@ -1765,13 +1757,12 @@ quiet_cmd_depmod = DEPMOD $(KERNELRELEASE)
17651757
cmd_crmodverdir = $(Q)mkdir -p $(MODVERDIR) \
17661758
$(if $(KBUILD_MODULES),; rm -f $(MODVERDIR)/*)
17671759

1768-
# read all saved command lines
1769-
cmd_files := $(wildcard .*.cmd)
1760+
# read saved command lines for existing targets
1761+
existing-targets := $(wildcard $(sort $(targets)))
17701762

1771-
ifneq ($(cmd_files),)
1772-
$(cmd_files): ; # Do not try to update included dependency files
1773-
include $(cmd_files)
1774-
endif
1763+
cmd_files := $(foreach f,$(existing-targets),$(dir $(f)).$(notdir $(f)).cmd)
1764+
$(cmd_files): ; # Do not try to update included dependency files
1765+
-include $(cmd_files)
17751766

17761767
endif # ifeq ($(config-targets),1)
17771768
endif # ifeq ($(mixed-targets),1)

‎arch/arm/crypto/Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,4 @@ $(src)/sha512-core.S_shipped: $(src)/sha512-armv4.pl
6767
$(call cmd,perl)
6868
endif
6969

70-
targets += sha256-core.S sha512-core.S
70+
clean-files += sha256-core.S sha512-core.S

‎arch/arm/mach-at91/Makefile‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,9 @@ ifeq ($(CONFIG_PM_DEBUG),y)
1919
CFLAGS_pm.o += -DDEBUG
2020
endif
2121

22-
arch/arm/mach-at91/pm_data-offsets.s: arch/arm/mach-at91/pm_data-offsets.c
23-
$(call if_changed_dep,cc_s_c)
24-
2522
include/generated/at91_pm_data-offsets.h: arch/arm/mach-at91/pm_data-offsets.s FORCE
2623
$(call filechk,offsets,__PM_DATA_OFFSETS_H__)
2724

2825
arch/arm/mach-at91/pm_suspend.o: include/generated/at91_pm_data-offsets.h
26+
27+
targets += pm_data-offsets.s

‎arch/arm/mach-omap2/Makefile‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -236,10 +236,9 @@ obj-y += omap_phy_internal.o
236236

237237
obj-$(CONFIG_MACH_OMAP2_TUSB6010) += usb-tusb6010.o
238238

239-
arch/arm/mach-omap2/pm-asm-offsets.s: arch/arm/mach-omap2/pm-asm-offsets.c
240-
$(call if_changed_dep,cc_s_c)
241-
242239
include/generated/ti-pm-asm-offsets.h: arch/arm/mach-omap2/pm-asm-offsets.s FORCE
243240
$(call filechk,offsets,__TI_PM_ASM_OFFSETS_H__)
244241

245242
$(obj)/sleep33xx.o $(obj)/sleep43xx.o: include/generated/ti-pm-asm-offsets.h
243+
244+
targets += pm-asm-offsets.s

‎arch/arm64/crypto/Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,4 +78,4 @@ $(src)/sha512-core.S_shipped: $(src)/sha512-armv8.pl
7878
$(call cmd,perlasm)
7979
endif
8080

81-
targets += sha256-core.S sha512-core.S
81+
clean-files += sha256-core.S sha512-core.S

‎arch/ia64/kernel/Makefile‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,7 @@ CFLAGS_traps.o += -mfixed-range=f2-f5,f16-f31
5050
# The gate DSO image is built using a special linker script.
5151
include $(src)/Makefile.gate
5252

53-
# We use internal kbuild rules to avoid the "is up to date" message from make
54-
arch/$(SRCARCH)/kernel/nr-irqs.s: arch/$(SRCARCH)/kernel/nr-irqs.c
55-
$(Q)mkdir -p $(dir $@)
56-
$(call if_changed_dep,cc_s_c)
57-
5853
include/generated/nr-irqs.h: arch/$(SRCARCH)/kernel/nr-irqs.s FORCE
5954
$(call filechk,offsets,__ASM_NR_IRQS_H__)
55+
56+
targets += nr-irqs.s

‎arch/powerpc/boot/Makefile‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,11 @@ BOOTAFLAGS := -D__ASSEMBLY__ $(BOOTCFLAGS) -traditional -nostdinc
5555

5656
BOOTARFLAGS := -cr$(KBUILD_ARFLAGS)
5757

58+
ifdef CONFIG_CC_IS_CLANG
59+
BOOTCFLAGS += $(CLANG_FLAGS)
60+
BOOTAFLAGS += $(CLANG_FLAGS)
61+
endif
62+
5863
ifdef CONFIG_DEBUG_INFO
5964
BOOTCFLAGS += -g
6065
endif

0 commit comments

Comments
 (0)