summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--PKGBUILD17
-rw-r--r--clang-profile.patch43
2 files changed, 36 insertions, 24 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 91369c9da954..2bec89299e0e 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -34,7 +34,7 @@ sha512sums=('SKIP'
'0eb1c5a89b17585126e3cd374c0b61970f97bb2d3c3d63052cf6b632b71ac5a2aa852dc86ac07a3a5b7dfe5e9177014fc5746e0281eb2f71061465279a32eda9'
'93937770fa66d63f69c6283ed1f19ac83b9c9c4f5cc34e79d11ac31676462be9f7f37bcd35e785ceb8c7d234a09236d1f26b21e551b622854076fb21bcda44d3'
'266989b0c4a37254a40836a6193284a186230b48716907e4d249d73616f58382b258c41baa8c1ffc98d405f77bfafcd3438f749edcf391c7bd22185399adf4bd'
- 'c17dceeefd58447917e27a33d6688a28158b919c41867909b11478d8be7f155b61ae8fda2e0381c14210583f1c6ecf678dfb469c4826f34e24b8ee0b96a8aaa5'
+ '01f3ada0d121bc8c5a698356aae5f8d5374b3bd5a1023f02ebc9ec6600b4652f4ab7d7ef339df268bfe5054d2a58320d91e79af31e6609b74ba924aef62116e0'
'd927e5e882115c780aa0d45034cb1652eaa191d95c15013639f9172ae734245caae070018465d73fdf86a01601d08c9e65f28468621422d799fe8451e6175cb7'
'625ea754e70793d80da38878e345fefce579416d9daa04439f1c13885aa2a9620307010fe4cf09460677fe2918bd32b62f4ad52b24bab78d82b4e6487cbe5347'
'02e844d1a97dd756d185f7258a6c18d52cf7433f3366e147e5ef0cc0b6c023d177b3021521403237162782993d2a27d4459fa5d383e7bf8a034e7f5836351f9d'
@@ -47,7 +47,7 @@ sha512sums=('SKIP'
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)"
+_pgo=0
pkgver() {
cd Waterfox
@@ -66,11 +66,12 @@ prepare() {
patch -Np1 -i ../firefox-install-dir.patch
# these fix PGO partially
- # patch -Np1 -i ../clang-profile.patch
+ patch -Np1 -i ../clang-profile.patch
- #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
+ 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
+ sed -i 's/disable-tests/enable-tests/g' .mozconfig
+ fi
# fix missing icons
for i in 16 22 24 32 48 256; do
@@ -91,7 +92,9 @@ build() {
if [[ $CARCH = x86_64 ]] && [[ $_pgo = 1 ]]; then
msg2 'PGO build is selected'
- xvfb-run -a -s "-extension GLX -screen 0 1280x1024x24" \
+ #xvfb-run -a -s "-extension GLX -screen 0 1280x1024x24"
+ # this requires you to build within an X console
+ # you may have to close waterfox when the profile generating version of it loads up
make -j -f client.mk profiledbuild
else
msg2 'Non-PGO build is selected or your architecture is not x86_64'
diff --git a/clang-profile.patch b/clang-profile.patch
index 978e07e3dabe..caeb402561b6 100644
--- a/clang-profile.patch
+++ b/clang-profile.patch
@@ -1,7 +1,5 @@
-# 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
+index 3e5a870c33d3..140f6f9c7de3 100644
--- a/build/pgo/profileserver.py
+++ b/build/pgo/profileserver.py
@@ -37,7 +37,7 @@ if __name__ == '__main__':
@@ -21,7 +19,16 @@ index 3e5a870c33..25ef5053a7 100644
env["MOZ_CRASHREPORTER_NO_REPORT"] = "1"
env["XPCOM_DEBUG_BREAK"] = "warn"
-@@ -88,5 +89,13 @@ if __name__ == '__main__':
+@@ -72,7 +73,7 @@ if __name__ == '__main__':
+ binary=build.get_binary_path(where="staged-package"),
+ cmdargs=['javascript:Quitter.quit()'],
+ env=env)
+- runner.start()
++ runner.start(outputTimeout=60) # allow up to 60 seconds to start and create a profile
+ runner.wait()
+
+ jarlog = os.getenv("JARLOG_FILE")
+@@ -88,5 +89,15 @@ if __name__ == '__main__':
runner.start(debug_args=debug_args, interactive=interactive)
runner.wait()
httpd.stop()
@@ -30,16 +37,18 @@ index 3e5a870c33..25ef5053a7 100644
+ # 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!
++ # also, wouldn't it make sense to add an argument to copy an actual user profile,
++ # and start up on the blank tab page when possible for a more real-world loadup? todo?
+ # Matt Parnell/ilikenwf <parwok@gmail.com>
+ os.chdir(build.topobjdir)
-+ os.system("/usr/bin/llvm-profdata merge -output=default.profdata *.profraw &> /dev/null")
++ os.system("llvm-profdata merge -output=/tmp/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
+index 70b6a7dc7af9..832010150cab 100644
--- a/js/src/old-configure.in
+++ b/js/src/old-configure.in
-@@ -1950,13 +1950,18 @@ else
+@@ -1823,13 +1823,18 @@ else
fi
dnl ========================================================
@@ -61,7 +70,7 @@ index c756cd202d..ec2855cb47 100644
AC_MSG_CHECKING([whether C compiler supports -fprofile-generate])
AC_TRY_COMPILE([], [return 0;],
-@@ -1965,11 +1970,15 @@ AC_TRY_COMPILE([], [return 0;],
+@@ -1838,11 +1843,15 @@ AC_TRY_COMPILE([], [return 0;],
AC_MSG_RESULT([$result])
if test $result = "yes"; then
@@ -70,7 +79,7 @@ index c756cd202d..ec2855cb47 100644
- 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'
++ PROFILE_USE_CFLAGS='-fprofile-instr-use=/tmp/default.profdata'
+ else
+ PROFILE_GEN_LDFLAGS="-fprofile-generate"
+ PROFILE_USE_CFLAGS="-fprofile-use -fprofile-correction -Wcoverage-mismatch"
@@ -82,10 +91,10 @@ index c756cd202d..ec2855cb47 100644
AC_SUBST(PROFILE_GEN_CFLAGS)
diff --git a/nsprpub/configure.in b/nsprpub/configure.in
-index 202158b799..c92fdd6aa3 100644
+index 22b4e72245d1..1f565e79d300 100644
--- a/nsprpub/configure.in
+++ b/nsprpub/configure.in
-@@ -716,13 +716,18 @@ else
+@@ -750,13 +750,18 @@ else
fi
dnl ========================================================
@@ -107,7 +116,7 @@ index 202158b799..c92fdd6aa3 100644
AC_MSG_CHECKING([whether C compiler supports -fprofile-generate])
AC_TRY_COMPILE([], [return 0;],
-@@ -731,11 +736,15 @@ AC_TRY_COMPILE([], [return 0;],
+@@ -765,11 +770,15 @@ AC_TRY_COMPILE([], [return 0;],
AC_MSG_RESULT([$result])
if test $result = "yes"; then
@@ -116,7 +125,7 @@ index 202158b799..c92fdd6aa3 100644
- 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'
++ PROFILE_USE_CFLAGS='-fprofile-instr-use=/tmp/default.profdata'
+ else
+ PROFILE_GEN_LDFLAGS="-fprofile-generate"
+ PROFILE_USE_CFLAGS="-fprofile-use -fprofile-correction -Wcoverage-mismatch"
@@ -128,10 +137,10 @@ index 202158b799..c92fdd6aa3 100644
dnl ===============================================================
diff --git a/old-configure.in b/old-configure.in
-index ada5934ec1..d9eefcb3cc 100644
+index 662d77aaf99f..1ef312e22e6b 100644
--- a/old-configure.in
+++ b/old-configure.in
-@@ -5042,13 +5042,18 @@ else
+@@ -4213,13 +4213,18 @@ else
fi
dnl ========================================================
@@ -153,7 +162,7 @@ index ada5934ec1..d9eefcb3cc 100644
AC_MSG_CHECKING([whether C compiler supports -fprofile-generate])
AC_TRY_COMPILE([], [return 0;],
-@@ -5057,11 +5062,15 @@ AC_TRY_COMPILE([], [return 0;],
+@@ -4228,11 +4233,15 @@ AC_TRY_COMPILE([], [return 0;],
AC_MSG_RESULT([$result])
if test $result = "yes"; then
@@ -162,7 +171,7 @@ index ada5934ec1..d9eefcb3cc 100644
- 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'
++ PROFILE_USE_CFLAGS='-fprofile-instr-use=/tmp/default.profdata'
+ else
+ PROFILE_GEN_LDFLAGS="-fprofile-generate"
+ PROFILE_USE_CFLAGS="-fprofile-use -fprofile-correction -Wcoverage-mismatch"