xfsprogs: LDFLAGS comes from configure, not the make environment From: Dave Chinner 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 even when the correct linker options are 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 --- include/builddefs.in | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/builddefs.in b/include/builddefs.in index c5b38b073e1f..e0f0ad94976e 100644 --- a/include/builddefs.in +++ b/include/builddefs.in @@ -16,6 +16,10 @@ LTLDFLAGS = @LDFLAGS@ CFLAGS = @CFLAGS@ -D_FILE_OFFSET_BITS=64 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@