lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master 5971b763 09/17: Use $(tutelary_flag) to work


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 5971b763 09/17: Use $(tutelary_flag) to work around compiler breakage
Date: Sat, 2 Jul 2022 21:42:14 -0400 (EDT)

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

    Use $(tutelary_flag) to work around compiler breakage
    
    '-fno-omit-frame-pointer' should always be specified in optimization
    flags. When the pernicious '-fomit-frame-pointer' default must be used,
    that's an extraordinary circumstance that calls for $(tutelary_flag).
    That's what has been done for years, and isn't changed here now.
    
    Moved this exceptional condition up to the original definition of
    $(tutelary_flag), for clarity.
---
 compiler_gcc.make | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/compiler_gcc.make b/compiler_gcc.make
index 1a1b78ae..8897849d 100644
--- a/compiler_gcc.make
+++ b/compiler_gcc.make
@@ -71,6 +71,20 @@ endif
 
 tutelary_flag :=
 
+# MinGW-w64's SEH defectively requires '-fomit-frame-pointer' until
+# gcc-10.2.1 (but as of 20220701 debian provides 10.0.0 only). See:
+#   https://lists.nongnu.org/archive/html/lmi/2019-03/msg00026.html
+#   https://lists.nongnu.org/archive/html/lmi/2020-12/msg00000.html
+#   https://lists.nongnu.org/archive/html/lmi/2020-12/msg00002.html
+#   https://lists.nongnu.org/archive/html/lmi/2021-03/msg00000.html
+#   https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99234
+
+ifneq (,$(filter $(gcc_version), 10 10.0))
+  ifeq (x86_64-w64-mingw32,$(findstring x86_64-w64-mingw32,$(LMI_TRIPLET)))
+    tutelary_flag := -fomit-frame-pointer
+  endif
+endif
+
 # Build type governs
 #  - optimization flags
 #  - gprof
@@ -106,20 +120,6 @@ else
   optimization_flag := -O2 -fno-omit-frame-pointer
 endif
 
-ifneq (,$(filter $(gcc_version), 10 10.0))
-  ifeq (x86_64-w64-mingw32,$(findstring x86_64-w64-mingw32,$(LMI_TRIPLET)))
-# See:
-#   https://lists.nongnu.org/archive/html/lmi/2019-03/msg00026.html
-#   https://lists.nongnu.org/archive/html/lmi/2020-12/msg00000.html
-#   https://lists.nongnu.org/archive/html/lmi/2020-12/msg00002.html
-#   https://lists.nongnu.org/archive/html/lmi/2021-03/msg00000.html
-#   https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99234
-# Fixed in gcc-10.2.1, but this makefile doesn't detect the last
-# component of major.minor.patchlevel reliably.
-    tutelary_flag := -fomit-frame-pointer
-  endif
-endif
-
 # An overriding version of 'my_prod.cpp', which is used to create a
 # nondistributable binary, contains so many large strings that, after
 # consuming more than one CPU minute and 1 MiB of RAM, MinGW gcc-3.4.5



reply via email to

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