From 9f90054f75531cc5a2c027e2685bb20b6bdc1ca8 Mon Sep 17 00:00:00 2001 From: Csaba Kiraly Date: Tue, 17 May 2022 16:27:59 +0200 Subject: [PATCH] enable build on Mac M1 - On Mac, -march=native is only supported in newest Clang versions, better disable it for now. - Bumping Leopard version to one that support arm64 Signed-off-by: Csaba Kiraly --- config.nims | 8 +++++++- vendor/nim-leopard | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/config.nims b/config.nims index 350232527..d43c6d7cb 100644 --- a/config.nims +++ b/config.nims @@ -25,8 +25,14 @@ if defined(windows): # and larger arithmetic use cases, along with register starvation issues. When # engineering a more portable binary release, this should be tweaked but still # use at least -msse2 or -msse3. + if defined(disableMarchNative): - switch("passC", "-msse3") + if defined(i386) or defined(amd64): + switch("passC", "-mssse3") +elif defined(macosx) and defined(arm64): + # Apple's Clang can't handle "-march=native" on M1: https://github.com/status-im/nimbus-eth2/issues/2758 + switch("passC", "-mcpu=apple-a14") + # TODO: newer Clang >=15.0 can: https://github.com/llvm/llvm-project/commit/fcca10c69aaab539962d10fcc59a5f074b73b0de else: switch("passC", "-march=native") if defined(windows): diff --git a/vendor/nim-leopard b/vendor/nim-leopard index 41cd86df5..2a6a63923 160000 --- a/vendor/nim-leopard +++ b/vendor/nim-leopard @@ -1 +1 @@ -Subproject commit 41cd86df5bfa67afe7d3660e8ab0878133c8600e +Subproject commit 2a6a63923e9b95676b5ae7ff2c346be0e63e753c