[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 9446c52f 1/2: Explain why $(LDFLAGS) includes
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 9446c52f 1/2: Explain why $(LDFLAGS) includes a flag such as '-g' |
Date: |
Thu, 14 Jul 2022 17:47:51 -0400 (EDT) |
branch: master
commit 9446c52f768010b5f4c19550ec85fc8e9d659aac
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>
Explain why $(LDFLAGS) includes a flag such as '-g'
---
compiler_clang.make | 6 +++++-
compiler_gcc.make | 6 +++++-
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/compiler_clang.make b/compiler_clang.make
index d1047017..55de40d2 100644
--- a/compiler_clang.make
+++ b/compiler_clang.make
@@ -118,7 +118,11 @@ endif
# The gprof '-pg' flag is one example. Another is '-fPIC', which
# pc-linux-gnu requires for '-shared':
# https://gcc.gnu.org/onlinedocs/gcc/Link-Options.html#DOCF1
-# Yet another is 'debug_flag': the GNU Coding Standards
+# Yet another is 'debug_flag': including it in $(LDFLAGS) seems
+# to be historical practice, as seen in the GNU 'make' manual:
+# https://www.gnu.org/software/make/manual/make.html#Complex-Makefile
+# | LDFLAGS = -g
+# even though GNU 'ld' ignores '-g'; and the GNU Coding Standards
# https://www.gnu.org/prep/standards/html_node/Command-Variables.html
# suggest including flags such as '-g' in $(CFLAGS) because they
# are "not required for proper compilation", but lmi deliberately
diff --git a/compiler_gcc.make b/compiler_gcc.make
index 29921e33..e578fe4a 100644
--- a/compiler_gcc.make
+++ b/compiler_gcc.make
@@ -176,7 +176,11 @@ endif
# The gprof '-pg' flag is one example. Another is '-fPIC', which
# pc-linux-gnu requires for '-shared':
# https://gcc.gnu.org/onlinedocs/gcc/Link-Options.html#DOCF1
-# Yet another is 'debug_flag': the GNU Coding Standards
+# Yet another is 'debug_flag': including it in $(LDFLAGS) seems
+# to be historical practice, as seen in the GNU 'make' manual:
+# https://www.gnu.org/software/make/manual/make.html#Complex-Makefile
+# | LDFLAGS = -g
+# even though GNU 'ld' ignores '-g'; and the GNU Coding Standards
# https://www.gnu.org/prep/standards/html_node/Command-Variables.html
# suggest including flags such as '-g' in $(CFLAGS) because they
# are "not required for proper compilation", but lmi deliberately