diff options
author | Matt Parnell | 2017-02-05 21:46:04 -0600 |
---|---|---|
committer | Matt Parnell | 2017-02-05 21:46:04 -0600 |
commit | 6a88fcf5322f78d9921310480116352587dd79c8 (patch) | |
tree | 01586ff5a8ec606a42de564c1874512d39e3593a | |
parent | 238bbcd21ebc011e6fd2f303d0ae111baf305cb2 (diff) | |
download | aur-6a88fcf5322f78d9921310480116352587dd79c8.tar.gz |
add pgo patch and changes; it is broken and off currently and needs further investigation
-rw-r--r-- | .SRCINFO | 6 | ||||
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | PKGBUILD | 53 | ||||
-rw-r--r-- | clang-profile.patch | 175 | ||||
-rw-r--r-- | mozconfig | 2 |
5 files changed, 217 insertions, 20 deletions
@@ -1,5 +1,5 @@ # Generated by mksrcinfo v8 -# Sun Feb 5 09:36:40 UTC 2017 +# Mon Feb 6 03:46:02 UTC 2017 pkgbase = waterfox-git pkgdesc = 64-Bit optimized Firefox fork, no data collection, allows unsigned extensions pkgver = 51.0.1+55eacc009b @@ -54,13 +54,15 @@ pkgbase = waterfox-git source = firefox-install-dir.patch source = unused_missing.patch source = rhbz-966424.patch + source = clang-profile.patch source = vendor.js sha512sums = SKIP - sha512sums = 16f358d5544f660af2986e26be6e64b14bb963e215ed64cd0874794393d0c4c8b6db3c22119d26e2e5d911ecbc470b68948819b8c74d24e8679b81c70dbfad77 + sha512sums = 2372bfae48cd7fa6162e94c9cd0689797d305ed159e8e38491022c22519b971a4ffcc8ee23c1f6473f0926b51029ca39e61a315f24f37a7813a5e6d3b55088cc sha512sums = 93937770fa66d63f69c6283ed1f19ac83b9c9c4f5cc34e79d11ac31676462be9f7f37bcd35e785ceb8c7d234a09236d1f26b21e551b622854076fb21bcda44d3 sha512sums = 266989b0c4a37254a40836a6193284a186230b48716907e4d249d73616f58382b258c41baa8c1ffc98d405f77bfafcd3438f749edcf391c7bd22185399adf4bd sha512sums = 87225692ee6e643cd9d291608174c68e25b00818086d641847111924c457414faadf3ed6d10fddafd5bd4bc54eeea2055b7136ffeabadec8644a60e819e9356f sha512sums = 0d69183bbfdceee89b3059c913c95e316c03b14b6b302675e16a03c32b74f30b7058344d8c6f2f5a4cfd33db9c7e6f52bf0f52d1c047a224b75e1745d0711c07 + sha512sums = c17dceeefd58447917e27a33d6688a28158b919c41867909b11478d8be7f155b61ae8fda2e0381c14210583f1c6ecf678dfb469c4826f34e24b8ee0b96a8aaa5 sha512sums = d927e5e882115c780aa0d45034cb1652eaa191d95c15013639f9172ae734245caae070018465d73fdf86a01601d08c9e65f28468621422d799fe8451e6175cb7 pkgname = waterfox-git diff --git a/.gitignore b/.gitignore index 3144c2883cd1..e4c2c94bc32f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +*.pkg.* Waterfox src pkg @@ -26,44 +26,58 @@ source=(git://github.com/MrAlex94/Waterfox firefox-install-dir.patch unused_missing.patch rhbz-966424.patch - vendor.js - ) + clang-profile.patch + vendor.js) sha512sums=('SKIP' - '16f358d5544f660af2986e26be6e64b14bb963e215ed64cd0874794393d0c4c8b6db3c22119d26e2e5d911ecbc470b68948819b8c74d24e8679b81c70dbfad77' + '2372bfae48cd7fa6162e94c9cd0689797d305ed159e8e38491022c22519b971a4ffcc8ee23c1f6473f0926b51029ca39e61a315f24f37a7813a5e6d3b55088cc' '93937770fa66d63f69c6283ed1f19ac83b9c9c4f5cc34e79d11ac31676462be9f7f37bcd35e785ceb8c7d234a09236d1f26b21e551b622854076fb21bcda44d3' '266989b0c4a37254a40836a6193284a186230b48716907e4d249d73616f58382b258c41baa8c1ffc98d405f77bfafcd3438f749edcf391c7bd22185399adf4bd' '87225692ee6e643cd9d291608174c68e25b00818086d641847111924c457414faadf3ed6d10fddafd5bd4bc54eeea2055b7136ffeabadec8644a60e819e9356f' '0d69183bbfdceee89b3059c913c95e316c03b14b6b302675e16a03c32b74f30b7058344d8c6f2f5a4cfd33db9c7e6f52bf0f52d1c047a224b75e1745d0711c07' + 'c17dceeefd58447917e27a33d6688a28158b919c41867909b11478d8be7f155b61ae8fda2e0381c14210583f1c6ecf678dfb469c4826f34e24b8ee0b96a8aaa5' 'd927e5e882115c780aa0d45034cb1652eaa191d95c15013639f9172ae734245caae070018465d73fdf86a01601d08c9e65f28468621422d799fe8451e6175cb7') -# Mozilla API keys (see https://location.services.mozilla.com/api) -# Note: These are for Arch Linux use ONLY. For your own distribution, please -# get your own set of keys. Feel free to contact heftig@archlinux.org for -# more information. -_mozilla_api_key=16674381-f021-49de-8622-3021c5942aff +_CORES=1 +# don't compress the package - we're just going to uncompress during install in a moment +PKGEXT='.pkg.tar' + +# use pgo? +_pgo=0 # even with my patch this results in "error: Could not read profile /media/disk/Linux/makepkg/waterfox-git/src/Waterfox/obj-x86_64-pc-linux-gnu/default.profdata: Invalid instrumentation profile data (bad magic)" + pkgver() { cd Waterfox echo $(cat browser/config/version.txt)"+"$(git rev-parse --short HEAD) } prepare() { + # Number of CPU Cores + _CORES=$(cat /proc/cpuinfo|grep processor|wc -l) + if [ $_CORES -lt 1 ]; then + _CORES=2 + fi + cd Waterfox cp ../mozconfig .mozconfig + + # alter the install dir patch -Np1 -i ../firefox-install-dir.patch + + # missing files patch -Np1 -i ../unused_missing.patch + + # fix addon update issue - happens in arch and redhat, at the least patch -Np0 -i ../rhbz-966424.patch + + # these fix PGO + patch -Np1 -i ../clang-profile.patch - echo -n "$_mozilla_api_key" >mozilla-api-key - echo "ac_add_options --with-mozilla-api-keyfile=\"$PWD/mozilla-api-key\"" >>.mozconfig + if [[ $CARCH = x86_64 ]] && [[ $_pgo = 1 ]]; then + echo "mk_add_options PROFILE_GEN_SCRIPT='EXTRA_TEST_ARGS=10 \$(MAKE) -C \$(MOZ_OBJDIR) pgo-profile-run'" >>.mozconfig + fi mkdir -p "$srcdir/path" - - # Fix tab loading icon (doesn't work with libpng 1.6) - # https://bugzilla.mozilla.org/show_bug.cgi?id=841734 - #cp "$srcdir/firefox-fixed-loading-icon.png" \ - # browser/themes/linux/tabbrowser/loading.png } build() { @@ -72,7 +86,14 @@ build() { export PATH="$srcdir/path:$PATH" export PYTHON="/usr/bin/python2" - make -f client.mk build -j8 + if [[ $CARCH = x86_64 ]] && [[ $_pgo = 1 ]]; then + msg2 'PGO build is selected' + xvfb-run -a -s "-extension GLX -screen 0 1280x1024x24" \ + make -j $_CORES -f client.mk profiledbuild + else + msg2 'Non-PGO build is selected or your architecture is not x86_64' + make -j $_CORES -f client.mk build + fi } package() { diff --git a/clang-profile.patch b/clang-profile.patch new file mode 100644 index 000000000000..978e07e3dabe --- /dev/null +++ b/clang-profile.patch @@ -0,0 +1,175 @@ +# adapted from the previous patch by Matt Parnell/ilikenwf <parwok@gmail.com> +# bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1064049 +diff --git a/build/pgo/profileserver.py b/build/pgo/profileserver.py +index 3e5a870c33..25ef5053a7 100644 +--- a/build/pgo/profileserver.py ++++ b/build/pgo/profileserver.py +@@ -37,7 +37,7 @@ if __name__ == '__main__': + + #TODO: mozfile.TemporaryDirectory + profilePath = tempfile.mkdtemp() +- try: ++ try: + #TODO: refactor this into mozprofile + prefpath = os.path.join(build.topsrcdir, "testing", "profiles", "prefs_general.js") + prefs = {} +@@ -53,6 +53,7 @@ if __name__ == '__main__': + locations=locations) + + env = os.environ.copy() ++ env["LLVM_PROFILE_FILE"] = "runpid-%p.profraw" # clang can hit naming conflicts if we don't do this + env["MOZ_CRASHREPORTER_NO_REPORT"] = "1" + env["XPCOM_DEBUG_BREAK"] = "warn" + +@@ -88,5 +89,13 @@ if __name__ == '__main__': + runner.start(debug_args=debug_args, interactive=interactive) + runner.wait() + httpd.stop() ++ ++ # this is hacky but should build our profdata for use, at least for the main browser...not the other stuff ++ # i'm not super up on the current state of the mozilla build system so for other profraws and other profdata ++ # generated, and for this, it'd be nice to properly get an llvm-profdata search in configure ++ # and properly add it to the flow... just proof of concept for me - halp please! ++ # Matt Parnell/ilikenwf <parwok@gmail.com> ++ os.chdir(build.topobjdir) ++ os.system("/usr/bin/llvm-profdata merge -output=default.profdata *.profraw &> /dev/null") + finally: + shutil.rmtree(profilePath) +diff --git a/js/src/old-configure.in b/js/src/old-configure.in +index c756cd202d..ec2855cb47 100644 +--- a/js/src/old-configure.in ++++ b/js/src/old-configure.in +@@ -1950,13 +1950,18 @@ else + fi + + dnl ======================================================== +-dnl Profile guided optimization (gcc checks) ++dnl Profile guided optimization (gcc/clang checks) + dnl ======================================================== + dnl Test for profiling options +-dnl Under gcc 3.4+, use -fprofile-generate/-fprofile-use ++dnl Under gcc 3.4+ and clang use -fprofile-generate/-fprofile-use + + _SAVE_CFLAGS="$CFLAGS" +-CFLAGS="$CFLAGS -fprofile-generate -fprofile-correction" ++ ++if test -n "${CLANG_CC}"; then ++ CFLAGS="$CFLAGS -fprofile-generate" ++else ++ CFLAGS="$CFLAGS -fprofile-generate -fprofile-correction" ++fi + + AC_MSG_CHECKING([whether C compiler supports -fprofile-generate]) + AC_TRY_COMPILE([], [return 0;], +@@ -1965,11 +1970,15 @@ AC_TRY_COMPILE([], [return 0;], + AC_MSG_RESULT([$result]) + + if test $result = "yes"; then +- PROFILE_GEN_LDFLAGS="-fprofile-generate" +- PROFILE_USE_CFLAGS="-fprofile-use -fprofile-correction -Wcoverage-mismatch" +- PROFILE_USE_LDFLAGS="-fprofile-use" ++ if test -n "${CLANG_CC}"; then ++ PROFILE_GEN_CFLAGS="-fprofile-generate" ++ PROFILE_USE_CFLAGS='-fprofile-instr-use=$(topobjdir)/default.profdata' ++ else ++ PROFILE_GEN_LDFLAGS="-fprofile-generate" ++ PROFILE_USE_CFLAGS="-fprofile-use -fprofile-correction -Wcoverage-mismatch" ++ PROFILE_USE_LDFLAGS="-fprofile-use" ++ fi + fi +- + CFLAGS="$_SAVE_CFLAGS" + + AC_SUBST(PROFILE_GEN_CFLAGS) +diff --git a/nsprpub/configure.in b/nsprpub/configure.in +index 202158b799..c92fdd6aa3 100644 +--- a/nsprpub/configure.in ++++ b/nsprpub/configure.in +@@ -716,13 +716,18 @@ else + fi + + dnl ======================================================== +-dnl Profile guided optimization ++dnl Profile guided optimization (gcc/clang checks) + dnl ======================================================== + dnl Test for profiling options +-dnl Under gcc 3.4+, use -fprofile-generate/-fprofile-use ++dnl Under gcc 3.4+ and clang use -fprofile-generate/-fprofile-use + + _SAVE_CFLAGS="$CFLAGS" +-CFLAGS="$CFLAGS -fprofile-generate -fprofile-correction" ++ ++if test -n "${CLANG_CC}"; then ++ CFLAGS="$CFLAGS -fprofile-generate" ++else ++ CFLAGS="$CFLAGS -fprofile-generate -fprofile-correction" ++fi + + AC_MSG_CHECKING([whether C compiler supports -fprofile-generate]) + AC_TRY_COMPILE([], [return 0;], +@@ -731,11 +736,15 @@ AC_TRY_COMPILE([], [return 0;], + AC_MSG_RESULT([$result]) + + if test $result = "yes"; then +- PROFILE_GEN_LDFLAGS="-fprofile-generate" +- PROFILE_USE_CFLAGS="-fprofile-use -fprofile-correction -Wcoverage-mismatch" +- PROFILE_USE_LDFLAGS="-fprofile-use" ++ if test -n "${CLANG_CC}"; then ++ PROFILE_GEN_CFLAGS="-fprofile-generate" ++ PROFILE_USE_CFLAGS='-fprofile-instr-use=$(topobjdir)/default.profdata' ++ else ++ PROFILE_GEN_LDFLAGS="-fprofile-generate" ++ PROFILE_USE_CFLAGS="-fprofile-use -fprofile-correction -Wcoverage-mismatch" ++ PROFILE_USE_LDFLAGS="-fprofile-use" ++ fi + fi +- + CFLAGS="$_SAVE_CFLAGS" + + dnl =============================================================== +diff --git a/old-configure.in b/old-configure.in +index ada5934ec1..d9eefcb3cc 100644 +--- a/old-configure.in ++++ b/old-configure.in +@@ -5042,13 +5042,18 @@ else + fi + + dnl ======================================================== +-dnl Profile guided optimization (gcc checks) ++dnl Profile guided optimization (gcc/clang checks) + dnl ======================================================== + dnl Test for profiling options +-dnl Under gcc 3.4+, use -fprofile-generate/-fprofile-use ++dnl Under gcc 3.4+ and clang use -fprofile-generate/-fprofile-use + + _SAVE_CFLAGS="$CFLAGS" +-CFLAGS="$CFLAGS -fprofile-generate -fprofile-correction" ++ ++if test -n "${CLANG_CC}"; then ++ CFLAGS="$CFLAGS -fprofile-generate" ++else ++ CFLAGS="$CFLAGS -fprofile-generate -fprofile-correction" ++fi + + AC_MSG_CHECKING([whether C compiler supports -fprofile-generate]) + AC_TRY_COMPILE([], [return 0;], +@@ -5057,11 +5062,15 @@ AC_TRY_COMPILE([], [return 0;], + AC_MSG_RESULT([$result]) + + if test $result = "yes"; then +- PROFILE_GEN_LDFLAGS="-fprofile-generate" +- PROFILE_USE_CFLAGS="-fprofile-use -fprofile-correction -Wcoverage-mismatch" +- PROFILE_USE_LDFLAGS="-fprofile-use" ++ if test -n "${CLANG_CC}"; then ++ PROFILE_GEN_CFLAGS="-fprofile-generate" ++ PROFILE_USE_CFLAGS='-fprofile-instr-use=$(topobjdir)/default.profdata' ++ else ++ PROFILE_GEN_LDFLAGS="-fprofile-generate" ++ PROFILE_USE_CFLAGS="-fprofile-use -fprofile-correction -Wcoverage-mismatch" ++ PROFILE_USE_LDFLAGS="-fprofile-use" ++ fi + fi +- + CFLAGS="$_SAVE_CFLAGS" + + AC_SUBST(PROFILE_GEN_CFLAGS) diff --git a/mozconfig b/mozconfig index add813010430..df57029e6d42 100644 --- a/mozconfig +++ b/mozconfig @@ -60,8 +60,6 @@ ac_add_options --disable-eme ac_add_options --disable-js-shell ac_add_options --disable-maintenance-service ac_add_options --disable-updater -ac_add_options --disable-profiling -ac_add_options --disable-tests ac_add_options --disable-verify-mar ac_add_options --disable-websms-backend ac_add_options --disable-webspeech |