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
--- 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"