If you get some ideas from my project, please quote with
pcxfirefox, and this is my greatest reward. Many thanks.
This wiki page tells you some steps and tips to build Mozilla Product using Intel C/C++ Compiler.
The compiler and SDKs which I use are below.
Mozilla-build
官方链接
Visual C/C++ Compiler
Microsoft Visual Studio 2010 SP1
Windows SDK
Microsoft Windows SDK for Windows 7 and .NET Framework 4
DirectX SDK
Microsoft DirectX SDK (June 2010)
Intel C/C++ Compiler
12 update 10/13 beta update1
The patch is similar to it below.
--- start-msvc10.bat Wed Jan 4 01:31:23 2012 +++ start-msvc10.bat Wed Jan 4 01:32:29 2012 @@ -83,6 +83,17 @@ ) ) +call "D:\Program Files (x86)\Intel\Composer XE 2013\bin\ipsxe-comp-vars.bat" ia32 vs2010 +set CC=icl +set CXX=icl +set CC_VERSION=13.0.0.041 +set CXX_VERSION=13.0.0.041 +set LD=xilink +set AR=xilib -NOLOGO -OUT:"$@" + cd "%USERPROFILE%" "%MOZILLABUILD%\msys\bin\bash" --login -i
Of cource, you can create new file called start-icc.bat analogously.
X64 build bat is similar.
Put .mozconfig on the source code tree's Top-level directory.
. $topsrcdir/browser/config/mozconfig ac_add_options --enable-application=browser mk_add_options MOZ_MAKE_FLAGS=-j1 mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/../obju-icc # for 64-bit build #ac_add_options --target=x86_64-pc-mingw32 #ac_add_options --host=x86_64-pc-mingw32 export MOZ_OPTIMIZE_LDFLAGS="-opt:ref,icf -LARGEADDRESSAWARE" mk_add_options MOZ_OPTIMIZE_LDFLAGS="-opt:ref,icf -LARGEADDRESSAWARE" # for 64-bit build #export MOZ_OPTIMIZE_LDFLAGS="-MACHINE:X64 -OPT:REF,ICF" #mk_add_options MOZ_OPTIMIZE_LDFLAGS="-MACHINE:X64 -OPT:REF,ICF" ac_add_options --disable-auto-deps ac_add_options --disable-tests ac_add_options --disable-ipdl-tests ac_add_options --enable-installer #ac_add_options --with-branding=browser/branding/aurora ac_add_options --enable-official-branding ac_add_options --enable-extensions=default ac_add_options --enable-strip ac_add_options --enable-install-strip # for Athlon 64/Pentium 4/ # for X86 ac_add_options --enable-optimize="-O2 -fp:precise -arch:SSE2" # for X64 #ac_add_options --enable-optimize="-O2 -fp:precise -arch:SSE2" # diasble updater ac_add_options --disable-updater ac_add_options --disable-update-channel ac_add_options --disable-update-packaging # diasble crashreporter ac_add_options --disable-crashreporter # Enable jemalloc ac_add_options --enable-jemalloc # enable shared js ac_add_options --enable-shared-js # for debug ac_add_options --enable-debugger-info-modules=yes ac_add_options --enable-debugger-info-modules ac_add_options --enable-debug-symbols ac_add_options --disable-activex ac_add_options --disable-activex-scripting ac_add_options --enable-crypto ac_add_options --enable-image-decoders=icon,png,gif,jpeg,bmp #ac_add_options --enable-chrome-format=jar ac_add_options --disable-mochitest ac_add_options --disable-mochitests ac_add_options --disable-accessibility ac_add_options --disable-parental-controls ac_add_options --disable-windows-mobile-components ac_add_options --disable-maintenance-service # windows version ac_add_options --with-windows-version=601 # crt dir WIN32_REDIST_DIR=$VCINSTALLDIR/redist/x86/Microsoft.VC100.CRT # for X64 #WIN32_REDIST_DIR=$VCINSTALLDIR/redist/x64/Microsoft.VC100.CRT
diff -ruNa mozilla-beta-vc/config/autoconf.mk.in mozilla-beta/config/autoconf.mk.in --- mozilla-beta-vc/config/autoconf.mk.in Thu May 24 02:56:34 2012 +++ mozilla-beta/config/autoconf.mk.in Mon May 28 14:54:51 2012 @@ -351,8 +351,8 @@ MOZ_EGL_XRENDER_COMPOSITE = @MOZ_EGL_XRENDER_COMPOSITE@ WIN_TOP_SRC = @WIN_TOP_SRC@ -AR = @AR@ -AR_FLAGS = @AR_FLAGS@ +AR = xilib +AR_FLAGS = -NOLOGO -OUT:"$@" AR_EXTRACT = @AR_EXTRACT@ AR_LIST = @AR_LIST@ AR_DELETE = @AR_DELETE@ @@ -412,8 +412,8 @@ HOST_LDFLAGS = @HOST_LDFLAGS@ HOST_OPTIMIZE_FLAGS = @HOST_OPTIMIZE_FLAGS@ HOST_NSPR_MDCPUCFG = @HOST_NSPR_MDCPUCFG@ -HOST_AR = @HOST_AR@ -HOST_AR_FLAGS = @HOST_AR_FLAGS@ +HOST_AR = xilib +HOST_AR_FLAGS = -NOLOGO -OUT:"$@" HOST_LD = @HOST_LD@ HOST_RANLIB = @HOST_RANLIB@ HOST_BIN_SUFFIX = @HOST_BIN_SUFFIX@ diff -ruNa mozilla-beta-vc/configure mozilla-beta/configure --- mozilla-beta-vc/configure Thu May 24 02:57:50 2012 +++ mozilla-beta/configure Thu May 31 02:47:58 2012 @@ -34,6 +34,10 @@ msyshost=1 fi +export CC=icl +export CXX=icl +export AR='xilib -NOLOGO -OUT:"$@"' +export LD=xilink # Read the user's .mozconfig script. We can't do this in # configure.in: autoconf puts the argument parsing code above anything @@ -3628,8 +3632,8 @@ #define _CRT_NONSTDC_NO_WARNINGS 1 EOF - elif test "$_CC_MAJOR_VERSION" = "17"; then - _CC_SUITE=11 + elif test "$_CC_MAJOR_VERSION" = "13"; then + _CC_SUITE=10 cat >> confdefs.h <<\EOF #define _CRT_SECURE_NO_WARNINGS 1 EOF @@ -7455,7 +7459,7 @@ fi HOST_CFLAGS="$HOST_CFLAGS -DXP_WIN32 -DXP_WIN -DWIN32 -D_WIN32 -DNO_X11 -D_CRT_SECURE_NO_WARNINGS" HOST_NSPR_MDCPUCFG='\"md/_winnt.cfg\"' - HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}" + HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O3}" HOST_BIN_SUFFIX=.exe case "$host" in *mingw*) diff -ruNa mozilla-beta-vc/js/src/config/autoconf.mk.in mozilla-beta/js/src/config/autoconf.mk.in --- mozilla-beta-vc/js/src/config/autoconf.mk.in Thu May 24 02:56:46 2012 +++ mozilla-beta/js/src/config/autoconf.mk.in Mon May 28 15:04:19 2012 @@ -157,8 +157,8 @@ PROFILE_USE_LDFLAGS = @PROFILE_USE_LDFLAGS@ WIN_TOP_SRC = @WIN_TOP_SRC@ -AR = @AR@ -AR_FLAGS = @AR_FLAGS@ +AR = xilib +AR_FLAGS = -NOLOGO -OUT:"$@" AR_EXTRACT = @AR_EXTRACT@ AR_LIST = @AR_LIST@ AR_DELETE = @AR_DELETE@ @@ -211,8 +211,8 @@ HOST_LDFLAGS = @HOST_LDFLAGS@ HOST_OPTIMIZE_FLAGS = @HOST_OPTIMIZE_FLAGS@ HOST_NSPR_MDCPUCFG = @HOST_NSPR_MDCPUCFG@ -HOST_AR = @HOST_AR@ -HOST_AR_FLAGS = @HOST_AR_FLAGS@ +HOST_AR = xilib +HOST_AR_FLAGS = -NOLOGO -OUT:"$@" HOST_LD = @HOST_LD@ HOST_RANLIB = @HOST_RANLIB@ HOST_BIN_SUFFIX = @HOST_BIN_SUFFIX@ diff -ruNa mozilla-beta-vc/js/src/configure mozilla-beta/js/src/configure --- mozilla-beta-vc/js/src/configure Thu May 24 02:57:50 2012 +++ mozilla-beta/js/src/configure Thu May 31 02:48:17 2012 @@ -34,6 +34,11 @@ msyshost=1 fi +export CC=icl +export CXX=icl +export AR='xilib -NOLOGO -OUT:"$@"' +export LD=xilink + # Guess values for system-dependent variables and create Makefiles. # Generated automatically using autoconf version 2.13 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. @@ -3317,8 +3322,8 @@ #define _CRT_NONSTDC_NO_WARNINGS 1 EOF - elif test "$_CC_MAJOR_VERSION" = "17"; then - _CC_SUITE=11 + elif test "$_CC_MAJOR_VERSION" = "13"; then + _CC_SUITE=10 cat >> confdefs.h <<\EOF #define _CRT_SECURE_NO_WARNINGS 1 EOF @@ -6692,7 +6697,7 @@ fi HOST_CFLAGS="$HOST_CFLAGS -DXP_WIN32 -DXP_WIN -DWIN32 -D_WIN32 -DNO_X11 -D_CRT_SECURE_NO_WARNINGS" HOST_NSPR_MDCPUCFG='\"md/_winnt.cfg\"' - HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}" + HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O3}" HOST_BIN_SUFFIX=.exe case "$host" in *mingw*) diff -ruNa mozilla-beta-vc/js/src/ctypes/libffi/Makefile.in mozilla-beta/js/src/ctypes/libffi/Makefile.in --- mozilla-beta-vc/js/src/ctypes/libffi/Makefile.in Thu May 24 02:56:46 2012 +++ mozilla-beta/js/src/ctypes/libffi/Makefile.in Mon May 28 15:06:32 2012 @@ -66,7 +66,7 @@ # MSVC, it can link against the debug CRT. @FFI_DEBUG_TRUE@am__append_27 = -DFFI_DEBUG # Build opt. -@FFI_DEBUG_FALSE@am__append_28 = -O2 +@FFI_DEBUG_FALSE@am__append_28 = -O3 subdir = . DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/doc/stamp-vti \ diff -ruNa mozilla-beta-vc/js/src/ctypes/libffi/aclocal.m4 mozilla-beta/js/src/ctypes/libffi/aclocal.m4 --- mozilla-beta-vc/js/src/ctypes/libffi/aclocal.m4 Thu May 24 02:56:46 2012 +++ mozilla-beta/js/src/ctypes/libffi/aclocal.m4 Mon May 28 16:50:43 2012 @@ -4707,7 +4707,7 @@ # The linker will automatically build a .lib file if we build a DLL. _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. - _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' + _LT_TAGVAR(old_archive_cmds, $1)='xilib -OUT:$oldlib$oldobjs$old_deplibs' _LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; diff -ruNa mozilla-beta-vc/js/src/ctypes/libffi/configure mozilla-beta/js/src/ctypes/libffi/configure --- mozilla-beta-vc/js/src/ctypes/libffi/configure Thu May 24 02:56:46 2012 +++ mozilla-beta/js/src/ctypes/libffi/configure Mon May 28 16:50:10 2012 @@ -17,6 +17,12 @@ ## -------------------- ## # Be more Bourne compatible + +export CC=icl +export CXX=icl +export AR='xilib -NOLOGO -OUT:"$@"' +export LD=xilink + DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh @@ -8908,7 +8914,7 @@ # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. - old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' + old_archive_cmds='xilib -OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path='' enable_shared_with_static_runtimes=yes ;; diff -ruNa mozilla-beta-vc/js/src/ctypes/libffi/m4/libtool.m4 mozilla-beta/js/src/ctypes/libffi/m4/libtool.m4 --- mozilla-beta-vc/js/src/ctypes/libffi/m4/libtool.m4 Thu May 24 02:56:46 2012 +++ mozilla-beta/js/src/ctypes/libffi/m4/libtool.m4 Mon May 28 16:50:28 2012 @@ -4692,7 +4692,7 @@ # The linker will automatically build a .lib file if we build a DLL. _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. - _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' + _LT_TAGVAR(old_archive_cmds, $1)='xilib -OUT:$oldlib$oldobjs$old_deplibs' _LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; diff -ruNa mozilla-beta-vc/js/src/ctypes/libffi/msvcc.sh mozilla-beta/js/src/ctypes/libffi/msvcc.sh --- mozilla-beta-vc/js/src/ctypes/libffi/msvcc.sh Thu May 24 02:56:46 2012 +++ mozilla-beta/js/src/ctypes/libffi/msvcc.sh Mon May 28 15:07:43 2012 @@ -44,7 +44,7 @@ args="-nologo -W3" md=-MD -cl="cl" +cl="icl" ml="ml" safeseh="-safeseh" output= @@ -62,7 +62,7 @@ shift 1 ;; -m64) - cl="cl" # "$MSVC/x86_amd64/cl" + cl="icl" # "$MSVC/x86_amd64/cl" ml="ml64" # "$MSVC/x86_amd64/ml64" safeseh= shift 1 diff -ruNa mozilla-beta-vc/nsprpub/config/autoconf.mk.in mozilla-beta/nsprpub/config/autoconf.mk.in --- mozilla-beta-vc/nsprpub/config/autoconf.mk.in Thu May 24 02:57:04 2012 +++ mozilla-beta/nsprpub/config/autoconf.mk.in Mon May 28 16:34:49 2012 @@ -56,14 +56,14 @@ AS = @AS@ ASFLAGS = @ASFLAGS@ -CC = @CC@ -CCC = @CXX@ +CC = icl +CCC = icl NS_USE_GCC = @GNU_CC@ GCC_USE_GNU_LD = @GCC_USE_GNU_LD@ MSC_VER = @MSC_VER@ -AR = @AR@ +AR = xilib -NOLOGO -OUT:"$@" AR_FLAGS = @AR_FLAGS@ -LD = @LD@ +LD = xilink RANLIB = @RANLIB@ PERL = @PERL@ RC = @RC@ diff -ruNa mozilla-beta-vc/nsprpub/configure mozilla-beta/nsprpub/configure --- mozilla-beta-vc/nsprpub/configure Thu May 24 02:57:04 2012 +++ mozilla-beta/nsprpub/configure Mon May 28 15:11:16 2012 @@ -7,6 +7,11 @@ # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. +export CC=icl +export CXX=icl +export AR='xilib -NOLOGO -OUT:"$@"' +export LD=xilink + # Defaults: ac_help= ac_default_prefix=/usr/local diff -ruNa mozilla-beta-vc/nsprpub/pr/src/misc/Makefile.in mozilla-beta/nsprpub/pr/src/misc/Makefile.in --- mozilla-beta-vc/nsprpub/pr/src/misc/Makefile.in Thu May 24 02:57:04 2012 +++ mozilla-beta/nsprpub/pr/src/misc/Makefile.in Mon May 28 15:12:06 2012 @@ -109,4 +109,5 @@ export:: $(TARGETS) - +CFLAGS += -fp:precise -Qfast_transcendentals +CXXFLAGS += -fp:precise -Qfast_transcendentals + +$(OBJDIR)/prdtoa.$(OBJ_SUFFIX): prdtoa.c + @$(MAKE_OBJDIR) + $(CC) -Fo$@ -c $(CFLAGS:MD=MT) $(call pr_abspath,$<) diff -ruNa mozilla-beta-vc/security/coreconf/WIN32.mk mozilla-beta/security/coreconf/WIN32.mk --- mozilla-beta-vc/security/coreconf/WIN32.mk Thu May 24 02:57:04 2012 +++ mozilla-beta/security/coreconf/WIN32.mk Mon May 28 16:36:21 2012 @@ -40,7 +40,7 @@ # and Windows 95 # -DEFAULT_COMPILER = cl +DEFAULT_COMPILER = icl ifdef NS_USE_GCC CC = gcc @@ -53,10 +53,10 @@ RC = windres.exe -O coff --use-temp-file LINK_DLL = $(CC) $(OS_DLLFLAGS) $(DLLFLAGS) else - CC = cl - CCC = cl - LINK = link - AR = lib + CC = icl + CCC = icl + LINK = xilink + AR = xilib AR += -NOLOGO -OUT:"$@" RANLIB = echo BSDECHO = echo @@ -157,9 +157,9 @@ ifdef BUILD_OPT OS_CFLAGS += -MD ifeq (11,$(ALLOW_OPT_CODE_SIZE)$(OPT_CODE_SIZE)) - OPTIMIZER += -O1 + OPTIMIZER += -O2 else - OPTIMIZER += -O2 + OPTIMIZER += -O2 endif DEFINES += -UDEBUG -U_DEBUG -DNDEBUG DLLFLAGS += -OUT:"$@" diff -ruNa mozilla-beta-vc/security/nss/lib/freebl/Makefile mozilla-beta/security/nss/lib/freebl/Makefile --- mozilla-beta-vc/security/nss/lib/freebl/Makefile Thu May 24 02:57:04 2012 +++ mozilla-beta/security/nss/lib/freebl/Makefile Mon May 28 15:17:12 2012 @@ -167,13 +167,13 @@ DEFINES += -DMP_ASSEMBLY_MULTIPLY -DMP_ASSEMBLY_SQUARE DEFINES += -DMP_ASSEMBLY_DIV_2DX1D -DMP_USE_UINT_DIGIT -DMP_NO_MP_WORD ifdef BUILD_OPT - OPTIMIZER += -Ox # maximum optimization for freebl + OPTIMIZER += -O2 # maximum optimization for freebl endif endif else # -DMP_NO_MP_WORD ifdef BUILD_OPT - OPTIMIZER += -Ox # maximum optimization for freebl + OPTIMIZER += -O2 # maximum optimization for freebl endif ASFILES = arcfour-amd64-masm.asm mpi_amd64_masm.asm mp_comba_amd64_masm.asm DEFINES += -DNSS_BEVAND_ARCFOUR -DMPI_AMD64 -DMP_ASSEMBLY_MULTIPLY diff -ruNa mozilla-beta-vc/xpcom/reflect/xptcall/src/md/win32/Makefile.in mozilla-beta/xpcom/reflect/xptcall/src/md/win32/Makefile.in --- mozilla-beta-vc/xpcom/reflect/xptcall/src/md/win32/Makefile.in Thu May 24 02:57:12 2012 +++ mozilla-beta/xpcom/reflect/xptcall/src/md/win32/Makefile.in Mon May 28 15:20:12 2012 @@ -56,7 +56,7 @@ ifndef GNU_CXX # FIXME: bug 413019 -OS_COMPILE_CXXFLAGS += -GL- +OS_COMPILE_CXXFLAGS += CPPSRCS := xptcinvoke.cpp xptcstubs.cpp else #!GNU_CXX CPPSRCS := xptcinvoke_x86_gnu.cpp xptcstubs.cpp
Intel Compiler uses -fp:fast by default, if you don't use -fp:precise, then must use the similar patches below:
diff -ruNa mozilla-beta-vc/content/Makefile.in mozilla-beta/content/Makefile.in --- mozilla-beta-vc/content/Makefile.in Thu May 24 02:56:34 2012 +++ mozilla-beta/content/Makefile.in Mon May 28 15:00:25 2012 @@ -67,3 +67,6 @@ endif # WINNT include $(topsrcdir)/config/rules.mk + +CFLAGS += -fp:precise +CXXFLAGS += -fp:precise diff -ruNa mozilla-beta-vc/ipc/app/Makefile.in mozilla-beta/ipc/app/Makefile.in --- mozilla-beta-vc/ipc/app/Makefile.in Thu May 24 02:56:46 2012 +++ mozilla-beta/ipc/app/Makefile.in Mon May 28 15:02:26 2012 @@ -130,3 +130,6 @@ $(NSINSTALL) $(PROGRAM) $(DIST)/bin/$(PROGRAM).app/Contents/MacOS rm -f $(DIST)/bin/$(PROGRAM) endif + +CFLAGS += -fp:precise +CXXFLAGS += -fp:precise diff -ruNa mozilla-beta-vc/js/src/Makefile.in mozilla-beta/js/src/Makefile.in --- mozilla-beta-vc/js/src/Makefile.in Thu May 24 02:56:46 2012 +++ mozilla-beta/js/src/Makefile.in Mon May 28 15:03:00 2012 @@ -919,3 +919,5 @@ # END kludges for the Nitro assembler ############################################### +CFLAGS += -fp:precise +CXXFLAGS += -fp:precise diff -ruNa mozilla-beta-vc/memory/jemalloc/Makefile.in mozilla-beta/memory/jemalloc/Makefile.in --- mozilla-beta-vc/memory/jemalloc/Makefile.in Thu May 24 02:56:58 2012 +++ mozilla-beta/memory/jemalloc/Makefile.in Mon May 28 15:27:45 2012 @@ -67,3 +67,6 @@ endif include $(topsrcdir)/config/rules.mk + +CFLAGS += -fp:precise +CXXFLAGS += -fp:precise diff -ruNa mozilla-beta-vc/nsprpub/pr/src/misc/Makefile.in mozilla-beta/nsprpub/pr/src/misc/Makefile.in --- mozilla-beta-vc/nsprpub/pr/src/misc/Makefile.in Thu May 24 02:57:04 2012 +++ mozilla-beta/nsprpub/pr/src/misc/Makefile.in Mon May 28 15:12:06 2012 @@ -109,4 +109,5 @@ export:: $(TARGETS) - +CFLAGS += -fp:precise +CXXFLAGS += -fp:precise diff -ruNa mozilla-beta-vc/security/nss/lib/sqlite/Makefile mozilla-beta/security/nss/lib/sqlite/Makefile --- mozilla-beta-vc/security/nss/lib/sqlite/Makefile Thu May 24 02:57:06 2012 +++ mozilla-beta/security/nss/lib/sqlite/Makefile Mon May 28 15:19:05 2012 @@ -78,3 +78,5 @@ export:: private_export +CFLAGS += -fp:precise +CXXFLAGS += -fp:precise
If you use ICC 13 beta update1, then apply the similar patches below:
Solve ICC IPO bug.
diff -ruNa mozilla-beta-vc/js/src/Makefile.in mozilla-beta/js/src/Makefile.in --- mozilla-beta-vc/js/src/Makefile.in Thu May 24 02:56:46 2012 +++ mozilla-beta/js/src/Makefile.in Mon May 28 15:03:00 2012 @@ -919,3 +919,5 @@ # END kludges for the Nitro assembler ############################################### + +MethodJIT.$(OBJ_SUFFIX): MethodJIT.cpp $(GLOBAL_DEPS) + $(REPORT_BUILD) + @$(MAKE_DEPS_AUTO_CXX) + $(ELOG) $(CCC) $(OUTOPTION)$@ -c $(COMPILE_CXXFLAGS) -Qipo- $(_VPATH_SRCS)
Solve WebGL modules crash, overide some source code building using VC, because icc is normal only using -Od here.
diff -ruNa mozilla-beta-vc/gfx/angle/Makefile.in mozilla-beta/gfx/angle/Makefile.in --- mozilla-beta-vc/gfx/angle/Makefile.in Thu May 24 02:56:42 2012 +++ mozilla-beta/gfx/angle/Makefile.in Thu May 31 02:50:58 2012 @@ -153,3 +153,13 @@ # upstream at some point. CXXFLAGS := $(filter-out -pedantic,$(CXXFLAGS)) CFLAGS := $(filter-out -pedantic,$(CFLAGS)) + +intermOut.$(OBJ_SUFFIX): intermOut.cpp $(GLOBAL_DEPS) + $(REPORT_BUILD) + @$(MAKE_DEPS_AUTO_CXX) + $(ELOG) $(CCC:icl=cl) $(OUTOPTION)$@ -c $(COMPILE_CXXFLAGS:O3=O2) $(COMPILE_CXXFLAGS:arch:SSE3=arch:SSE2) $(_VPATH_SRCS) + +Initialize.$(OBJ_SUFFIX): Initialize.cpp $(GLOBAL_DEPS) + $(REPORT_BUILD) + @$(MAKE_DEPS_AUTO_CXX) + $(ELOG) $(CCC:icl=cl) $(OUTOPTION)$@ -c $(COMPILE_CXXFLAGS:O3=O2) $(COMPILE_CXXFLAGS:arch:SSE3=arch:SSE2) $(_VPATH_SRCS) diff -ruNa mozilla-beta-vc/gfx/angle/src/libEGL/Makefile.in mozilla-beta/gfx/angle/src/libEGL/Makefile.in --- mozilla-beta-vc/gfx/angle/src/libEGL/Makefile.in Thu May 24 02:56:44 2012 +++ mozilla-beta/gfx/angle/src/libEGL/Makefile.in Thu May 31 02:51:23 2012 @@ -161,3 +161,13 @@ /delayload:dwmapi.dll EXTRA_DSO_LDOPTS += $(MOZALLOC_LIB) + +intermOut.$(OBJ_SUFFIX): intermOut.cpp $(GLOBAL_DEPS) + $(REPORT_BUILD) + @$(MAKE_DEPS_AUTO_CXX) + $(ELOG) $(CCC:icl=cl) $(OUTOPTION)$@ -c $(COMPILE_CXXFLAGS:O3=O2) $(COMPILE_CXXFLAGS:arch:SSE3=arch:SSE2) $(_VPATH_SRCS) + +Initialize.$(OBJ_SUFFIX): Initialize.cpp $(GLOBAL_DEPS) + $(REPORT_BUILD) + @$(MAKE_DEPS_AUTO_CXX) + $(ELOG) $(CCC:icl=cl) $(OUTOPTION)$@ -c $(COMPILE_CXXFLAGS:O3=O2) $(COMPILE_CXXFLAGS:arch:SSE3=arch:SSE2) $(_VPATH_SRCS) diff -ruNa mozilla-beta-vc/gfx/angle/src/libGLESv2/Makefile.in mozilla-beta/gfx/angle/src/libGLESv2/Makefile.in --- mozilla-beta-vc/gfx/angle/src/libGLESv2/Makefile.in Thu May 24 02:56:44 2012 +++ mozilla-beta/gfx/angle/src/libGLESv2/Makefile.in Thu May 31 02:51:55 2012 @@ -170,3 +170,13 @@ "$(MOZ_DIRECTX_SDK_PATH)/lib/$(MOZ_DIRECTX_SDK_CPU_SUFFIX)/D3DCompiler.lib" EXTRA_DSO_LDOPTS += $(MOZALLOC_LIB) + +intermOut.$(OBJ_SUFFIX): intermOut.cpp $(GLOBAL_DEPS) + $(REPORT_BUILD) + @$(MAKE_DEPS_AUTO_CXX) + $(ELOG) $(CCC:icl=cl) $(OUTOPTION)$@ -c $(COMPILE_CXXFLAGS:O3=O2) $(COMPILE_CXXFLAGS:arch:SSE3=arch:SSE2) $(_VPATH_SRCS) + +Initialize.$(OBJ_SUFFIX): Initialize.cpp $(GLOBAL_DEPS) + $(REPORT_BUILD) + @$(MAKE_DEPS_AUTO_CXX) + $(ELOG) $(CCC:icl=cl) $(OUTOPTION)$@ -c $(COMPILE_CXXFLAGS:O3=O2) $(COMPILE_CXXFLAGS:arch:SSE3=arch:SSE2) $(_VPATH_SRCS)If you use ICC 12 update 10, then muse use the similar patch (13 has fixed it) :
diff -ruNa mozilla-release/netwerk/base/src/Makefile.in mozilla-new/netwerk/base/src/Makefile.in --- mozilla-release/netwerk/base/src/Makefile.in Tue Mar 13 09:37:10 2012 +++ mozilla-new/netwerk/base/src/Makefile.in Tue Mar 27 13:15:52 2012 @@ -150,3 +150,8 @@ ifdef MOZ_ENABLE_LIBCONIC OS_INCLUDES += $(GLIB_CFLAGS) $(LIBCONIC_CFLAGS) endif + +nsURLHelper.$(OBJ_SUFFIX): nsURLHelper.cpp $(GLOBAL_DEPS) + $(REPORT_BUILD) + @$(MAKE_DEPS_AUTO_CXX) + $(ELOG) $(CCC) $(OUTOPTION)$@ -c $(COMPILE_CXXFLAGS:O2=O1) $(COMPILE_CXXFLAGS:O3=O1) -O1 $(_VPATH_SRCS)
There are two forms of the bug:
nsBinaryStream.cpp will cause wrong code when using -Qax switch
diff -ruNa mozilla-beta-vc/xpcom/io/Makefile.in mozilla-beta/xpcom/io/Makefile.in --- mozilla-beta-vc/xpcom/io/Makefile.in Thu May 24 02:57:10 2012 +++ mozilla-beta/xpcom/io/Makefile.in Fri Jun 1 01:05:42 2012 @@ -205,3 +205,7 @@ CXXFLAGS += $(MOZ_PLATFORM_MAEMO_CFLAGS) $(MOZ_QT_CFLAGS) endif +nsBinaryStream.$(OBJ_SUFFIX): nsBinaryStream.cpp $(GLOBAL_DEPS) + $(REPORT_BUILD) + @$(MAKE_DEPS_AUTO_CXX) + $(ELOG) $(CCC) $(OUTOPTION)$@ -c $(COMPILE_CXXFLAGS:QaxSSE2,SSE3,SSSE3,SSE4.1,SSE4.2,AVX,CORE-AVX2,CORE-AVX-I=) $(_VPATH_SRCS)
Mozilla use -MD to build code by default, which will link the dynamic
Intel LibMath
, which can reduce some memory, this may cause some extensions not to work.So if you wan to static link
Intel LibMath
, you can use the similar patch:
diff -ruNa mozilla-beta-vc/js/src/Makefile.in mozilla-beta/js/src/Makefile.in --- mozilla-beta-vc/js/src/Makefile.in Thu May 24 02:56:46 2012 +++ mozilla-beta/js/src/Makefile.in Mon May 28 15:03:00 2012 @@ -919,3 +919,5 @@ # END kludges for the Nitro assembler ############################################### + +jsdtoa.$(OBJ_SUFFIX): jsdtoa.cpp $(GLOBAL_DEPS) + $(REPORT_BUILD) + @$(MAKE_DEPS_AUTO_CXX) + $(ELOG) $(CCC) $(OUTOPTION)$@ -c $(COMPILE_CXXFLAGS:MD=MT) $(_VPATH_SRCS) diff -ruNa mozilla-beta-vc/nsprpub/config/autoconf.mk.in mozilla-beta/nsprpub/config/autoconf.mk.in --- mozilla-beta-vc/nsprpub/config/autoconf.mk.in Thu May 24 02:57:04 2012 +++ mozilla-beta/nsprpub/config/autoconf.mk.in Mon May 28 16:34:49 2012 @@ -81,7 +81,7 @@ OS_LIBS = @OS_LIBS@ OS_LDFLAGS = @LDFLAGS@ OS_DLLFLAGS = @OS_DLLFLAGS@ -DLLFLAGS = @DLLFLAGS@ +DLLFLAGS = @DLLFLAGS@ -opt:ref,icf -LARGEADDRESSAWARE -NODEFAULTLIB:svml_dispmd -NODEFAULTLIB:libcmt -NODEFAULTLIB:libmmd svml_dispmt.lib libmmt.lib EXEFLAGS = @EXEFLAGS@ OPTIMIZER = @OPTIMIZER@ diff -ruNa mozilla-beta-vc/nsprpub/pr/src/misc/Makefile.in mozilla-beta/nsprpub/pr/src/misc/Makefile.in --- mozilla-beta-vc/nsprpub/pr/src/misc/Makefile.in Thu May 24 02:57:04 2012 +++ mozilla-beta/nsprpub/pr/src/misc/Makefile.in Mon May 28 15:12:06 2012 @@ -109,4 +109,5 @@ export:: $(TARGETS) + +$(OBJDIR)/prdtoa.$(OBJ_SUFFIX): prdtoa.c + @$(MAKE_OBJDIR) + $(CC) -Fo$@ -c $(CFLAGS:MD=MT) $(call pr_abspath,$<) diff -ruNa mozilla-beta-vc/security/coreconf/WIN32.mk mozilla-beta/security/coreconf/WIN32.mk --- mozilla-beta-vc/security/coreconf/WIN32.mk Thu May 24 02:57:04 2012 +++ mozilla-beta/security/coreconf/WIN32.mk Mon May 28 16:36:21 2012 @@ -388,3 +388,4 @@ # 4553: '==' : operator has no effect; did you intend '='? # 4551: function call missing argument list +LDFLAGS += -opt:ref,icf -LARGEADDRESSAWARE -NODEFAULTLIB:svml_dispmd -NODEFAULTLIB:libmmd -NODEFAULTLIB:libcmt svml_dispmt.lib libmmt.lib
At the same time, modify .mozconfig related sections
export MOZ_OPTIMIZE_LDFLAGS="-opt:ref,icf -LARGEADDRESSAWARE -NODEFAULTLIB:svml_dispmd -NODEFAULTLIB:libmmd -NODEFAULTLIB:libcmt svml_dispmt.lib libmmt.lib" mk_add_options MOZ_OPTIMIZE_LDFLAGS="-opt:ref,icf -LARGEADDRESSAWARE -NODEFAULTLIB:svml_dispmd -NODEFAULTLIB:libmmd -NODEFAULTLIB:libcmt svml_dispmt.lib libmmt.lib"
Assume you put the source code to e:\mozilla\mozilla-release .
Open mozilla msys bash
cd /e/mozilla/mozilla-release make -f client.mk build
cd /e/mozilla/obju-icc make installer
Then the installer will be in e:/mozilla/obju-vc/dist/install/sea .
The methods involved below can be used at the same time.
Intel Compiler has some PGO bugs, may cause some crashes or abnormal phenomena, you can refer to the patches below:
diff -ruNa mozilla-release/js/src/Makefile.in mozilla-new/js/src/Makefile.in --- mozilla-release/js/src/Makefile.in Tue Mar 13 09:36:54 2012 +++ mozilla-new/js/src/Makefile.in Tue Mar 27 13:19:43 2012 @@ -951,6 +951,24 @@ $(CXX) -o TestMain$(HOST_BIN_SUFFIX) $(TESTMAIN_OBJS) endif + +jsinterp.$(OBJ_SUFFIX): jsinterp.cpp $(GLOBAL_DEPS) + $(REPORT_BUILD) + @$(MAKE_DEPS_AUTO_CXX) + $(ELOG) $(CCC) $(OUTOPTION)$@ -c $(COMPILE_CXXFLAGS) -Qprof-gen- -Qprof-use- $(_VPATH_SRCS) + +BytecodeEmitter.$(OBJ_SUFFIX): BytecodeEmitter.cpp $(GLOBAL_DEPS) + $(REPORT_BUILD) + @$(MAKE_DEPS_AUTO_CXX) + $(ELOG) $(CCC) $(OUTOPTION)$@ -c $(COMPILE_CXXFLAGS) -Qprof-gen- -Qprof-use- $(_VPATH_SRCS) + # # END kludges for the Nitro assembler ############################################### diff -ruNa mozilla-release/xpcom/reflect/xptcall/src/md/win32/Makefile.in mozilla-new/xpcom/reflect/xptcall/src/md/win32/Makefile.in --- mozilla-release/xpcom/reflect/xptcall/src/md/win32/Makefile.in Tue Mar 13 09:36:54 2012 +++ mozilla-new/xpcom/reflect/xptcall/src/md/win32/Makefile.in Tue Mar 27 13:19:43 2012 @@ -951,6 +951,24 @@ DEFINES += -DEXPORT_XPTC_API -D_IMPL_NS_COM LOCAL_INCLUDES += -I$(srcdir)/../.. + +xptcstubs.$(OBJ_SUFFIX): xptcstubs.cpp $(GLOBAL_DEPS) + $(REPORT_BUILD) + @$(MAKE_DEPS_AUTO_CXX) + $(ELOG) $(CCC) $(OUTOPTION)$@ -c $(COMPILE_CXXFLAGS) -Qprof-gen- -Qprof-use- $(_VPATH_SRCS) +xptcstubs_x86_64.$(OBJ_SUFFIX): xptcstubs_x86_64.cpp $(GLOBAL_DEPS) + $(REPORT_BUILD) + @$(MAKE_DEPS_AUTO_CXX) + $(ELOG) $(CCC) $(OUTOPTION)$@ -c $(COMPILE_CXXFLAGS) -Qprof-gen- -Qprof-use- $(_VPATH_SRCS) + # # END kludges for the Nitro assembler ###############################################
Modify .mozconfig section
ac_add_options --enable-optimize="-O2 -fp:precise -Qprof-gen -Qprof-dire:/mozilla/iccpgo" make -f client.mk build
You can enter into <obj>/dist/bin
, run firefox.exe and some PGO tests, close it.
Modify .mozconfig related section
ac_add_options --enable-optimize="-O2 -fp:precise -Qprof-use -Qprof-dire:/mozilla/iccpgo" make -f client.mk build
Improve the float caculation precision, if you don't want to use the patches above when using -fp:fast, you can use the switch.
In general, all new cpu support SSE2, most support SSE3 ( especially Intel CPU).
Great switch, but make build process time very very long, and build process will need very much more memory. You can use -Qipo128 or -Qipo256 to improve the memory issue when linking.
Invalid for AMD CPU, but may improve some performance on Intel CPU.
Note
If you use -Qax and -arch at a time, make sure put -arch after -Qax.
If you feel -O3 not safe, you can use -O2 -Qftz .
2012.6.5 security module can't be built using -O3 and -Qipo, which all cause crash.
Wiki: Guide
Wiki: GuideExplained
View and moderate all "wiki Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Wiki"
Originally posted by: ilikethi...@gmail.com
Good job!
Last edit: Anonymous 2015-03-12
View and moderate all "wiki Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Wiki"
Originally posted by: xunxun1...@gmail.com
Mail from Alex on 20120910
Hi xunxun, Here are some more bugs I have found while compiling with ICC that you can add to your wiki:
-Alex/Waterfox
Last edit: Anonymous 2015-04-28