summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2019-09-21 02:49:54 -0400
committerMasahiro Yamada <yamada.masahiro@socionext.com>2019-09-30 20:20:33 -0400
commit13dc8c029cabf52ba95f60c56eb104d4d95d5889 (patch)
treea2e08aca7ee597754f336306870463f886154e35
parent54ecb8f7028c5eb3d740bb82b0f1d90f2df63c5c (diff)
kbuild: remove ar-option and KBUILD_ARFLAGS
Commit 40df759e2b9e ("kbuild: Fix build with binutils <= 2.19") introduced ar-option and KBUILD_ARFLAGS to deal with old binutils. According to Documentation/process/changes.rst, the current minimal supported version of binutils is 2.21 so you can assume the 'D' option is always supported. Not only GNU ar but also llvm-ar supports it. With the 'D' option hard-coded, there is no more user of ar-option or KBUILD_ARFLAGS. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Nick Desaulniers <ndesaulniers@google.com> Tested-by: Nick Desaulniers <ndesaulniers@google.com>
-rw-r--r--Documentation/kbuild/makefiles.rst5
-rw-r--r--Makefile4
-rw-r--r--arch/powerpc/boot/Makefile2
-rw-r--r--scripts/Kbuild.include5
-rw-r--r--scripts/Makefile.build2
-rw-r--r--scripts/Makefile.lib2
6 files changed, 3 insertions, 17 deletions
diff --git a/Documentation/kbuild/makefiles.rst b/Documentation/kbuild/makefiles.rst
index 6ba9d5365ff3..b89c88168d6a 100644
--- a/Documentation/kbuild/makefiles.rst
+++ b/Documentation/kbuild/makefiles.rst
@@ -954,11 +954,6 @@ When kbuild executes, the following steps are followed (roughly):
954 954
955 From commandline LDFLAGS_MODULE shall be used (see kbuild.txt). 955 From commandline LDFLAGS_MODULE shall be used (see kbuild.txt).
956 956
957 KBUILD_ARFLAGS Options for $(AR) when creating archives
958
959 $(KBUILD_ARFLAGS) set by the top level Makefile to "D" (deterministic
960 mode) if this option is supported by $(AR).
961
962 KBUILD_LDS 957 KBUILD_LDS
963 958
964 The linker script with full path. Assigned by the top-level Makefile. 959 The linker script with full path. Assigned by the top-level Makefile.
diff --git a/Makefile b/Makefile
index 6f54f2f95743..7452174f5b21 100644
--- a/Makefile
+++ b/Makefile
@@ -498,7 +498,6 @@ export CFLAGS_KASAN CFLAGS_KASAN_NOSANITIZE CFLAGS_UBSAN
498export KBUILD_AFLAGS AFLAGS_KERNEL AFLAGS_MODULE 498export KBUILD_AFLAGS AFLAGS_KERNEL AFLAGS_MODULE
499export KBUILD_AFLAGS_MODULE KBUILD_CFLAGS_MODULE KBUILD_LDFLAGS_MODULE 499export KBUILD_AFLAGS_MODULE KBUILD_CFLAGS_MODULE KBUILD_LDFLAGS_MODULE
500export KBUILD_AFLAGS_KERNEL KBUILD_CFLAGS_KERNEL 500export KBUILD_AFLAGS_KERNEL KBUILD_CFLAGS_KERNEL
501export KBUILD_ARFLAGS
502 501
503# Files to ignore in find ... statements 502# Files to ignore in find ... statements
504 503
@@ -914,9 +913,6 @@ ifdef CONFIG_RETPOLINE
914KBUILD_CFLAGS += $(call cc-option,-fcf-protection=none) 913KBUILD_CFLAGS += $(call cc-option,-fcf-protection=none)
915endif 914endif
916 915
917# use the deterministic mode of AR if available
918KBUILD_ARFLAGS := $(call ar-option,D)
919
920include scripts/Makefile.kasan 916include scripts/Makefile.kasan
921include scripts/Makefile.extrawarn 917include scripts/Makefile.extrawarn
922include scripts/Makefile.ubsan 918include scripts/Makefile.ubsan
diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
index 6841bd52738b..dfbd7f22eef5 100644
--- a/arch/powerpc/boot/Makefile
+++ b/arch/powerpc/boot/Makefile
@@ -50,7 +50,7 @@ endif
50 50
51BOOTAFLAGS := -D__ASSEMBLY__ $(BOOTCFLAGS) -nostdinc 51BOOTAFLAGS := -D__ASSEMBLY__ $(BOOTCFLAGS) -nostdinc
52 52
53BOOTARFLAGS := -cr$(KBUILD_ARFLAGS) 53BOOTARFLAGS := -crD
54 54
55ifdef CONFIG_CC_IS_CLANG 55ifdef CONFIG_CC_IS_CLANG
56BOOTCFLAGS += $(CLANG_FLAGS) 56BOOTCFLAGS += $(CLANG_FLAGS)
diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include
index 4b0432e095ae..10ba926ae292 100644
--- a/scripts/Kbuild.include
+++ b/scripts/Kbuild.include
@@ -143,11 +143,6 @@ cc-ifversion = $(shell [ $(CONFIG_GCC_VERSION)0 $(1) $(2)000 ] && echo $(3) || e
143# Usage: KBUILD_LDFLAGS += $(call ld-option, -X, -Y) 143# Usage: KBUILD_LDFLAGS += $(call ld-option, -X, -Y)
144ld-option = $(call try-run, $(LD) $(KBUILD_LDFLAGS) $(1) -v,$(1),$(2),$(3)) 144ld-option = $(call try-run, $(LD) $(KBUILD_LDFLAGS) $(1) -v,$(1),$(2),$(3))
145 145
146# ar-option
147# Usage: KBUILD_ARFLAGS := $(call ar-option,D)
148# Important: no spaces around options
149ar-option = $(call try-run, $(AR) rc$(1) "$$TMP",$(1),$(2))
150
151# ld-version 146# ld-version
152# Note this is mainly for HJ Lu's 3 number binutil versions 147# Note this is mainly for HJ Lu's 3 number binutil versions
153ld-version = $(shell $(LD) --version | $(srctree)/scripts/ld-version.sh) 148ld-version = $(shell $(LD) --version | $(srctree)/scripts/ld-version.sh)
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index f72aba64d611..a9e47953ca53 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -389,7 +389,7 @@ $(sort $(subdir-obj-y)): $(subdir-ym) ;
389ifdef builtin-target 389ifdef builtin-target
390 390
391quiet_cmd_ar_builtin = AR $@ 391quiet_cmd_ar_builtin = AR $@
392 cmd_ar_builtin = rm -f $@; $(AR) rcSTP$(KBUILD_ARFLAGS) $@ $(real-prereqs) 392 cmd_ar_builtin = rm -f $@; $(AR) cDPrST $@ $(real-prereqs)
393 393
394$(builtin-target): $(real-obj-y) FORCE 394$(builtin-target): $(real-obj-y) FORCE
395 $(call if_changed,ar_builtin) 395 $(call if_changed,ar_builtin)
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 4a0cdd6f5909..179d55af5852 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -232,7 +232,7 @@ quiet_cmd_ld = LD $@
232# --------------------------------------------------------------------------- 232# ---------------------------------------------------------------------------
233 233
234quiet_cmd_ar = AR $@ 234quiet_cmd_ar = AR $@
235 cmd_ar = rm -f $@; $(AR) rcsTP$(KBUILD_ARFLAGS) $@ $(real-prereqs) 235 cmd_ar = rm -f $@; $(AR) cDPrsT $@ $(real-prereqs)
236 236
237# Objcopy 237# Objcopy
238# --------------------------------------------------------------------------- 238# ---------------------------------------------------------------------------