[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master e4abb6e1 14/17: Don't specify nonempty $CFLAG
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master e4abb6e1 14/17: Don't specify nonempty $CFLAGS or $CXXFLAGS |
Date: |
Sat, 2 Jul 2022 21:42:15 -0400 (EDT) |
branch: master
commit e4abb6e1f94c84a24343689f625004609354c8a5
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>
Don't specify nonempty $CFLAGS or $CXXFLAGS
The GNU coding standards
https://www.gnu.org/prep/standards/html_node/Command-Variables.html
suggest specifying "CFLAGS = -g" in makefiles. Until now, lmi had
followed that rule (if not quite literally) by setting $CFLAGS and
$CXXFLAGS to a default value of '-ggdb'. Now, this makefile assigns
them no value, so that overriding them doesn't discard any default.
---
compiler_clang.make | 16 +++++++++++-----
compiler_gcc.make | 22 +++++++++++-----------
2 files changed, 22 insertions(+), 16 deletions(-)
diff --git a/compiler_clang.make b/compiler_clang.make
index 6154adca..17f4b469 100644
--- a/compiler_clang.make
+++ b/compiler_clang.make
@@ -116,8 +116,14 @@ endif
# Yet another is 'debug_flag': 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 supports
-# multiple build types that transcend that "proper" notion.
+# are "not required for proper compilation", but lmi deliberately
+# sets default debugging flags, of necessity: with gcc-3.4.5 at
+# least, the '-fno-var-tracking-assignments' debugging option was
+# required for compiling product files correctly. Furthermore, lmi
+# binary distributions are intended to be built with '-ggdb' so that
+# any errors reported by end users can reliably be reproduced using
+# debug builds. If it is desired to negate '-ggdb', the gcc manual
+# suggests that '-ggdb0' should do that.
c_l_flags = $(debug_flag) $(analyzer_flag)
@@ -132,6 +138,7 @@ endif
REQUIRED_COMPILER_FLAGS = \
$(c_l_flags) \
+ $(optimization_flag) \
-Woverriding-t-option \
-ffp-model=strict \
-ffp-exception-behavior=ignore \
@@ -143,14 +150,13 @@ REQUIRED_COMPILER_FLAGS = \
REQUIRED_CFLAGS = -std=c99 $(C_WARNINGS) $(REQUIRED_COMPILER_FLAGS)
-# Better to leave this unset, and specify optimization elsewhere?
-CFLAGS = $(optimization_flag)
+CFLAGS =
# C++ compiler flags.
REQUIRED_CXXFLAGS = -std=c++20 $(CXX_WARNINGS) $(REQUIRED_COMPILER_FLAGS)
-CXXFLAGS = $(optimization_flag)
+CXXFLAGS =
# Linker flags.
diff --git a/compiler_gcc.make b/compiler_gcc.make
index 946760b1..09413e28 100644
--- a/compiler_gcc.make
+++ b/compiler_gcc.make
@@ -161,13 +161,6 @@ product_file_sources := my_db.o my_fund.o my_prod.o
my_rnd.o my_tier.o
$(product_file_sources): debug_flag += -fno-var-tracking-assignments
$(product_file_sources): optimization_flag += -Os
-# $(optimization_flag) is part of the default $(CXXFLAGS), but a
-# target-specific assignment there isn't enough, because it is too
-# easily overridden by specifying $(CXXFLAGS) on the command line.
-# This flag overrides any such override:
-# Suppressed, and soon to be removed:
-#$(product_file_sources): tutelary_flag += $(product_file_flags)
-
################################################################################
# Compiler-and-linker flags.
@@ -179,8 +172,14 @@ $(product_file_sources): optimization_flag += -Os
# Yet another is 'debug_flag': 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 supports
-# multiple build types that transcend that "proper" notion.
+# are "not required for proper compilation", but lmi deliberately
+# sets default debugging flags, of necessity: with gcc-3.4.5 at
+# least, the '-fno-var-tracking-assignments' debugging option was
+# required for compiling product files correctly. Furthermore, lmi
+# binary distributions are intended to be built with '-ggdb' so that
+# any errors reported by end users can reliably be reproduced using
+# debug builds. If it is desired to negate '-ggdb', the gcc manual
+# suggests that '-ggdb0' should do that.
c_l_flags = $(debug_flag) $(analyzer_flag)
@@ -207,6 +206,7 @@ endif
REQUIRED_COMPILER_FLAGS = \
$(c_l_flags) \
+ $(optimization_flag) \
-frounding-math \
-fsignaling-nans \
-fno-ms-extensions \
@@ -215,13 +215,13 @@ REQUIRED_COMPILER_FLAGS = \
REQUIRED_CFLAGS = -std=c99 $(C_WARNINGS) $(REQUIRED_COMPILER_FLAGS)
-CFLAGS = $(optimization_flag)
+CFLAGS =
# C++ compiler flags.
REQUIRED_CXXFLAGS = -std=c++20 $(CXX_WARNINGS) $(REQUIRED_COMPILER_FLAGS)
-CXXFLAGS = $(optimization_flag)
+CXXFLAGS =
# Linker flags.
- [lmi-commits] [lmi] master 4d58421b 05/17: Increase concinnity, (continued)
- [lmi-commits] [lmi] master 4d58421b 05/17: Increase concinnity, Greg Chicares, 2022/07/02
- [lmi-commits] [lmi] master 8429817f 04/17: Increase concinnity, Greg Chicares, 2022/07/02
- [lmi-commits] [lmi] master 1018709f 07/17: Move a warning option to its proper place, Greg Chicares, 2022/07/02
- [lmi-commits] [lmi] master f708d833 12/17: Override flags for product files more appropriately, Greg Chicares, 2022/07/02
- [lmi-commits] [lmi] master acfa77b0 08/17: Simplify, Greg Chicares, 2022/07/02
- [lmi-commits] [lmi] master 6896ec57 03/17: Explain uniformly why pointer-{compare, subtract} aren't used, Greg Chicares, 2022/07/02
- [lmi-commits] [lmi] master 05ef210f 01/17: Remove obsolete '.patch' files, Greg Chicares, 2022/07/02
- [lmi-commits] [lmi] master be64abf0 11/17: Establish general compiler flags earlier, Greg Chicares, 2022/07/02
- [lmi-commits] [lmi] master 0e3c2fbb 02/17: Don't let makefiles end in an empty line, Greg Chicares, 2022/07/02
- [lmi-commits] [lmi] master adcaef29 06/17: Establish a framework for clang warnings, Greg Chicares, 2022/07/02
- [lmi-commits] [lmi] master e4abb6e1 14/17: Don't specify nonempty $CFLAGS or $CXXFLAGS,
Greg Chicares <=
- [lmi-commits] [lmi] master ec379f81 17/17: Use an updated XRC schema, Greg Chicares, 2022/07/02
- [lmi-commits] [lmi] master 89e37e40 13/17: Resolve a latent makefile issue, Greg Chicares, 2022/07/02
- [lmi-commits] [lmi] master 5971b763 09/17: Use $(tutelary_flag) to work around compiler breakage, Greg Chicares, 2022/07/02
- [lmi-commits] [lmi] master 8ece241a 10/17: Fix defect introduced 20190327T2239Z: incomplete override, Greg Chicares, 2022/07/02
- [lmi-commits] [lmi] master 9a5cf902 16/17: Repeat '-fno-omit-frame-pointer' less often, Greg Chicares, 2022/07/02
- [lmi-commits] [lmi] master 1368400b 15/17: Deactivate old workarounds for product-file generation, Greg Chicares, 2022/07/02