Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build for aarch64 linux with -march=armv8-a #148

Merged
merged 1 commit into from
Jul 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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