Bug 931687: Use the -Gw flag on Windows builds for better linker optimizations. r=glandium
authorDavid Major <dmajor@mozilla.com>
Fri, 07 Oct 2016 08:31:24 -0500
changeset 422146 af534f12f8fee939e100f3b78b22dd712cecfbb4
parent 422145 6217f779742e62f225f2b9538fa82bc424a20a9f
child 422189 70758fd844ecca6f084414a52406dd58795d0715
push id31701
push userbmo:james@hoppipolla.co.uk
push dateFri, 07 Oct 2016 14:21:46 +0000
reviewersglandium
bugs931687
milestone52.0a1
Bug 931687: Use the -Gw flag on Windows builds for better linker optimizations. r=glandium
js/src/old-configure.in
old-configure.in
--- a/js/src/old-configure.in
+++ b/js/src/old-configure.in
@@ -745,16 +745,20 @@ case "$target" in
           if test -z `echo $CXXFLAGS | grep -i [-/]arch:` ; then
             CXXFLAGS="$CXXFLAGS -arch:SSE2"
           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"
         # 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
@@ -1090,16 +1090,20 @@ case "$target" in
         dnl on all architectures.
         if test -n "$CLANG_CL"; then
             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"
         # 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.