diff --git a/configs/linux/mozconfig b/configs/linux/mozconfig index 97f55ef9a..4be21e2eb 100644 --- a/configs/linux/mozconfig +++ b/configs/linux/mozconfig @@ -1,57 +1,55 @@ # Setting the compiler based on the existence of clang bin directory -if test "$ZEN_RELEASE"; then - if test -d "$HOME/.mozbuild/clang/bin"; then - export CC="$HOME/.mozbuild/clang/bin/clang" - export CXX="$HOME/.mozbuild/clang/bin/clang++" - else - export CC=clang - export CXX=clang++ - fi +if test -d "$HOME/.mozbuild/clang/bin"; then + export CC="$HOME/.mozbuild/clang/bin/clang" + export CXX="$HOME/.mozbuild/clang/bin/clang++" +else + export CC=clang + export CXX=clang++ +fi - if test "$SURFER_COMPAT" = "x86_64"; then - ac_add_options --target=x86_64-pc-linux - ac_add_options --enable-eme=widevine +if test "$SURFER_COMPAT" = "x86_64"; then + ac_add_options --target=x86_64-pc-linux + ac_add_options --enable-eme=widevine - # Enable Profile Guided Optimization - export MOZ_PGO=1 - ac_add_options MOZ_PGO=1 + # Enable Profile Guided Optimization + export MOZ_PGO=1 + ac_add_options MOZ_PGO=1 - # Optimization flags for SURFER_COMPAT - ac_add_options --enable-optimize="-O3 -march=x86-64" + # Optimization flags for SURFER_COMPAT + ac_add_options --enable-optimize="-O3 -march=x86-64" - 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" - export LDFLAGS="$LDFLAGS -Wl,-O3 -Wl,-mllvm,-fp-contract=fast -march=x86-64" - export RUSTFLAGS="$RUSTFLAGS -C target-cpu=x86-64 -C codegen-units=1 -Clink-args=--icf=safe" - elif test "$SURFER_COMPAT" = "aarch64"; then - ac_add_options --target=aarch64-linux-gnu + 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" + export LDFLAGS="$LDFLAGS -Wl,-O3 -Wl,-mllvm,-fp-contract=fast -march=x86-64" + export RUSTFLAGS="$RUSTFLAGS -C target-cpu=x86-64 -C codegen-units=1 -Clink-args=--icf=safe" +elif test "$SURFER_COMPAT" = "aarch64"; then + ac_add_options --target=aarch64-linux-gnu - ac_add_options --enable-optimize="-O3" + ac_add_options --enable-optimize="-O3" - export CFLAGS="$CFLAGS -O3" - export CPPFLAGS="$CPPFLAGS -O3" - export CXXFLAGS="$CXXFLAGS -O3" - export LDFLAGS="$LDFLAGS -Wl,-O3" - export RUSTFLAGS="$RUSTFLAGS -C codegen-units=1 -Clink-args=--icf=safe" - else - ac_add_options --target=x86_64-pc-linux - ac_add_options --enable-eme=widevine + export CFLAGS="$CFLAGS -O3" + export CPPFLAGS="$CPPFLAGS -O3" + export CXXFLAGS="$CXXFLAGS -O3" + export LDFLAGS="$LDFLAGS -Wl,-O3" + export RUSTFLAGS="$RUSTFLAGS -C codegen-units=1 -Clink-args=--icf=safe" +elif test "$ZEN_RELEASE"; then + ac_add_options --target=x86_64-pc-linux + ac_add_options --enable-eme=widevine - # Enable Profile Guided Optimization - export MOZ_PGO=1 - ac_add_options MOZ_PGO=1 + # Enable Profile Guided Optimization + export MOZ_PGO=1 + ac_add_options MOZ_PGO=1 - # Optimization flags for general release - ac_add_options --enable-wasm-avx - ac_add_options --enable-optimize="-O3 -march=x86-64-v3 -msse3 -mssse3 -msse4.1 -msse4.2 -mavx -maes -mpopcnt -mpclmul" - - export CFLAGS="$CFLAGS -O3 -ffp-contract=fast -march=x86-64-v3 -msse3 -mssse3 -msse4.1 -msse4.2 -mavx -mavx2 -mfma -maes -mpopcnt -mpclmul" - export CPPFLAGS="$CPPFLAGS -O3 -ffp-contract=fast -march=x86-64-v3 -msse3 -mssse3 -msse4.1 -msse4.2 -mavx -mavx2 -mfma -maes -mpopcnt -mpclmul" - export CXXFLAGS="$CXXFLAGS -O3 -flto=thin -ffp-contract=fast -march=x86-64-v3 -msse3 -mssse3 -msse4.1 -msse4.2 -mavx -mavx2 -mfma -maes -mpopcnt -mpclmul" - export LDFLAGS="$LDFLAGS -Wl,-O3 -Wl,-mllvm,-fp-contract=fast -march=x86-64-v3" - export RUSTFLAGS="$RUSTFLAGS -C target-cpu=x86-64-v3 -C target-feature=+sse4.1 -C target-feature=+avx2 -C codegen-units=1 -Clink-args=--icf=safe" - fi + # Optimization flags for general release + ac_add_options --enable-wasm-avx + ac_add_options --enable-optimize="-O3 -march=x86-64-v3 -msse3 -mssse3 -msse4.1 -msse4.2 -mavx -maes -mpopcnt -mpclmul" + + export CFLAGS="$CFLAGS -O3 -ffp-contract=fast -march=x86-64-v3 -msse3 -mssse3 -msse4.1 -msse4.2 -mavx -mavx2 -mfma -maes -mpopcnt -mpclmul" + export CPPFLAGS="$CPPFLAGS -O3 -ffp-contract=fast -march=x86-64-v3 -msse3 -mssse3 -msse4.1 -msse4.2 -mavx -mavx2 -mfma -maes -mpopcnt -mpclmul" + export CXXFLAGS="$CXXFLAGS -O3 -flto=thin -ffp-contract=fast -march=x86-64-v3 -msse3 -mssse3 -msse4.1 -msse4.2 -mavx -mavx2 -mfma -maes -mpopcnt -mpclmul" + export LDFLAGS="$LDFLAGS -Wl,-O3 -Wl,-mllvm,-fp-contract=fast -march=x86-64-v3" + export RUSTFLAGS="$RUSTFLAGS -C target-cpu=x86-64-v3 -C target-feature=+sse4.1 -C target-feature=+avx2 -C codegen-units=1 -Clink-args=--icf=safe" fi export VERBOSE=1