Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Tony Wu <tung7970@gmail.com>
To: ralf@linux-mips.org, Qais Yousef <qais.yousef@imgtec.com>
Cc: Alex Smith <alex@alex-smith.me.uk>, linux-mips@linux-mips.org
Subject: [PATCH] MIPS: VDSO: Fix binutils version test
Date: Tue, 5 Jan 2016 15:21:01 +0800	[thread overview]
Message-ID: <20160105151705-tung7970@googlemail.com> (raw)

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

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.

Signed-off-by: Tony Wu <tung7970@gmail.com>
Cc: Qais Yousef <qais.yousef@imgtec.com>
Cc: Alex Smith <alex@alex-smith.me.uk>

diff --git a/arch/mips/vdso/Makefile b/arch/mips/vdso/Makefile
index 018f8c7..a54a082 100644
--- a/arch/mips/vdso/Makefile
+++ b/arch/mips/vdso/Makefile
@@ -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

             reply	other threads:[~2016-01-05  7:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-05  7:21 Tony Wu [this message]
2016-01-06 15:22 ` [PATCH] MIPS: VDSO: Fix binutils version test James Hogan
2016-01-06 15:22   ` James Hogan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160105151705-tung7970@googlemail.com \
    --to=tung7970@gmail.com \
    --cc=alex@alex-smith.me.uk \
    --cc=linux-mips@linux-mips.org \
    --cc=qais.yousef@imgtec.com \
    --cc=ralf@linux-mips.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox