Skip to content

Commit

Permalink
fix: only pass -msse3 if i386 or amd64 (#1608)
Browse files Browse the repository at this point in the history
  • Loading branch information
jm-clius authored Mar 15, 2023
1 parent 08b2180 commit 8dfa246
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion config.nims
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,25 @@ if defined(windows):
# 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):
if defined(macosx):
switch("passC", "-march=haswell -mtune=generic")
switch("passL", "-march=haswell -mtune=generic")
else:
switch("passC", "-msse3")
switch("passL", "-msse3")
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-m1")
switch("passL", "-mcpu=apple-m1")
else:
switch("passC", "-march=native")
switch("passL", "-march=native")
if defined(windows):
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65782
# ("-fno-asynchronous-unwind-tables" breaks Nim's exception raising, sometimes)
switch("passC", "-mno-avx512vl")
switch("passL", "-mno-avx512vl")

--threads:on
--opt:speed
Expand Down

0 comments on commit 8dfa246

Please sign in to comment.