Bug 1311211: Disable -Gw optimization when building for ASan on Windows. r=glandium
authorDavid Major <dmajor@mozilla.com>
Tue, 25 Oct 2016 10:04:35 -0500
changeset 429294 82104756f2c2d88f83ee3dd51d0d2abaafcf778e
parent 429293 a01b000c7f67c8cc756fcc289e7caf93ffeb10d2
child 429295 98343e1b6c67f849e62972a6831ad08ddfab5024
child 429300 cd507936d184dd5b8fc71ac52f39b6015e88bbc9
child 429310 892fb30ee12e139d50fa1fc8653b09e375b22609
push id33524
push userbmo:tchiovoloni@mozilla.com
push dateTue, 25 Oct 2016 15:16:38 +0000
reviewersglandium
bugs1311211
milestone52.0a1
Bug 1311211: Disable -Gw optimization when building for ASan on Windows. r=glandium
js/src/old-configure.in
old-configure.in
--- a/js/src/old-configure.in
+++ b/js/src/old-configure.in
@@ -747,18 +747,21 @@ case "$target" in
           fi
         fi
         dnl VS2013+ requires -FS when parallel building by make -jN.
         dnl If nothing, compiler sometimes causes C1041 error.
         CFLAGS="$CFLAGS -FS"
         CXXFLAGS="$CXXFLAGS -FS"
         dnl VS2013+ supports -Gw for better linker optimizations.
         dnl http://blogs.msdn.com/b/vcblog/archive/2013/09/11/introducing-gw-compiler-switch.aspx
-        CFLAGS="$CFLAGS -Gw"
-        CXXFLAGS="$CXXFLAGS -Gw"
+        dnl Disabled on ASan because it causes false-positive ODR violations.
+        if test -z "$MOZ_ASAN"; then
+            CFLAGS="$CFLAGS -Gw"
+            CXXFLAGS="$CXXFLAGS -Gw"
+        fi
         # khuey says we can safely ignore MSVC warning C4251
         # MSVC warning C4244 (implicit type conversion may lose data) warns
         # and requires workarounds for perfectly valid code.  Also, GCC/clang
         # don't warn about it by default. So for consistency/sanity, we turn
         # it off on MSVC, too.
         # MSVC warning C4267 warns for narrowing type conversions from size_t
         # to 32-bit integer types on 64-bit platforms.  Since this is virtually
         # the same thing as C4244, we disable C4267, too.
--- a/old-configure.in
+++ b/old-configure.in
@@ -1070,18 +1070,21 @@ case "$target" in
             SSSE3_FLAGS="-mssse3"
         fi
         dnl VS2013+ requires -FS when parallel building by make -jN.
         dnl If nothing, compiler sometimes causes C1041 error.
         CFLAGS="$CFLAGS -FS"
         CXXFLAGS="$CXXFLAGS -FS"
         dnl VS2013+ supports -Gw for better linker optimizations.
         dnl http://blogs.msdn.com/b/vcblog/archive/2013/09/11/introducing-gw-compiler-switch.aspx
-        CFLAGS="$CFLAGS -Gw"
-        CXXFLAGS="$CXXFLAGS -Gw"
+        dnl Disabled on ASan because it causes false-positive ODR violations.
+        if test -z "$MOZ_ASAN"; then
+            CFLAGS="$CFLAGS -Gw"
+            CXXFLAGS="$CXXFLAGS -Gw"
+        fi
         # khuey says we can safely ignore MSVC warning C4251
         # MSVC warning C4244 (implicit type conversion may lose data) warns
         # and requires workarounds for perfectly valid code.  Also, GCC/clang
         # don't warn about it by default. So for consistency/sanity, we turn
         # it off on MSVC, too.
         # MSVC warning C4267 warns for narrowing type conversions from size_t
         # to 32-bit integer types on 64-bit platforms.  Since this is virtually
         # the same thing as C4244, we disable C4267, too.