Fix cross build bug for aarch64 with simd-accel #100
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This patch has done 3 things:
Fix cross build bug for aarch64 with simd-accel
The current logic in build.rs
#[cfg(target_arch = "x86_64")]
will fail when cross build for aarch64.As the build.rs will be compiled to a binary on host, the
target_arch
value will be set to host architecture.Instead, we should read
target_arch
from environment. Reproduce it on a x86_64 linux host:cargo build --target=aarch64-unknown-linux-gnu --features=simd-accel -vv
Set -march=armv8-a as default value for aarch64
I think we should set a default -march value for aarch64, and this has been tested for aarch64-linux and aarch64-darwin (Apple M1).
Enable aarch64 + simd-accel for Android build
Enable simd-accel feature for android, and maybe we can also do it for iOS?
I don't know much about MacOS and iOS, please correct me if there is any mistake~
releated: #98 #95 #92