summaryrefslogtreecommitdiffstats
path: root/tests/run-make/macos-fat-archive
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:18:58 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:18:58 +0000
commita4b7ed7a42c716ab9f05e351f003d589124fd55d (patch)
treeb620cd3f223850b28716e474e80c58059dca5dd4 /tests/run-make/macos-fat-archive
parentAdding upstream version 1.67.1+dfsg1. (diff)
downloadrustc-a4b7ed7a42c716ab9f05e351f003d589124fd55d.tar.xz
rustc-a4b7ed7a42c716ab9f05e351f003d589124fd55d.zip
Adding upstream version 1.68.2+dfsg1.upstream/1.68.2+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/run-make/macos-fat-archive')
-rw-r--r--tests/run-make/macos-fat-archive/Makefile10
-rw-r--r--tests/run-make/macos-fat-archive/lib.rs3
-rw-r--r--tests/run-make/macos-fat-archive/native-library.c1
3 files changed, 14 insertions, 0 deletions
diff --git a/tests/run-make/macos-fat-archive/Makefile b/tests/run-make/macos-fat-archive/Makefile
new file mode 100644
index 000000000..cc99375db
--- /dev/null
+++ b/tests/run-make/macos-fat-archive/Makefile
@@ -0,0 +1,10 @@
+# only-macos
+
+-include ../../run-make-fulldeps/tools.mk
+
+"$(TMPDIR)"/libnative-library.a: native-library.c
+ $(CC) -arch arm64 -arch x86_64 native-library.c -c -o "$(TMPDIR)"/native-library.o
+ $(AR) crs "$(TMPDIR)"/libnative-library.a "$(TMPDIR)"/native-library.o
+
+all: "$(TMPDIR)"/libnative-library.a
+ $(RUSTC) lib.rs --crate-type=lib -L "native=$(TMPDIR)" -l static=native-library
diff --git a/tests/run-make/macos-fat-archive/lib.rs b/tests/run-make/macos-fat-archive/lib.rs
new file mode 100644
index 000000000..9943a266c
--- /dev/null
+++ b/tests/run-make/macos-fat-archive/lib.rs
@@ -0,0 +1,3 @@
+extern "C" {
+ pub fn native_func();
+}
diff --git a/tests/run-make/macos-fat-archive/native-library.c b/tests/run-make/macos-fat-archive/native-library.c
new file mode 100644
index 000000000..d300fdf1c
--- /dev/null
+++ b/tests/run-make/macos-fat-archive/native-library.c
@@ -0,0 +1 @@
+void native_func() {}