All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: linux-xfs@vger.kernel.org
Subject: [PATCH 3/5] xfsprogs: LDFLAGS comes from configure, not environment
Date: Tue, 24 Mar 2020 11:19:26 +1100	[thread overview]
Message-ID: <20200324001928.17894-4-david@fromorbit.com> (raw)
In-Reply-To: <20200324001928.17894-1-david@fromorbit.com>

From: Dave Chinner <dchinner@redhat.com>

When doing:

$ LDFLAGS=foo make

bad things happen because we don't initialise LDFLAGS to an empty
string in include/builddefs.in and hence make takes wahtever is in
the environment and runs with it. This causes problems with linker
options specified correctly through configure.

We don't support overriding build flags (like CFLAGS) though the
make environment, so it was an oversight 13 years ago to allow
LDFLAGS to be overridden when adding support to custom LDFLAGS being
passed from the the configure script. This ensures we only ever use
linker flags from configure, not the make environment.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
---
 include/builddefs.in | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/include/builddefs.in b/include/builddefs.in
index 891bf93d7aa3..6ed9d2951412 100644
--- a/include/builddefs.in
+++ b/include/builddefs.in
@@ -16,6 +16,10 @@ LTLDFLAGS = @LDFLAGS@
 CFLAGS = @CFLAGS@ -D_FILE_OFFSET_BITS=64 -Wno-address-of-packed-member
 BUILD_CFLAGS = @BUILD_CFLAGS@ -D_FILE_OFFSET_BITS=64
 
+# make sure we don't pick up whacky LDFLAGS from the make environment and
+# only use what we calculate from the configured options above.
+LDFLAGS =
+
 LIBRT = @librt@
 LIBUUID = @libuuid@
 LIBPTHREAD = @libpthread@
-- 
2.26.0.rc2


  parent reply	other threads:[~2020-03-24  0:19 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-24  0:19 [PATCH 0/5] xfsprogs: miscellenaous patches Dave Chinner
2020-03-24  0:19 ` [PATCH 1/5] mkfs: use cvtnum from libfrog Dave Chinner
2020-03-24  8:42   ` Christoph Hellwig
2020-03-24  0:19 ` [PATCH 2/5] xfsprogs: Fix --disable-static option build Dave Chinner
2020-03-24  8:43   ` Christoph Hellwig
2020-03-24  0:19 ` Dave Chinner [this message]
2020-03-24  8:44   ` [PATCH 3/5] xfsprogs: LDFLAGS comes from configure, not environment Christoph Hellwig
2020-03-24  0:19 ` [PATCH 4/5] xfsprogs: fix sliently borken option parsing Dave Chinner
2020-03-24  8:44   ` Christoph Hellwig
2020-03-24 20:44   ` Darrick J. Wong
2020-03-24  0:19 ` [PATCH 5/5] xfs_io: set exitcode on failure appropriately Dave Chinner
2020-03-24 20:47   ` Darrick J. Wong
2020-03-24 23:05     ` Dave Chinner
2020-03-24 20:57   ` Eric Sandeen
2020-03-24 23:12     ` Dave Chinner
2020-03-24 23:24       ` Darrick J. Wong
2020-03-24 23:44         ` Dave Chinner

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=20200324001928.17894-4-david@fromorbit.com \
    --to=david@fromorbit.com \
    --cc=linux-xfs@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.