kbuild: remove ar-option and KBUILD_ARFLAGS
Commit 40df759e2b
("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>
This commit is contained in:
parent
54ecb8f702
commit
13dc8c029c
|
@ -954,11 +954,6 @@ When kbuild executes, the following steps are followed (roughly):
|
|||
|
||||
From commandline LDFLAGS_MODULE shall be used (see kbuild.txt).
|
||||
|
||||
KBUILD_ARFLAGS Options for $(AR) when creating archives
|
||||
|
||||
$(KBUILD_ARFLAGS) set by the top level Makefile to "D" (deterministic
|
||||
mode) if this option is supported by $(AR).
|
||||
|
||||
KBUILD_LDS
|
||||
|
||||
The linker script with full path. Assigned by the top-level Makefile.
|
||||
|
|
4
Makefile
4
Makefile
|
@ -498,7 +498,6 @@ export CFLAGS_KASAN CFLAGS_KASAN_NOSANITIZE CFLAGS_UBSAN
|
|||
export KBUILD_AFLAGS AFLAGS_KERNEL AFLAGS_MODULE
|
||||
export KBUILD_AFLAGS_MODULE KBUILD_CFLAGS_MODULE KBUILD_LDFLAGS_MODULE
|
||||
export KBUILD_AFLAGS_KERNEL KBUILD_CFLAGS_KERNEL
|
||||
export KBUILD_ARFLAGS
|
||||
|
||||
# Files to ignore in find ... statements
|
||||
|
||||
|
@ -914,9 +913,6 @@ ifdef CONFIG_RETPOLINE
|
|||
KBUILD_CFLAGS += $(call cc-option,-fcf-protection=none)
|
||||
endif
|
||||
|
||||
# use the deterministic mode of AR if available
|
||||
KBUILD_ARFLAGS := $(call ar-option,D)
|
||||
|
||||
include scripts/Makefile.kasan
|
||||
include scripts/Makefile.extrawarn
|
||||
include scripts/Makefile.ubsan
|
||||
|
|
|
@ -50,7 +50,7 @@ endif
|
|||
|
||||
BOOTAFLAGS := -D__ASSEMBLY__ $(BOOTCFLAGS) -nostdinc
|
||||
|
||||
BOOTARFLAGS := -cr$(KBUILD_ARFLAGS)
|
||||
BOOTARFLAGS := -crD
|
||||
|
||||
ifdef CONFIG_CC_IS_CLANG
|
||||
BOOTCFLAGS += $(CLANG_FLAGS)
|
||||
|
|
|
@ -143,11 +143,6 @@ cc-ifversion = $(shell [ $(CONFIG_GCC_VERSION)0 $(1) $(2)000 ] && echo $(3) || e
|
|||
# Usage: KBUILD_LDFLAGS += $(call ld-option, -X, -Y)
|
||||
ld-option = $(call try-run, $(LD) $(KBUILD_LDFLAGS) $(1) -v,$(1),$(2),$(3))
|
||||
|
||||
# ar-option
|
||||
# Usage: KBUILD_ARFLAGS := $(call ar-option,D)
|
||||
# Important: no spaces around options
|
||||
ar-option = $(call try-run, $(AR) rc$(1) "$$TMP",$(1),$(2))
|
||||
|
||||
# ld-version
|
||||
# Note this is mainly for HJ Lu's 3 number binutil versions
|
||||
ld-version = $(shell $(LD) --version | $(srctree)/scripts/ld-version.sh)
|
||||
|
|
|
@ -389,7 +389,7 @@ $(sort $(subdir-obj-y)): $(subdir-ym) ;
|
|||
ifdef builtin-target
|
||||
|
||||
quiet_cmd_ar_builtin = AR $@
|
||||
cmd_ar_builtin = rm -f $@; $(AR) rcSTP$(KBUILD_ARFLAGS) $@ $(real-prereqs)
|
||||
cmd_ar_builtin = rm -f $@; $(AR) cDPrST $@ $(real-prereqs)
|
||||
|
||||
$(builtin-target): $(real-obj-y) FORCE
|
||||
$(call if_changed,ar_builtin)
|
||||
|
|
|
@ -232,7 +232,7 @@ quiet_cmd_ld = LD $@
|
|||
# ---------------------------------------------------------------------------
|
||||
|
||||
quiet_cmd_ar = AR $@
|
||||
cmd_ar = rm -f $@; $(AR) rcsTP$(KBUILD_ARFLAGS) $@ $(real-prereqs)
|
||||
cmd_ar = rm -f $@; $(AR) cDPrsT $@ $(real-prereqs)
|
||||
|
||||
# Objcopy
|
||||
# ---------------------------------------------------------------------------
|
||||
|
|
Loading…
Reference in New Issue