Skip to content

Commit cf0a78b

Browse files
authored
Fix "-arch arm64" flag for aarch64-ios-sim (#759)
1 parent 621ba2c commit cf0a78b

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/lib.rs

+8-2
Original file line numberDiff line numberDiff line change
@@ -2212,7 +2212,7 @@ impl Build {
22122212
}
22132213
} else if is_sim {
22142214
match arch {
2215-
"arm64" | "aarch64" => ArchSpec::Simulator("-arch arm64"),
2215+
"arm64" | "aarch64" => ArchSpec::Simulator("arm64"),
22162216
"x86_64" => ArchSpec::Simulator("-m64"),
22172217
_ => {
22182218
return Err(Error::new(
@@ -2262,7 +2262,13 @@ impl Build {
22622262
format!("{}os", sdk_prefix)
22632263
}
22642264
ArchSpec::Simulator(arch) => {
2265-
cmd.args.push(arch.into());
2265+
if arch.starts_with('-') {
2266+
// -m32 or -m64
2267+
cmd.args.push(arch.into());
2268+
} else {
2269+
cmd.args.push("-arch".into());
2270+
cmd.args.push(arch.into());
2271+
}
22662272
cmd.args
22672273
.push(format!("-m{}simulator-version-min={}", sim_prefix, min_version).into());
22682274
format!("{}simulator", sdk_prefix)

0 commit comments

Comments
 (0)