diff --git a/build/autoconf/compiler-opts.m4 b/build/autoconf/compiler-opts.m4 index 3d9dc5a80032..b8ff219aa5d2 100644 --- a/build/autoconf/compiler-opts.m4 +++ b/build/autoconf/compiler-opts.m4 @@ -123,6 +123,12 @@ 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"