Apple M1 compatibility (#16346)

Co-authored-by: Christian Drappi <christiandrappi@Christians-MacBook-Pro.local>
This commit is contained in:
Christian Drappi
2021-04-09 20:21:01 -04:00
committed by GitHub
parent 8bc0bdd40b
commit 54a04bac3d
15 changed files with 47 additions and 269 deletions

View File

@@ -1390,7 +1390,20 @@ fn report_target_features() {
}
);
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
// We exclude Mac OS here to be compatible with computers that have Mac M1 chips.
// For these computers, one must install rust/cargo/brew etc. using Rosetta 2,
// which allows them to run software targeted for x86_64 on an aarch64.
// Hence the code below will run on these machines (target_arch="x86_64")
// if we don't exclude with target_os="macos".
//
// It's going to require more more work to get Solana building
// on Mac M1's without Rosetta,
// and when that happens we should remove this
// (the feature flag for code targeting that is target_arch="aarch64")
#[cfg(all(
any(target_arch = "x86", target_arch = "x86_64"),
not(target_os = "macos")
))]
{
unsafe { check_avx() };
}