Ticket #3978: tbb-ff-pgo.patch

File tbb-ff-pgo.patch, 2.8 KB (added by tmpname0901, 8 years ago)

Add support for doing a profiled build of Firefox/Linux.

  • tor-browser-2.2.32-4

    old new  
    3943BUILD_NUM=4
    4044PLATFORM=Linux
    4145
     46# system-specific stuff; comment-out to use defaults
     47TBBROOT=$(HOME)/buildtbb
     48#CMARCH:=-march=native
     49#CFLAGS:="$(CMARCH) -O2"
     50#CXXFLAGS:="$(CMARCH) -O2"
     51#TBBCFLAGS='CFLAGS=$(CFLAGS)'
     52#TBBCXXFLAGS='CXXFLAGS=$(CXXFLAGS)'
     53#MAKEJOBS=-j4
     54#FFPREFS=lan-tor-not-local+vidalia.js
     55
     56## working directories
     57SCRIPT_DIR=$(PWD)
     58SOURCE_DIR=$(shell readlink -f $(SCRIPT_DIR)/../src)
     59
    4260## Location of directory for source unpacking
    43 FETCH_DIR=/srv/build-trees/build-alpha-$(ARCH_TYPE)
     61FETCH_DIR=$(TBBROOT)/srv/build-trees/build-alpha-$(ARCH_TYPE)
    4462## Location of directory for prefix/destdir/compiles/etc
    4563BUILT_DIR=$(FETCH_DIR)/built
    4664TBB_FINAL=$(BUILT_DIR)/TBBL
     
    111130        echo "We're not building pidgin yet!"
    112131
    113132FIREFOX_DIR=$(FETCH_DIR)/mozilla-release
    114 build-firefox:
    115         cp ../src/current-patches/000* $(FIREFOX_DIR)
    116         cp patch-firefox-src.sh $(FIREFOX_DIR)
    117         cp $(CONFIG_SRC)/dot_mozconfig $(FIREFOX_DIR)/mozconfig
    118         cd $(FIREFOX_DIR) && ./patch-firefox-src.sh
    119         cd $(FIREFOX_DIR) && make -f client.mk build
     133
     134# official TBB patches to Firefox, plus user's patches
     135TBBPATCHES=$(shell ls $(SOURCE_DIR)/current-patches/00*.patch)
     136LOCPATCHES=$(shell ls $(SOURCE_DIR)/local-patches/*.patch)
     137
     138config-firefox: unpack-firefox
     139        cat $(CONFIG_SRC)/dot_mozconfig | sed s/--enable-optimize/--enable-optimize='$(TBBCXXFLAGS)'/ > $(FIREFOX_DIR)/mozconfig
     140        $(foreach tbbpatch,$(TBBPATCHES),/bin/sh -c "patch -d $(FIREFOX_DIR) -tp1 < $(tbbpatch)";)
     141        $(foreach locpatch,$(LOCPATCHES),/bin/sh -c "patch -d $(FIREFOX_DIR) -tp1 < $(locpatch)";)
     142
     143build-firefox: config-firefox
     144        make -C $(FIREFOX_DIR) -f client.mk MOZ_MAKE_FLAGS=$(MAKEJOBS) build
     145
     146build-firefox-pgo: config-firefox
     147        make -C $(FIREFOX_DIR) -f client.mk MOZ_MAKE_FLAGS=$(MAKEJOBS) profiledbuild
    120148
    121149copy-firefox:
    122150        -rm -rf $(FETCH_DIR)/Firefox
  • config/dot_mozconfig

    old new  
    22
    33mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-@CONFIG_GUESS@
    44mk_add_options MOZ_APP_DISPLAYNAME=TorBrowser
     5mk_add_options PROFILE_GEN_SCRIPT='$(PYTHON) $(MOZ_OBJDIR)/_profile/pgo/profileserver.py'
    56
    67ac_add_options --enable-optimize
    78ac_add_options --disable-tests
    89ac_add_options --disable-debug
     10
     11# known not to build on Fedora
     12ac_add_options --disable-necko-wifi
     13
     14# Firefox run in isolated environment
     15ac_add_options --disable-crashreporter
     16ac_add_options --disable-updater
     17
     18# don't bloat binary with unused features
     19ac_add_options --disable-cpp-exceptions
     20
     21# why is CPU pegged while downloading TorStatus?
     22#ac_add_options --enable-debug-symbols
     23