From 1cc32c9cda2d4a9dbfd46426039277ac2c5dbf21 Mon Sep 17 00:00:00 2001 From: Alfonso Subiotto Marques Date: Mon, 7 Jun 2021 10:19:37 +0200 Subject: [PATCH] Disable reed-solomon-erasure/simd-accel feature on aarch64 (Apple M1) This feature requires clang to support -march=native on M1. Before this change, cargo build would output a build error when building for aarch64. (cherry picked from commit 8a9b7f5ef272996c78ec15694678833cf85ddce4) # Conflicts: # ledger/Cargo.toml --- Cargo.toml | 5 +++++ ledger/Cargo.toml | 12 ++++++++++++ 2 files changed, 17 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 0b24a45a2b..4d3e377cbb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -76,5 +76,10 @@ exclude = [ "programs/bpf", ] +# TODO: Remove once the "simd-accel" feature from the reed-solomon-erasure +# dependency is supported on Apple M1. v2 of the feature resolver is needed to +# specify arch-specific features. +resolver = "2" + [profile.dev] split-debuginfo = "unpacked" diff --git a/ledger/Cargo.toml b/ledger/Cargo.toml index ef7e7ddeea..9d63a7dcb3 100644 --- a/ledger/Cargo.toml +++ b/ledger/Cargo.toml @@ -30,8 +30,12 @@ prost = "0.8.0" rand = "0.7.0" rand_chacha = "0.2.2" rayon = "1.5.0" +<<<<<<< HEAD reed-solomon-erasure = { version = "4.0.2", features = ["simd-accel"] } serde = "1.0.122" +======= +serde = "1.0.126" +>>>>>>> 8a9b7f5ef (Disable reed-solomon-erasure/simd-accel feature on aarch64 (Apple M1)) serde_bytes = "0.11.5" sha2 = "0.9.2" solana-bpf-loader-program = { path = "../programs/bpf_loader", version = "=1.7.9" } @@ -55,6 +59,14 @@ tokio = { version = "1", features = ["full"] } tokio-stream = "0.1" trees = "0.2.1" +# Disable reed-solomon-erasure/simd-accel feature on aarch64 only since it +# requires clang to support -march=native. +[target.'cfg(any(target_arch = "aarch64", target_arch = "aarch64_apple_darwin"))'.dependencies] +reed-solomon-erasure = { version = "4.0.2" } + +[target.'cfg(not(any(target_arch = "aarch64", target_arch = "aarch64_apple_darwin")))'.dependencies] +reed-solomon-erasure = { version = "4.0.2", features = ["simd-accel"] } + [dependencies.rocksdb] # Avoid the vendored bzip2 within rocksdb-sys that can cause linker conflicts # when also using the bzip2 crate