Skip to content

Commit

Permalink
Merge pull request #148 from rust-cross/aarch64-armv8-a
Browse files Browse the repository at this point in the history
Fix build for aarch64 linux with `-march=armv8-a`
  • Loading branch information
messense authored Jul 6, 2023
2 parents e5f8504 + 11b4877 commit 832bed2
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 27 deletions.
17 changes: 13 additions & 4 deletions src/zig.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,21 @@ impl Zig {
return None;
} else if is_riscv64 {
return Some("-march=generic_rv64".to_string());
} else if arg.starts_with("-march=armv8-a")
&& target
} else if arg.starts_with("-march=armv8-a") {
if target
.map(|x| x.starts_with("aarch64-macos"))
.unwrap_or_default()
{
return Some(arg.replace("armv8-a", "apple_a14"));
{
return Some(arg.replace("armv8-a", "apple_a14"));
} else if target
.map(|x| x.starts_with("aarch64-linux"))
.unwrap_or_default()
{
return Some(
arg.replace("armv8-a", "generic+v8a")
.replace("simd", "neon"),
);
}
}
}
Some(arg.to_string())
Expand Down
27 changes: 6 additions & 21 deletions tests/hello-cmake/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tests/hello-cmake/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
libz-sys = { version = "1.1.8", default-features = false, features = ["zlib-ng"] }
libz-ng-sys = "1.1.9"
2 changes: 1 addition & 1 deletion tests/hello-cmake/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::ffi::CStr;

use libz_sys::zlibVersion;
use libz_ng_sys::zlibVersion;

fn main() {
let ver = unsafe { zlibVersion() };
Expand Down

0 comments on commit 832bed2

Please sign in to comment.