Firefox 4 PGO BUILD with Intel C++ Compiler 12

環境:VS2010SP1, ICC 12.0.2.154, Core i5-480M, 4GB RAM
結果:性能相對Firefox 4官方版有10-20%提升。下載地址 http://115.com/file/czdy8cwu
步驟:
  1 修改源碼中的js/src/ctypes/libffi/msvcc.sh,將cl替換成icl
  2 運行autoconf之後,修改以下configure腳本:
      configure
      js/src/configure
      js/src/ctypes/libffi/configure
      nsprpub/configure
    使用類似下面的patch:
*** configure-org Mon Mar 21 18:14:10 2011
--- configure Mon Mar 21 18:54:02 2011
***************
*** 4,9 ****
--- 4,13 ----
    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
***************
*** 3242,3248 ****
  #define _CRT_NONSTDC_NO_WARNINGS 1
  EOF
  
!         elif test "$_CC_MAJOR_VERSION" = "16"; then
              _CC_SUITE=10
              CXXFLAGS="$CXXFLAGS -Zc:wchar_t-"
              cat >> confdefs.h <<\EOF
--- 3246,3252 ----
  #define _CRT_NONSTDC_NO_WARNINGS 1
  EOF
  
!         else
              _CC_SUITE=10
              CXXFLAGS="$CXXFLAGS -Zc:wchar_t-"
              cat >> confdefs.h <<\EOF
***************
*** 3253,3260 ****
  #define _CRT_NONSTDC_NO_WARNINGS 1
  EOF
  
-         else
-             { echo "configure: error: This version ($CC_VERSION) of the MSVC compiler is unsupported. See https://developer.mozilla.org/en/Windows_Build_Prerequisites." 1>&2; exit 1; }
          fi
  
          _MOZ_RTTI_FLAGS_ON='-GR'
--- 3257,3262 ----

  3 第一遍configure和make:
../mozilla/configure --enable-application=browser --enable-official-branding --with-l10n-base=/lang --enable-ui-locale=zh-CN\
 --enable-optimize="-fast -Qprof-gen -Qprof-dird:/temp/ffprof -W0" --disable-accessibility --disable-debug --disable-tests\
 --disable-installer --disable-updater --disable-update-channel --disable-crashreporter

    make之前需進行如下修改(在obj目錄下):
      Makefile 註釋掉all規則下的$(RM)
      config/autoconf.mk lib替換成xilib
      js/src/config/autoconf.mk lib替換成xilib
      nsprpub/config/autoconf.mk cl, link, lib分別替換成icl, xilink, xilib
    另外,xptcall與ICC不兼容的問題仍然存在,故需在make後執行下面命令,帶profiling的Firefox才能啓動:
cd xpcom/reflect/xptcall/src/md/win32
make clean; make CC="cl.exe" CXX="cl.exe" MOZ_OPTIMIZE_FLAGS="-O2";\
cd ../../..; make; cd ..; make; cd ..; make; cd ../toolkit/library; make

  4 運行Firefox,生成profiling數據
  5 第二遍configure和make
../mozilla/configure --enable-application=browser --enable-official-branding --with-l10n-base=/lang --enable-ui-locale=zh-CN\
 --enable-optimize="-fast -Qprof-use -Qprof-dird:/temp/ffprof -W0" --disable-accessibility --disable-debug --disable-tests\
 --disable-installer --disable-updater --disable-update-channel --disable-crashreporter

    make之前重複3中的修改,當開始鏈接xul.dll時終止make,執行下面命令:
cd modules/libpr0n/decoders; rm nsGIFDecoder2.obj  nsJPEGDecoder.obj nsPNGDecoder.obj;
make MOZ_OPTIMIZE_FLAGS="-QxHOST -O2 -Qprec-div- -Qprof-use -Qprof-dird:/temp/ffprof -W0";

    然後繼續make。此處系處理ICC 12中的一個bug。
  6 執行make package獲得PGO編譯的Firefox
發佈了28 篇原創文章 · 獲贊 8 · 訪問量 66萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章