Skip to content

Commit 06dcdbb

Browse files
committed
rewrite macos-fat-archive to rmake
1 parent 52f3c71 commit 06dcdbb

File tree

3 files changed

+20
-11
lines changed

3 files changed

+20
-11
lines changed

src/tools/tidy/src/allowed_run_make_makefiles.txt

-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ run-make/lto-linkage-used-attr/Makefile
7272
run-make/lto-no-link-whole-rlib/Makefile
7373
run-make/lto-smoke-c/Makefile
7474
run-make/macos-deployment-target/Makefile
75-
run-make/macos-fat-archive/Makefile
7675
run-make/manual-link/Makefile
7776
run-make/min-global-align/Makefile
7877
run-make/missing-crate-dependency/Makefile

tests/run-make/macos-fat-archive/Makefile

-10
This file was deleted.
+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// macOS (and iOS) has a concept of universal (fat) binaries which contain code for multiple CPU
2+
// architectures in the same file. Apple is migrating from x86_64 to aarch64 CPUs,
3+
// so for the next few years it will be important for macOS developers to
4+
// build "fat" binaries (executables and cdylibs).
5+
6+
// Rustc used to be unable to handle these special libraries, which was fixed in #98736. If
7+
// compilation in this test is successful, the native fat library was successfully linked to.
8+
// See https://github.com/rust-lang/rust/issues/55235
9+
10+
//@ only-apple
11+
12+
use run_make_support::{cc, llvm_ar, rustc};
13+
14+
fn main() {
15+
cc().args(&["-arch", "arm64", "-arch", "x86_64", "native-library.c", "-c"])
16+
.out_exe("native-library.o")
17+
.run();
18+
llvm_ar().obj_to_ar().output_input("libnative-library.a", "native-library.o").run();
19+
rustc().input("lib.rs").crate_type("lib").arg("-lstatic=native-library").run();
20+
}

0 commit comments

Comments
 (0)