Skip to content

Commit 052c805

Browse files
committed
kbuild: LD_VERSION redenomination
Commit ccbef16 ("Kbuild, lto: add ld-version and ld-ifversion macros") introduced scripts/ld-version.sh for GCC LTO. At that time, this script handled 5 version fields because GCC LTO needed the downstream binutils. (https://lkml.org/lkml/2014/4/8/272) The code snippet from the submitted patch was as follows: # We need HJ Lu's Linux binutils because mainline binutils does not # support mixing assembler and LTO code in the same ld -r object. # XXX check if the gcc plugin ld is the expected one too # XXX some Fedora binutils should also support it. How to check for that? ifeq ($(call ld-ifversion,-ge,22710001,y),y) ... However, GCC LTO was not merged into the mainline after all. (https://lkml.org/lkml/2014/4/8/272) So, the 4th and 5th fields were never used, and finally removed by commit 0d61ed1 ("ld-version: Drop the 4th and 5th version components"). Since then, the last 4-digits returned by this script is always zeros. Remove the meaningless last 4-digits. This makes the version format consistent with GCC_VERSION, CLANG_VERSION, LLD_VERSION. Signed-off-by: Masahiro Yamada <[email protected]> Acked-by: Will Deacon <[email protected]> Acked-by: Thomas Bogendoerfer <[email protected]>
1 parent 83272e6 commit 052c805

File tree

6 files changed

+6
-6
lines changed

6 files changed

+6
-6
lines changed

arch/arm64/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1477,7 +1477,7 @@ config ARM64_PTR_AUTH
14771477
depends on (CC_HAS_SIGN_RETURN_ADDRESS || CC_HAS_BRANCH_PROT_PAC_RET) && AS_HAS_PAC
14781478
# Modern compilers insert a .note.gnu.property section note for PAC
14791479
# which is only understood by binutils starting with version 2.33.1.
1480-
depends on LD_IS_LLD || LD_VERSION >= 233010000 || (CC_IS_GCC && GCC_VERSION < 90100)
1480+
depends on LD_IS_LLD || LD_VERSION >= 23301 || (CC_IS_GCC && GCC_VERSION < 90100)
14811481
depends on !CC_IS_CLANG || AS_HAS_CFI_NEGATE_RA_STATE
14821482
depends on (!FUNCTION_GRAPH_TRACER || DYNAMIC_FTRACE_WITH_REGS)
14831483
help

arch/mips/loongson64/Platform

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ cflags-$(CONFIG_CPU_LOONGSON64) += $(call as-option,-Wa$(comma)-mno-fix-loongson
3535
# can't easily be used safely within the kbuild framework.
3636
#
3737
ifeq ($(call cc-ifversion, -ge, 0409, y), y)
38-
ifeq ($(call ld-ifversion, -ge, 225000000, y), y)
38+
ifeq ($(call ld-ifversion, -ge, 22500, y), y)
3939
cflags-$(CONFIG_CPU_LOONGSON64) += \
4040
$(call cc-option,-march=loongson3a -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS64)
4141
else

arch/mips/vdso/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# the lack of relocations. As such, we disable the VDSO for microMIPS builds.
1313

1414
config MIPS_LD_CAN_LINK_VDSO
15-
def_bool LD_VERSION >= 225000000 || LD_IS_LLD
15+
def_bool LD_VERSION >= 22500 || LD_IS_LLD
1616

1717
config MIPS_DISABLE_VDSO
1818
def_bool CPU_MICROMIPS || (!CPU_MIPSR6 && !MIPS_LD_CAN_LINK_VDSO)

arch/powerpc/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ UTS_MACHINE := $(subst $(space),,$(machine-y))
6565
ifdef CONFIG_PPC32
6666
KBUILD_LDFLAGS_MODULE += arch/powerpc/lib/crtsavres.o
6767
else
68-
ifeq ($(call ld-ifversion, -ge, 225000000, y),y)
68+
ifeq ($(call ld-ifversion, -ge, 22500, y),y)
6969
# Have the linker provide sfpr if possible.
7070
# There is a corresponding test in arch/powerpc/lib/Makefile
7171
KBUILD_LDFLAGS_MODULE += --save-restore-funcs

arch/powerpc/lib/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ obj-$(CONFIG_FUNCTION_ERROR_INJECTION) += error-inject.o
3131
# 64-bit linker creates .sfpr on demand for final link (vmlinux),
3232
# so it is only needed for modules, and only for older linkers which
3333
# do not support --save-restore-funcs
34-
ifeq ($(call ld-ifversion, -lt, 225000000, y),y)
34+
ifeq ($(call ld-ifversion, -lt, 22500, y),y)
3535
extra-$(CONFIG_PPC64) += crtsavres.o
3636
endif
3737

scripts/ld-version.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
gsub(".*version ", "");
77
gsub("-.*", "");
88
split($1,a, ".");
9-
print a[1]*100000000 + a[2]*1000000 + a[3]*10000;
9+
print a[1]*10000 + a[2]*100 + a[3];
1010
exit
1111
}

0 commit comments

Comments
 (0)