Bug 1418398 - Always un-define _FORTIFY_SOURCE before defining it; r=glandium
authorGabriele Svelto <gsvelto@mozilla.com>
Mon, 20 Nov 2017 14:41:35 +0100
changeset 392801 6c027fdb55ddd50f91f95f83484634c6049f44e1
parent 392800 b184c87f760647359af35a6b4e839d6f9b0e4fcf
child 392802 67aa5b9539e8416d8335bd1b7800e9029c23d46c
push id97527
push usertoros@mozilla.com
push dateTue, 21 Nov 2017 10:20:05 +0000
treeherdermozilla-inbound@60d0f3ee0c43 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs1418398
milestone59.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1418398 - Always un-define _FORTIFY_SOURCE before defining it; r=glandium MozReview-Commit-ID: 6yN6kA0jQWg
js/src/old-configure.in
old-configure.in
--- a/js/src/old-configure.in
+++ b/js/src/old-configure.in
@@ -564,19 +564,19 @@ dnl In at least glibc-2.25, _FORTIFY_SOU
 dnl with optimization (Bug 1417452)
 
 dnl Note that in the top-level old-configure.in, we don't enable
 dnl FORTIFY_SOURCE on Android. But in js/ we *can* enable it on
 dnl Android, so we do.
 
 if test -n "$MOZ_OPTIMIZE"; then
    if test "$GNU_CC" -o -n "${CLANG_CC}${CLANG_CL}"; then
-      CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2"
-      CPPFLAGS="$CPPFLAGS -D_FORTIFY_SOURCE=2"
-      CXXFLAGS="$CXXFLAGS -D_FORTIFY_SOURCE=2"
+      CFLAGS="$CFLAGS -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2"
+      CPPFLAGS="$CPPFLAGS -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2"
+      CXXFLAGS="$CXXFLAGS -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2"
    fi
 fi
 
 dnl ========================================================
 dnl System overrides of the defaults for target
 dnl ========================================================
 
 case "$target" in
--- a/old-configure.in
+++ b/old-configure.in
@@ -513,19 +513,19 @@ if test -n "$MOZ_OPTIMIZE"; then
    if test "$GNU_CC" -o -n "${CLANG_CC}${CLANG_CL}"; then
       case $OS_TARGET in
          Android)
             dnl FORTIFY_SOURCE is not supported on Android on the
             dnl top-level old-configure.in at this time.
             dnl See Bug 1415595
             ;;
          *)
-            CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2"
-            CPPFLAGS="$CPPFLAGS -D_FORTIFY_SOURCE=2"
-            CXXFLAGS="$CXXFLAGS -D_FORTIFY_SOURCE=2"
+            CFLAGS="$CFLAGS -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2"
+            CPPFLAGS="$CPPFLAGS -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2"
+            CXXFLAGS="$CXXFLAGS -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2"
             ;;
       esac
    fi
 fi
 
 dnl ========================================================
 dnl GNU specific defaults
 dnl ========================================================