]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Undefine _FORTIFY_SOURCE before defining it.
authorNick Mathewson <nickm@torproject.org>
Wed, 11 May 2016 16:15:37 +0000 (12:15 -0400)
committerNick Mathewson <nickm@torproject.org>
Wed, 11 May 2016 16:15:37 +0000 (12:15 -0400)
This makes our compilation options checks in autoconf work better on
systems that already define _FORTIFY_SOURCE.

Fixes at least one case of bug 18841; bugfix on 0.2.3.17-beta. Patch
from "trudokal".

changes/bug18841.1 [new file with mode: 0644]
configure.ac

diff --git a/changes/bug18841.1 b/changes/bug18841.1
new file mode 100644 (file)
index 0000000..205ee5a
--- /dev/null
@@ -0,0 +1,7 @@
+  o Major bugfixes (compilation):
+    - Correctly detect compiler flags on systems where _FORTIFY_SOURCE
+      is predefined. Previously, our use of -D_FORTIFY_SOURCE would
+      cause a compiler warning, thereby making other checks fail.
+      Fixes one case of bug 18841; bugfix on 0.2.3.17-beta. Patch from
+      "trudokal".
+
index 29ba2fd6ce93f3151c53f8520f8277bb28f3b29e..2116b41fd57e17ce5f4c7697af59017aece9e29b 100644 (file)
@@ -623,7 +623,7 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [
 #endif])], have_clang=yes, have_clang=no)
 
 if test x$enable_gcc_hardening != xno; then
-    CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2"
+    CFLAGS="$CFLAGS -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2"
     if test x$have_clang = xyes; then
         TOR_CHECK_CFLAGS(-Qunused-arguments)
     fi