aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Biesinger <cbiesinger@google.com>2019-12-18 12:06:43 -0600
committerChristian Biesinger <cbiesinger@google.com>2020-01-09 16:31:00 -0600
commit5f23a08201ed01570b34f5cff99a95fc7b9e2fdb (patch)
treef8e8e39d6b99b61de452b92abcaeb7dabfdad540
parent3061113bf336048d538241282c39baf684de31bf (diff)
downloadgdb-5f23a08201ed01570b34f5cff99a95fc7b9e2fdb.zip
gdb-5f23a08201ed01570b34f5cff99a95fc7b9e2fdb.tar.gz
gdb-5f23a08201ed01570b34f5cff99a95fc7b9e2fdb.tar.bz2
Don't define _FORTIFY_SOURCE on MinGW
Recent MinGW versions require -lssp when using _FORTIFY_SOURCE, which gdb does (in common-defs.h) https://github.com/msys2/MINGW-packages/issues/5868#issuecomment-544107564 To avoid all the complications with checking for -lssp and making sure it's linked statically, just don't define it. gdb/ChangeLog: 2020-01-09 Christian Biesinger <cbiesinger@google.com> * gdbsupport/common-defs.h: Don't define _FORTIFY_SOURCE on MinGW. Change-Id: Ide6870ab57198219a2ef78bc675768a789ca2b1d
-rw-r--r--gdb/ChangeLog4
-rw-r--r--gdb/gdbsupport/common-defs.h8
2 files changed, 10 insertions, 2 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index d22a5e1..fc0656c 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,7 @@
+2020-01-09 Christian Biesinger <cbiesinger@google.com>
+
+ * gdbsupport/common-defs.h: Don't define _FORTIFY_SOURCE on MinGW.
+
2020-01-08 Simon Marchi <simon.marchi@efficios.com>
* thread.c (print_thread_info_1): Fix indentation.
diff --git a/gdb/gdbsupport/common-defs.h b/gdb/gdbsupport/common-defs.h
index 88b05ef..214bca1 100644
--- a/gdb/gdbsupport/common-defs.h
+++ b/gdb/gdbsupport/common-defs.h
@@ -66,9 +66,13 @@
plus this seems like a reasonable safety measure. The check for
optimization is required because _FORTIFY_SOURCE only works when
optimization is enabled. If _FORTIFY_SOURCE is already defined,
- then we don't do anything. */
+ then we don't do anything. Also, on MinGW, fortify requires
+ linking to -lssp, and to avoid the hassle of checking for
+ that and linking to it statically, we just don't define
+ _FORTIFY_SOURCE there. */
-#if !defined _FORTIFY_SOURCE && defined __OPTIMIZE__ && __OPTIMIZE__ > 0
+#if (!defined _FORTIFY_SOURCE && defined __OPTIMIZE__ && __OPTIMIZE__ > 0 \
+ && !defined(__MINGW32__))
#define _FORTIFY_SOURCE 2
#endif