Skip to content

Commit 2c5a761

Browse files
committed
chore: Added release checks to the mozconfig, b=no-bug, c=common, configs
1 parent daae9ac commit 2c5a761

File tree

4 files changed

+76
-73
lines changed

4 files changed

+76
-73
lines changed

configs/common/mozconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# This Source Code Form is subject to the terms of the Mozilla Public
2+
# License, v. 2.0. If a copy of the MPL was not distributed with this
3+
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
4+
15
# Browser branding
26
ac_add_options --with-app-name=${binName}
37
ac_add_options --with-app-basename=Zen

configs/linux/mozconfig

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# This Source Code Form is subject to the terms of the Mozilla Public
2+
# License, v. 2.0. If a copy of the MPL was not distributed with this
3+
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
4+
15
# Setting the compiler based on the existence of clang bin directory
26
if test -d "$HOME/.mozbuild/clang/bin"; then
37
export CC="$HOME/.mozbuild/clang/bin/clang"
@@ -7,48 +11,40 @@ else
711
export CXX=clang++
812
fi
913

10-
if test "$SURFER_COMPAT" = "x86_64"; then
11-
ac_add_options --target=x86_64-pc-linux
12-
ac_add_options --enable-eme=widevine
13-
14-
# Enable Profile Guided Optimization
15-
if test "$ZEN_GA_DISABLE_PGO"; then
16-
export ZEN_DUMMY=1
17-
else
18-
export MOZ_PGO=1
19-
ac_add_options MOZ_PGO=1
14+
if test "$ZEN_RELEASE"; then
15+
if test "$SURFER_COMPAT" = "x86_64"; then
16+
ac_add_options --target=x86_64-pc-linux
17+
ac_add_options --enable-eme=widevine
18+
19+
# Enable Profile Guided Optimization
20+
if test "$ZEN_GA_DISABLE_PGO"; then
21+
export ZEN_DUMMY=1
22+
else
23+
export MOZ_PGO=1
24+
ac_add_options MOZ_PGO=1
25+
fi
26+
27+
# Optimization flags for SURFER_COMPAT
28+
ac_add_options --enable-optimize="-O3 -w -ftree-vectorize -mfpmath=sse -mprfchw -msse3 -mcx16 -msahf"
29+
30+
export LDFLAGS="$LDFLAGS -Wl,-O3"
31+
export RUSTFLAGS="$RUSTFLAGS -Clink-args=--icf=safe"
32+
elif test "$SURFER_COMPAT" = "aarch64"; then
33+
ac_add_options --target=aarch64-linux-gnu
34+
35+
ac_add_options --enable-optimize="-O3"
36+
37+
# override LTO settings
38+
export MOZ_LTO=cross,thin
39+
ac_add_options --enable-lto=cross,thin
40+
41+
export CFLAGS="$CFLAGS -O3"
42+
export CPPFLAGS="$CPPFLAGS -O3"
43+
export CXXFLAGS="$CXXFLAGS -O3"
44+
export LDFLAGS="$LDFLAGS -Wl,-O3"
45+
export RUSTFLAGS="$RUSTFLAGS -Clink-args=--icf=safe"
2046
fi
2147

22-
# Optimization flags for SURFER_COMPAT
23-
ac_add_options --enable-optimize="-O3 -w -ftree-vectorize -mfpmath=sse -mprfchw -msse3 -mcx16 -msahf"
24-
25-
export LDFLAGS="$LDFLAGS -Wl,-O3"
26-
export RUSTFLAGS="$RUSTFLAGS -Clink-args=--icf=safe"
27-
elif test "$SURFER_COMPAT" = "aarch64"; then
28-
ac_add_options --target=aarch64-linux-gnu
29-
30-
ac_add_options --enable-optimize="-O3"
31-
32-
# override LTO settings
33-
export MOZ_LTO=cross,thin
34-
ac_add_options --enable-lto=cross,thin
35-
36-
export CFLAGS="$CFLAGS -O3"
37-
export CPPFLAGS="$CPPFLAGS -O3"
38-
export CXXFLAGS="$CXXFLAGS -O3"
39-
export LDFLAGS="$LDFLAGS -Wl,-O3"
40-
export RUSTFLAGS="$RUSTFLAGS -Clink-args=--icf=safe"
41-
fi
42-
43-
export VERBOSE=1
44-
# Uncomment if you want to enable Polly optimizations
45-
#export POLLY="-mllvm -polly -mllvm -polly-2nd-level-tiling -mllvm -polly-loopfusion-greedy -mllvm -polly-pattern-matching-based-opts -mllvm -polly-position=before-vectorizer -mllvm -polly-vectorizer=stripmine"
46-
47-
# Common options
48-
ac_add_options --enable-alsa
49-
ac_add_options --enable-pulseaudio
50-
51-
if test "$ZEN_RELEASE"; then
5248
# Disable DMD and ELF hacks, enable linker lld
5349
ac_add_options --disable-dmd
5450
ac_add_options --enable-linker=lld
@@ -60,3 +56,7 @@ if test "$ZEN_RELEASE"; then
6056
ac_add_options --enable-strip
6157
export STRIP_FLAGS="--strip-debug --strip-unneeded"
6258
fi
59+
60+
# Common options
61+
ac_add_options --enable-alsa
62+
ac_add_options --enable-pulseaudio

configs/macos/mozconfig

