Skip to content

Commit b73ada8

Browse files
authored
fix: only pass -msse3 if i386 or amd64 (#1608)
1 parent 0843efe commit b73ada8

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

config.nims

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,25 @@ if defined(windows):
2424
# engineering a more portable binary release, this should be tweaked but still
2525
# use at least -msse2 or -msse3.
2626
if defined(disableMarchNative):
27-
switch("passC", "-msse3")
27+
if defined(i386) or defined(amd64):
28+
if defined(macosx):
29+
switch("passC", "-march=haswell -mtune=generic")
30+
switch("passL", "-march=haswell -mtune=generic")
31+
else:
32+
switch("passC", "-msse3")
33+
switch("passL", "-msse3")
2834
elif defined(macosx) and defined(arm64):
2935
# Apple's Clang can't handle "-march=native" on M1: https://github.com/status-im/nimbus-eth2/issues/2758
3036
switch("passC", "-mcpu=apple-m1")
3137
switch("passL", "-mcpu=apple-m1")
3238
else:
3339
switch("passC", "-march=native")
40+
switch("passL", "-march=native")
3441
if defined(windows):
3542
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65782
3643
# ("-fno-asynchronous-unwind-tables" breaks Nim's exception raising, sometimes)
3744
switch("passC", "-mno-avx512vl")
45+
switch("passL", "-mno-avx512vl")
3846

3947
--threads:on
4048
--opt:speed

0 commit comments

Comments
 (0)