Skip to content

Commit

Permalink
Enable LTO (Link Time Optimization) in platform-specific mozconfig files
Browse files Browse the repository at this point in the history
  • Loading branch information
mr-cheff committed Dec 22, 2024
1 parent 1e92783 commit a7b486d
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 5 deletions.
5 changes: 0 additions & 5 deletions configs/common/mozconfig
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,6 @@ if test "$ZEN_RELEASE"; then
# Done by vlad, if something fails, it's his fault
ac_add_options --disable-default-browser-agent

if ! test "$ZEN_DISABLE_LTO"; then
export MOZ_LTO=cross,thin
ac_add_options --enable-lto=cross,thin
fi

ac_add_options --enable-jemalloc

mk_add_options MOZILLA_OFFICIAL=1
Expand Down
10 changes: 10 additions & 0 deletions configs/linux/mozconfig
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ if test "$SURFER_COMPAT" = "x86_64"; then
# Optimization flags for SURFER_COMPAT
ac_add_options --enable-optimize="-O3 -march=x86-64"

if ! test "$ZEN_DISABLE_LTO"; then
export MOZ_LTO=cross,thin
ac_add_options --enable-lto=cross,thin
fi

export CFLAGS="$CFLAGS -O3 -ffp-contract=fast -march=x86-64"
export CPPFLAGS="$CPPFLAGS -O3 -ffp-contract=fast -march=x86-64"
export CXXFLAGS="$CXXFLAGS -O3 -flto=thin -ffp-contract=fast -march=x86-64"
Expand All @@ -28,6 +33,11 @@ elif test "$SURFER_COMPAT" = "aarch64"; then

ac_add_options --enable-optimize="-O3"

if ! test "$ZEN_DISABLE_LTO"; then
export MOZ_LTO=cross,thin
ac_add_options --enable-lto=cross,thin
fi

export CFLAGS="$CFLAGS -O3"
export CPPFLAGS="$CPPFLAGS -O3"
export CXXFLAGS="$CXXFLAGS -O3"
Expand Down
5 changes: 5 additions & 0 deletions configs/macos/mozconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ ac_add_options MOZ_PGO=1

ac_add_options --enable-clang-plugin

if ! test "$ZEN_DISABLE_LTO"; then
export MOZ_LTO=cross,thin
ac_add_options --enable-lto=cross,thin
fi

if test "$SURFER_COMPAT" = "x86_64"; then
ac_add_options --target=x86_64-apple-darwin

Expand Down
5 changes: 5 additions & 0 deletions configs/windows/mozconfig
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ fi
ac_add_options --disable-maintenance-service
ac_add_options --disable-bits-download

if ! test "$ZEN_DISABLE_LTO"; then
export MOZ_LTO=cross,thin
ac_add_options --enable-lto=cross,thin
fi

if test "$SURFER_COMPAT" = "x86_64"; then
ac_add_options --target=x86_64-pc-windows-msvc
ac_add_options --enable-eme=widevine
Expand Down

0 comments on commit a7b486d

Please sign in to comment.