]> www.infradead.org Git - users/hch/xfsprogs.git/commitdiff
xfsprogs: LDFLAGS comes from configure, not environment
authorDave Chinner <dchinner@redhat.com>
Tue, 7 Apr 2020 18:29:39 +0000 (14:29 -0400)
committerEric Sandeen <sandeen@sandeen.net>
Tue, 7 Apr 2020 18:29:39 +0000 (14:29 -0400)
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>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
include/builddefs.in

index 891bf93d7aa38bcaa3ca71e505ccb849dfcd7cf1..6ed9d29514125f8dbf6112e5ec141314b5fe161e 100644 (file)
@@ -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@