From 82e5a56a889a62090ed1e20d2459743e29fb1295 Mon Sep 17 00:00:00 2001 From: David Major Date: Tue, 25 Oct 2016 10:04:35 -0500 Subject: [PATCH] Bug 1311211: Disable -Gw optimization when building for ASan on Windows. r=glandium --- js/src/old-configure.in | 7 +++++-- old-configure.in | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/js/src/old-configure.in b/js/src/old-configure.in index 825533838cfa..8ac599ea44e5 100644 --- a/js/src/old-configure.in +++ b/js/src/old-configure.in @@ -752,8 +752,11 @@ case "$target" in 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 diff --git a/old-configure.in b/old-configure.in index 26a4f0efeaee..66f5eaea2cce 100644 --- a/old-configure.in +++ b/old-configure.in @@ -1075,8 +1075,11 @@ case "$target" in 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