From 6fe94710778e879e18706dc37a645646fc5a63d7 Mon Sep 17 00:00:00 2001 From: Konstantin Kharlamov Date: Tue, 24 Dec 2024 18:38:29 +0300 Subject: [PATCH] Use `-march=native` when building from install_easy.sh install_easy.sh is used for local installation, which implies that if it invokes make, the binaries are not being cross-compiled. That allows us to pass `-march=native` to make sure the binaries are optimized for the current CPU. We prepend `-march=native` to CFLAGS to make sure that if a user sets CFLAGS with a distinct `-march` option, ours will get overwritten. --- install_easy.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_easy.sh b/install_easy.sh index c49f838..165acfe 100755 --- a/install_easy.sh +++ b/install_easy.sh @@ -70,7 +70,7 @@ check_bins() elif [ -f "$EXEDIR/Makefile" ] && exists make; then echo trying to compile [ "$SYSTEM" = "macos" ] && make_target=mac - make -C "$EXEDIR" $make_target || { + CFLAGS="-march=native ${CFLAGS}" make -C "$EXEDIR" $make_target || { echo could not compile make -C "$EXEDIR" clean exitp 8