From 17ff895e1cbc685b99b22856aed16852b564c1f4 Mon Sep 17 00:00:00 2001 From: Brian Gianforcaro Date: Fri, 21 May 2021 00:55:47 -0700 Subject: 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. --- Toolchain/BuildIt.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Toolchain') 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 -- cgit v1.2.3