Firefox 4 PGO BUILD with Intel C++ Compiler 12

來源:互聯網
上載者:User

環境: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/win32make 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

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.