Skip to content

Commit

Permalink
enable build on Mac M1
Browse files Browse the repository at this point in the history
- 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 <[email protected]>
  • Loading branch information
cskiraly committed May 17, 2022
1 parent d669e34 commit 9577e2c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion config.nims
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion vendor/nim-leopard

0 comments on commit 9577e2c

Please sign in to comment.