lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master be3de4b0 3/3: Don't specify nonempty $LDFLAGS


From: Greg Chicares
Subject: [lmi-commits] [lmi] master be3de4b0 3/3: Don't specify nonempty $LDFLAGS
Date: Thu, 7 Jul 2022 05:46:38 -0400 (EDT)

branch: master
commit be3de4b0f9ab362d0400eff2f8a14e9b545ef9e0
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>

    Don't specify nonempty $LDFLAGS
    
    See:
      https://lists.nongnu.org/archive/html/lmi/2022-07/msg00010.html
    et seqq.
---
 compiler_clang.make |  7 ++++---
 compiler_gcc.make   | 11 ++++++-----
 2 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/compiler_clang.make b/compiler_clang.make
index 6713bb5d..d1047017 100644
--- a/compiler_clang.make
+++ b/compiler_clang.make
@@ -208,17 +208,18 @@ EXTRA_LDFLAGS :=
 
 REQUIRED_LDFLAGS = \
   -fuse-ld=lld \
+  -Wl,-Map,$@.map \
   $(c_l_flags) \
   $(addprefix -L , $(all_library_directories)) \
   $(EXTRA_LDFLAGS) \
   $(EXTRA_LIBS) \
 
-LDFLAGS = -Wl,-Map,$@.map \
-
 ifeq (x86_64-pc-linux-gnu,$(LMI_TRIPLET))
-  LDFLAGS += -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack -Wl,-z,separate-code
+  REQUIRED_LDFLAGS += -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack 
-Wl,-z,separate-code
 endif
 
+LDFLAGS =
+
 # Archiver flags.
 
 REQUIRED_ARFLAGS = -rus
diff --git a/compiler_gcc.make b/compiler_gcc.make
index fbed7fbf..29921e33 100644
--- a/compiler_gcc.make
+++ b/compiler_gcc.make
@@ -274,31 +274,32 @@ all_library_directories := \
 EXTRA_LDFLAGS :=
 
 REQUIRED_LDFLAGS = \
+  -Wl,-Map,$@.map \
   $(c_l_flags) \
   $(addprefix -L , $(all_library_directories)) \
   $(EXTRA_LDFLAGS) \
   $(EXTRA_LIBS) \
 
-LDFLAGS = -Wl,-Map,$@.map \
-
 ifeq (x86_64-pc-linux-gnu,$(LMI_TRIPLET))
-  LDFLAGS += -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack -Wl,-z,separate-code
+  REQUIRED_LDFLAGS += -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack 
-Wl,-z,separate-code
 endif
 
 # By infelicitous default, MinGW enables auto-import. See, e.g.:
 #   https://sourceforge.net/p/mingw/mailman/message/16354653/
 # Disabling it globally, thus:
-#   LDFLAGS += -Wl,--disable-auto-import
+#   REQUIRED_LDFLAGS += -Wl,--disable-auto-import
 # worked with mingw.org's gcc, but the more recent MinGW-w64
 # versions seem to require it unless $(USE_SO_ATTRIBUTES) is
 # defined.
 
 ifneq (,$(USE_SO_ATTRIBUTES))
   ifeq (mingw32,$(findstring mingw32,$(LMI_TRIPLET)))
-    LDFLAGS += -Wl,--disable-auto-import -static-libstdc++
+    REQUIRED_LDFLAGS += -Wl,--disable-auto-import -static-libstdc++
   endif
 endif
 
+LDFLAGS =
+
 # Archiver flags.
 
 REQUIRED_ARFLAGS = -rus



reply via email to

[Prev in Thread] Current Thread [Next in Thread]