From 42711a079ba8d963c294f0eeb92d65d6e9bf9523 Mon Sep 17 00:00:00 2001 From: Mauro Balades Date: Mon, 15 Jul 2024 01:09:25 +0200 Subject: [PATCH] Added test LTO flags --- configs/common/mozconfig | 25 ++++++++++++++++- .../protocol/http/nsHttpHandler-cpp.patch | 27 +++++++++++++++++++ 2 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 src/netwerk/protocol/http/nsHttpHandler-cpp.patch diff --git a/configs/common/mozconfig b/configs/common/mozconfig index b4b78e8b6..06d448981 100644 --- a/configs/common/mozconfig +++ b/configs/common/mozconfig @@ -3,7 +3,7 @@ ac_add_options --enable-update-channel=release ac_add_options --without-wasm-sandboxed-libraries -# ac_add_options --with-branding=beta +ac_add_options --with-branding=${brandingDir} ac_add_options --with-app-name=${binName} export MOZ_USER_DIR="${name}" @@ -37,6 +37,7 @@ if test "$ZEN_RELEASE"; then ac_add_options --enable-optimize ac_add_options --with-ccache=sccache ac_add_options --disable-debug + ac_add_options --disable-debug-js-modules ac_add_options --disable-crashreporter ac_add_options --disable-dmd @@ -44,6 +45,28 @@ if test "$ZEN_RELEASE"; then ac_add_options --disable-parental-controls ac_add_options --disable-profiling ac_add_options --disable-tests + + ac_add_options --enable-clang-plugin + ac_add_options --enable-lto + + mk_add_options MOZILLA_OFFICIAL=1 + + MOZILLA_OFFICIAL=1 + export MOZILLA_OFFICIAL=1 + mk_add_options MOZ_OPTIMIZE=1 + MOZ_OPTIMIZE=1 + export MOZ_OPTIMIZE=1 + export STRIP_FLAGS="--strip-debug --strip-unneeded" + + export OPT_LEVEL="3" + ac_add_options OPT_LEVEL="3" + export RUSTC_OPT_LEVEL="3" + ac_add_options RUSTC_OPT_LEVEL="3" + + export MOZ_LTO=1 + ac_add_options MOZ_LTO=1 + export MOZ_PGO=1 + ac_add_options MOZ_PGO=1 fi ac_add_options --enable-unverified-updates diff --git a/src/netwerk/protocol/http/nsHttpHandler-cpp.patch b/src/netwerk/protocol/http/nsHttpHandler-cpp.patch new file mode 100644 index 000000000..45a6548b8 --- /dev/null +++ b/src/netwerk/protocol/http/nsHttpHandler-cpp.patch @@ -0,0 +1,27 @@ +diff --git a/netwerk/protocol/http/nsHttpHandler.cpp b/netwerk/protocol/http/nsHttpHandler.cpp +index 0ddb378e2b2ca20edc9cf7494d80d308d8cf51eb..79d8797fe31f678d7a712ddcd11eb90a727319a6 100644 +--- a/netwerk/protocol/http/nsHttpHandler.cpp ++++ b/netwerk/protocol/http/nsHttpHandler.cpp +@@ -860,19 +860,9 @@ void nsHttpHandler::BuildUserAgent() { + mUserAgent += '/'; + mUserAgent += mProductSub; + +- bool isFirefox = mAppName.EqualsLiteral("Firefox"); +- if (isFirefox || mCompatFirefoxEnabled) { +- // "Firefox/x.y" (compatibility) app token +- mUserAgent += ' '; +- mUserAgent += mCompatFirefox; +- } +- if (!isFirefox) { +- // App portion +- mUserAgent += ' '; +- mUserAgent += mAppName; +- mUserAgent += '/'; +- mUserAgent += mAppVersion; +- } ++ ++ mUserAgent += ' '; ++ mUserAgent += mCompatFirefox; + } + + #ifdef XP_WIN