Magellan Linux

Annotation of /trunk/xfsprogs/patches/xfsprogs-5.2.1-LDFLAGS-comes-from-configure-not-the-make-environment.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3450 - (hide annotations) (download)
Tue Oct 8 14:57:02 2019 UTC (4 years, 8 months ago) by niro
File size: 1359 byte(s)
-added patch to fix LDFLAGS issues with xfsprogs and the make environment
1 niro 3450 xfsprogs: LDFLAGS comes from configure, not the make environment
2    
3     From: Dave Chinner <dchinner@xxxxxxxxxx>
4    
5     When doing:
6    
7     $ LDFLAGS=foo make
8    
9     bad things happen because we don't initialise LDFLAGS to an empty
10     string in include/builddefs.in and hence make takes wahtever is in
11     the environment and runs with it. This causes problems even when the
12     correct linker options are specified correctly through configure.
13    
14     We don't support overriding build flags (like CFLAGS) though the
15     make environment, so it was an oversight 13 years ago to allow
16     LDFLAGS to be overridden when adding support to custom LDFLAGS being
17     passed from the the configure script. This ensures we only ever use
18     linker flags from configure, not the make environment.
19    
20     Signed-off-by: Dave Chinner <dchinner@xxxxxxxxxx>
21     ---
22     include/builddefs.in | 4 ++++
23     1 file changed, 4 insertions(+)
24    
25     diff --git a/include/builddefs.in b/include/builddefs.in
26     index c5b38b073e1f..e0f0ad94976e 100644
27     --- a/include/builddefs.in
28     +++ b/include/builddefs.in
29     @@ -16,6 +16,10 @@ LTLDFLAGS = @LDFLAGS@
30     CFLAGS = @CFLAGS@ -D_FILE_OFFSET_BITS=64
31     BUILD_CFLAGS = @BUILD_CFLAGS@ -D_FILE_OFFSET_BITS=64
32    
33     +# make sure we don't pick up whacky LDFLAGS from the make environment and
34     +# only use what we calculate from the configured options above.
35     +LDFLAGS =
36     +
37     LIBRT = @librt@
38     LIBUUID = @libuuid@
39     LIBPTHREAD = @libpthread@
40