summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Gianforcaro <bgianf@serenityos.org>2021-05-21 00:55:47 -0700
committerLinus Groh <mail@linusgroh.de>2021-05-21 10:04:49 +0100
commit17ff895e1cbc685b99b22856aed16852b564c1f4 (patch)
tree7dad09614061cca7d1dc4a282fc5dae075d5c86a
parent413d98fb45f717b2732a93bd26c8156ef7a87fa6 (diff)
downloadserenity-17ff895e1cbc685b99b22856aed16852b564c1f4.zip
Toolchain: Enable native host optimizations when building toolchain
-march=native specializes the binaries for the CPU features available on the CPU the binary is being compiled on. This matches the needs of the Toolchain, as it's always built and used on that machine only. This should be safe for the github actions VMs as well, as they all run on a standard VM SKU in "the cloud". I saw small but notable improvements in end-2-end build times in my local testing. Each compilation unit is on average around a second faster on my Intel(R) Core(TM) i7-8705G CPU @ 3.10GHz.
-rwxr-xr-xToolchain/BuildIt.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/Toolchain/BuildIt.sh b/Toolchain/BuildIt.sh
index ff0c861ffd..9aa4a1dbdd 100755
--- a/Toolchain/BuildIt.sh
+++ b/Toolchain/BuildIt.sh
@@ -31,8 +31,8 @@ SYSTEM_NAME="$(uname -s)"
# We *most definitely* don't need debug symbols in the linker/compiler.
# This cuts the uncompressed size from 1.2 GiB per Toolchain down to about 120 MiB.
# Hence, this might actually cause marginal speedups, although the point is to not waste space as blatantly.
-export CFLAGS="-g0 -O2"
-export CXXFLAGS="-g0 -O2"
+export CFLAGS="-g0 -O2 -march=native"
+export CXXFLAGS="-g0 -O2 -march=native"
if [ "$SYSTEM_NAME" = "OpenBSD" ]; then
MAKE=gmake