Skip to content

Commit 8cc7af7

Browse files
committed
kbuild: remove ARCH_{CPP,A,C}FLAGS
These flags were added by commit 61754c1 ("kbuild: Allow arch Makefiles to override {cpp,ld,c}flags") to allow ARC to override -O2. We did not see any other usage after all. Now that ARC switched to CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3, there is no more user of these variables. Signed-off-by: Masahiro Yamada <[email protected]>
1 parent 15f5db6 commit 8cc7af7

File tree

2 files changed

+4
-17
lines changed

2 files changed

+4
-17
lines changed

Documentation/kbuild/makefiles.rst

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -959,13 +959,6 @@ When kbuild executes, the following steps are followed (roughly):
959959
$(KBUILD_ARFLAGS) set by the top level Makefile to "D" (deterministic
960960
mode) if this option is supported by $(AR).
961961

962-
ARCH_CPPFLAGS, ARCH_AFLAGS, ARCH_CFLAGS Overrides the kbuild defaults
963-
964-
These variables are appended to the KBUILD_CPPFLAGS,
965-
KBUILD_AFLAGS, and KBUILD_CFLAGS, respectively, after the
966-
top-level Makefile has set any other flags. This provides a
967-
means for an architecture to override the defaults.
968-
969962
KBUILD_LDS
970963

971964
The linker script with full path. Assigned by the top-level Makefile.

Makefile

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -668,11 +668,6 @@ RETPOLINE_VDSO_CFLAGS := $(call cc-option,$(RETPOLINE_VDSO_CFLAGS_GCC),$(call cc
668668
export RETPOLINE_CFLAGS
669669
export RETPOLINE_VDSO_CFLAGS
670670

671-
# The arch Makefile can set ARCH_{CPP,A,C}FLAGS to override the default
672-
# values of the respective KBUILD_* variables
673-
ARCH_CPPFLAGS :=
674-
ARCH_AFLAGS :=
675-
ARCH_CFLAGS :=
676671
include arch/$(SRCARCH)/Makefile
677672

678673
ifdef need-config
@@ -927,11 +922,10 @@ include scripts/Makefile.kasan
927922
include scripts/Makefile.extrawarn
928923
include scripts/Makefile.ubsan
929924

930-
# Add any arch overrides and user supplied CPPFLAGS, AFLAGS and CFLAGS as the
931-
# last assignments
932-
KBUILD_CPPFLAGS += $(ARCH_CPPFLAGS) $(KCPPFLAGS)
933-
KBUILD_AFLAGS += $(ARCH_AFLAGS) $(KAFLAGS)
934-
KBUILD_CFLAGS += $(ARCH_CFLAGS) $(KCFLAGS)
925+
# Add user supplied CPPFLAGS, AFLAGS and CFLAGS as the last assignments
926+
KBUILD_CPPFLAGS += $(KCPPFLAGS)
927+
KBUILD_AFLAGS += $(KAFLAGS)
928+
KBUILD_CFLAGS += $(KCFLAGS)
935929

936930
KBUILD_LDFLAGS_MODULE += --build-id
937931
LDFLAGS_vmlinux += --build-id

0 commit comments

Comments
 (0)