Bug 1440013 - For MinGW build, pass -Wa,-mbig-obj to solve 'too many sections' errors. r=glandium, a=jcristau
authorTom Ritter <tom@mozilla.com>
Tue, 06 Mar 2018 16:40:38 -0600
changeset 802185 b20aeb0746e7174522fec1f80a623adfb8b507eb
parent 802184 7aec8de1c9d5fb9b5d25481df1e38242f4df5ea6
child 802186 0e11f150a4821f0b8740eb30d151076a095f83e1
push id111850
push userbmo:tom@mozilla.com
push dateThu, 31 May 2018 16:41:37 +0000
reviewersglandium, jcristau
bugs1440013
milestone60.0.2
Bug 1440013 - For MinGW build, pass -Wa,-mbig-obj to solve 'too many sections' errors. r=glandium, a=jcristau MozReview-Commit-ID: 9ObJnrcpeKe
build/autoconf/compiler-opts.m4
--- a/build/autoconf/compiler-opts.m4
+++ b/build/autoconf/compiler-opts.m4
@@ -118,16 +118,22 @@ if test "$CLANG_CXX"; then
     ## from C.
     _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wno-unknown-warning-option -Wno-return-type-c-linkage"
 fi
 
 if test "$GNU_CC"; then
     if test -z "$DEVELOPER_OPTIONS"; then
         CFLAGS="$CFLAGS -ffunction-sections -fdata-sections"
         CXXFLAGS="$CXXFLAGS -ffunction-sections -fdata-sections"
+
+        # For MinGW, we need big-obj otherwise we create too many sections in Unified builds
+        if test "${OS_ARCH}" = "WINNT"; then
+            CFLAGS="$CFLAGS -Wa,-mbig-obj"
+            CXXFLAGS="$CXXFLAGS -Wa,-mbig-obj"
+        fi
     fi
     CFLAGS="$CFLAGS -fno-math-errno"
     CXXFLAGS="$CXXFLAGS -fno-exceptions -fno-math-errno"
 fi
 
 dnl ========================================================
 dnl = Identical Code Folding
 dnl ========================================================