MIPS: VDSO: Fix binutils version test
PATCH 1/1 MIPS: VDSO: Fix binutils version test
Commit 2a037f310bab ("MIPS: VDSO: Fix build error") fixed the logic for testing binutils version, but introduced another issue.
The ld-ifversion macro is defined as follows:
$(shell [ $(ld-version) $(1) $(2) ] && echo $(3) || echo $(4))
This macro checks ld version to echo $(3) or echo $(4) based on the given condition.
It is called as follows in arch/mips/vdso/Makefile:
ifeq ($(call ld-ifversion, -lt, 22500000, y),)
$(warning MIPS VDSO requires binutils >= 2.25)
obj-vdso-y := $(filter-out gettimeofday.o, $(obj-vdso-y))
ccflags-vdso += -DDISABLE_MIPS_VDSO
endifSince $(4) is empty, echo $(4) will evaluate to a simple 'echo'. So, in case binutils version is indeed greater than 2.25.0, ld-ifversion macro will return a newline, not the empty string as expected, and that makes the test fail.
This patch fixes the test condition.
arch/mips/vdso/Makefile +1 -1
@@ -26,7 +26,7 @@ aflags-vdso := $(ccflags-vdso) \ # the comments on that file. # ifndef CONFIG_CPU_MIPSR6 - ifeq ($(call ld-ifversion, -lt, 22500000, y),) + ifneq ($(call ld-ifversion,-ge,22500000,y),y) $(warning MIPS VDSO requires binutils >= 2.25) obj-vdso-y := $(filter-out gettimeofday.o, $(obj-vdso-y)) ccflags-vdso += -DDISABLE_MIPS_VDSO
Hi Tony,
Quoted 18 lines · Tony Wu
Commit
2a037f310bab("MIPS: VDSO: Fix build error") fixed the logic for testing binutils version, but introduced another issue.The ld-ifversion macro is defined as follows:
$(shell [ $(ld-version) $(1) $(2) ] && echo $(3) || echo $(4))This macro checks ld version to echo $(3) or echo $(4) based on the given condition.
It is called as follows in
arch/mips/vdso/Makefile:ifeq ($(call ld-ifversion, -lt, 22500000, y),) $(warning MIPS VDSO requires binutils >= 2.25) obj-vdso-y := $(filter-out gettimeofday.o, $(obj-vdso-y)) ccflags-vdso += -DDISABLE_MIPS_VDSO endif
Quoted 6 lines
Since $(4) is empty, echo $(4) will evaluate to a simple 'echo'. So, in case binutils version is indeed greater than 2.25.0, ld-ifversion macro will return a newline, not the empty string as expected, and that makes the test fail.
This patch fixes the test condition.
See:
- http://patchwork.linux-mips.org/patch/11926/
(now merged into mainline)
- http://patchwork.linux-mips.org/patch/11931/
(in mips-for-linux-next / linux-next for v4.4)
Thanks
James
Quoted 19 lines
Signed-off-by Tony Wu <[email protected]>Cc Qais Yousef <[email protected]>Cc Alex Smith <[email protected]>arch/mips/vdso/Makefile +1
-1@@ -26,7 +26,7 @@ aflags-vdso := $(ccflags-vdso) \ # the comments on that file. # ifndef CONFIG_CPU_MIPSR6 - ifeq ($(call ld-ifversion, -lt, 22500000, y),) + ifneq ($(call ld-ifversion,-ge,22500000,y),y) $(warning MIPS VDSO requires binutils >= 2.25) obj-vdso-y := $(filter-out gettimeofday.o, $(obj-vdso-y)) ccflags-vdso += -DDISABLE_MIPS_VDSO