Bug 1456552 Make Optimized MinGW builds use -O# instead of falling through and collecting a -O r?Build draft
authorTom Ritter <tom@mozilla.com>
Wed, 16 May 2018 16:32:47 -0500
changeset 795985 40b3c4785851eafb3d9aefb558637673f59edd23
parent 795984 1714ec5959d43541c9883eee71af75ac664389ad
child 796177 cf646c80b9545db7ab548f88a482378734ee2f78
push id110143
push userbmo:tom@mozilla.com
push dateWed, 16 May 2018 21:35:40 +0000
reviewersBuild
bugs1456552
milestone60.0
Bug 1456552 Make Optimized MinGW builds use -O# instead of falling through and collecting a -O r?Build 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 -lusp10 -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 -lusp10 -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"