Apple M1: proper "-march=native" substitute

This commit is contained in:
Ștefan Talpalaru 2021-12-17 04:10:30 +01:00 committed by zah
parent d7799ecdcc
commit 72658d42d2
1 changed files with 5 additions and 2 deletions

View File

@ -78,11 +78,14 @@ if defined(windows):
# given its near-ubiquity in the x86 installed base, it renders a distribution
# build more viable on an overall broader range of hardware.
#
# Apple's Clang can't handle "-march=native" on M1: https://github.com/status-im/nimbus-eth2/issues/2758
if defined(disableMarchNative) or (defined(macosx) and defined(arm64)):
if defined(disableMarchNative):
if defined(i386) or defined(amd64):
switch("passC", "-mssse3")
switch("passL", "-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")
switch("passL", "-mcpu=apple-a14")
else:
switch("passC", "-march=native")
switch("passL", "-march=native")