Bug 1456552 - Make Optimized MinGW builds use -O# instead of falling through and collecting a -O. r=ted, a=jcristau
authorTom Ritter <tom@mozilla.com>
Wed, 16 May 2018 16:32:47 -0500
changeset 802271 1b10610a4e89c4b138da6d3d8084ded81dad493e
parent 802270 9a546537d8bff630a1fbf876be55f9d599972955
child 802272 12bf945bd10987f92e8c57d0911895ab0cdb26c8
push id111850
push userbmo:tom@mozilla.com
push dateThu, 31 May 2018 16:41:37 +0000
reviewersted, jcristau
bugs1456552
milestone60.0.2
Bug 1456552 - Make Optimized MinGW builds use -O# instead of falling through and collecting a -O. r=ted, a=jcristau We use -O2 for js (because we can) and we use -O1 for the root because there is an x86 compiler bug that is not immediately bypassable MozReview-Commit-ID: CnDk2ko3jfo
js/src/old-configure.in
old-configure.in
--- a/js/src/old-configure.in
+++ b/js/src/old-configure.in
@@ -650,16 +650,18 @@ case "$target" in
         # Use static libgcc and libstdc++
         LDFLAGS="$LDFLAGS -static"
         # Use temp file for windres (bug 213281)
         RCFLAGS='-O coff --use-temp-file'
         # mingw doesn't require kernel32, user32, and advapi32 explicitly
         LIBS="$LIBS -lgdi32 -lwinmm -lwsock32"
         MOZ_FIX_LINK_PATHS=
 
+        MOZ_OPTIMIZE_FLAGS="-O2"
+
         WIN32_CONSOLE_EXE_LDFLAGS=-mconsole
         WIN32_GUI_EXE_LDFLAGS=-mwindows
     else
         TARGET_COMPILER_ABI=msvc
         HOST_CC='$(CC)'
         HOST_CXX='$(CXX)'
         if test "$AS_BIN"; then
             AS="$(basename "$AS_BIN")"
--- a/old-configure.in
+++ b/old-configure.in
@@ -865,16 +865,18 @@ case "$target" in
         # Use static libgcc and libstdc++
         LDFLAGS="$LDFLAGS -static"
         # Use temp file for windres (bug 213281)
         RCFLAGS='-O coff --use-temp-file'
         # mingw doesn't require kernel32, user32, and advapi32 explicitly
         LIBS="$LIBS -luuid -lgdi32 -lwinmm -lwsock32 -luserenv -lsecur32"
         MOZ_FIX_LINK_PATHS=
 
+        MOZ_OPTIMIZE_FLAGS="-O1"
+
         WIN32_CONSOLE_EXE_LDFLAGS=-mconsole
         WIN32_GUI_EXE_LDFLAGS=-mwindows
 
         # GCC/binutils can't link to a function if we try to include dllexport function
         # in the same library as dllimport caller. To work around it, we build NSPR
         # and NSS with -mnop-fun-dllimport flag. The drawback of this solution is that
         # function thunks need to be generated for cross-DLL calls.
         MOZ_FOLD_LIBS_FLAGS="-mnop-fun-dllimport"