Lines changed: 29 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# This Source Code Form is subject to the terms of the Mozilla Public
2+
# License, v. 2.0. If a copy of the MPL was not distributed with this
3+
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
4+
15
unset MOZ_STDCXX_COMPAT
26

37
ac_add_options --disable-dmd
@@ -15,38 +19,31 @@ if test "$ZEN_RELEASE"; then
1519
export MOZ_PGO=1
1620
ac_add_options MOZ_PGO=1
1721
fi
18-
fi
1922

20-
if test "$SURFER_COMPAT" = "x86_64"; then
21-
ac_add_options --target=x86_64-apple-darwin
22-
23-
ac_add_options --enable-wasm-avx
24-
ac_add_options --enable-optimize="-march=nehalem -mtune=haswell -O3 -w"
25-
26-
export CFLAGS="-O3 -march=nehalem"
27-
export CPPFLAGS="-O3 -march=nehalem"
28-
export CXXFLAGS="-O3 -march=nehalem"
29-
export LDFLAGS="-Wl,-O3 -march=nehalem"
30-
export RUSTFLAGS="-Ctarget-cpu=nehalem"
31-
else
32-
ac_add_options --enable-clang-plugin
33-
ac_add_options --target=aarch64-apple-darwin
34-
35-
ac_add_options --enable-optimize="-O3 -mcpu=apple-m1 -march=armv8.3-a+simd"
36-
37-
# As of Clang 13, the default is -mcpu=apple-m1 when using a aarch64-apple-macos target,
38-
# but we're using apple64-apple-darwin, which defaults to -mcpu=apple-a7, which disables
39-
# a bunch of # performance-enabling CPU features.
40-
export CFLAGS="-O3 -march=armv8.3-a+simd -mcpu=apple-m1"
41-
export CPPFLAGS="-O3 -march=armv8.3-a+simd -mcpu=apple-m1"
42-
export CXXFLAGS="-O3 -march=armv8.3-a+simd -mcpu=apple-m1"
43-
export LDFLAGS="-Wl,-O3 -march=armv8.3-a+simd -mcpu=apple-m1"
44-
export RUSTFLAGS="-C target-feature=+v8.3a -Ctarget-cpu=apple-m1"
45-
fi
23+
if test "$SURFER_COMPAT" = "x86_64"; then
24+
ac_add_options --target=x86_64-apple-darwin
4625

47-
export VERBOSE=1
26+
ac_add_options --enable-wasm-avx
27+
ac_add_options --enable-optimize="-march=nehalem -mtune=haswell -O3 -w"
4828

49-
# Enable polly for macos, since they have a more stable set of GPU drivers,
50-
# unlike Linux, which has a lot of different drivers.
51-
# Edit: let's run some experiments, see if RAM usage lowers significantly
52-
# export POLLY="-mllvm -polly -mllvm -polly-2nd-level-tiling -mllvm -polly-loopfusion-greedy -mllvm -polly-pattern-matching-based-opts -mllvm -polly-position=before-vectorizer -mllvm -polly-vectorizer=stripmine"
29+
export CFLAGS="-O3 -march=nehalem"
30+
export CPPFLAGS="-O3 -march=nehalem"
31+
export CXXFLAGS="-O3 -march=nehalem"
32+
export LDFLAGS="-Wl,-O3 -march=nehalem"
33+
export RUSTFLAGS="-Ctarget-cpu=nehalem"
34+
else
35+
ac_add_options --enable-clang-plugin
36+
ac_add_options --target=aarch64-apple-darwin
37+
38+
ac_add_options --enable-optimize="-O3 -mcpu=apple-m1 -march=armv8.3-a+simd"
39+
40+
# As of Clang 13, the default is -mcpu=apple-m1 when using a aarch64-apple-macos target,
41+
# but we're using apple64-apple-darwin, which defaults to -mcpu=apple-a7, which disables
42+
# a bunch of # performance-enabling CPU features.
43+
export CFLAGS="-O3 -march=armv8.3-a+simd -mcpu=apple-m1"
44+
export CPPFLAGS="-O3 -march=armv8.3-a+simd -mcpu=apple-m1"
45+
export CXXFLAGS="-O3 -march=armv8.3-a+simd -mcpu=apple-m1"
46+
export LDFLAGS="-Wl,-O3 -march=armv8.3-a+simd -mcpu=apple-m1"
47+
export RUSTFLAGS="-C target-feature=+v8.3a -Ctarget-cpu=apple-m1"
48+
fi
49+
fi

configs/windows/mozconfig

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# This Source Code Form is subject to the terms of the Mozilla Public
2+
# License, v. 2.0. If a copy of the MPL was not distributed with this
3+
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
14

25
if test "$ZEN_CROSS_COMPILING"; then
36

@@ -53,7 +56,6 @@ elif test "$SURFER_COMPAT" = "aarch64"; then
5356
fi
5457

5558
#export POLLY="-mllvm -polly -mllvm -polly-2nd-level-tiling -mllvm -polly-loopfusion-greedy -mllvm -polly-pattern-matching-based-opts -mllvm -polly-position=before-vectorizer -mllvm -polly-vectorizer=stripmine"
56-
export VERBOSE=1
5759

5860
if test "$ZEN_CROSS_COMPILING"; then
5961
if test "$ZEN_GA_GENERATE_PROFILE"; then

0 commit comments

Comments
 (0)