From 698f8c2f01ea549d77d7dc3338a12e04c11057b9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:02:58 +0200 Subject: Adding upstream version 1.64.0+dfsg1. Signed-off-by: Daniel Baumann --- src/test/run-make-fulldeps/c-dynamic-rlib/Makefile | 15 +++++++++++++++ src/test/run-make-fulldeps/c-dynamic-rlib/bar.rs | 5 +++++ src/test/run-make-fulldeps/c-dynamic-rlib/cfoo.c | 4 ++++ src/test/run-make-fulldeps/c-dynamic-rlib/foo.rs | 10 ++++++++++ 4 files changed, 34 insertions(+) create mode 100644 src/test/run-make-fulldeps/c-dynamic-rlib/Makefile create mode 100644 src/test/run-make-fulldeps/c-dynamic-rlib/bar.rs create mode 100644 src/test/run-make-fulldeps/c-dynamic-rlib/cfoo.c create mode 100644 src/test/run-make-fulldeps/c-dynamic-rlib/foo.rs (limited to 'src/test/run-make-fulldeps/c-dynamic-rlib') diff --git a/src/test/run-make-fulldeps/c-dynamic-rlib/Makefile b/src/test/run-make-fulldeps/c-dynamic-rlib/Makefile new file mode 100644 index 000000000..91343e73e --- /dev/null +++ b/src/test/run-make-fulldeps/c-dynamic-rlib/Makefile @@ -0,0 +1,15 @@ +-include ../tools.mk + +# ignore-macos +# +# This hits an assertion in the linker on older versions of osx apparently + +# This overrides the LD_LIBRARY_PATH for RUN +TARGET_RPATH_DIR:=$(TARGET_RPATH_DIR):$(TMPDIR) + +all: $(call DYLIB,cfoo) + $(RUSTC) foo.rs + $(RUSTC) bar.rs + $(call RUN,bar) + $(call REMOVE_DYLIBS,cfoo) + $(call FAIL,bar) diff --git a/src/test/run-make-fulldeps/c-dynamic-rlib/bar.rs b/src/test/run-make-fulldeps/c-dynamic-rlib/bar.rs new file mode 100644 index 000000000..b8c798ffd --- /dev/null +++ b/src/test/run-make-fulldeps/c-dynamic-rlib/bar.rs @@ -0,0 +1,5 @@ +extern crate foo; + +fn main() { + foo::rsfoo(); +} diff --git a/src/test/run-make-fulldeps/c-dynamic-rlib/cfoo.c b/src/test/run-make-fulldeps/c-dynamic-rlib/cfoo.c new file mode 100644 index 000000000..fea490cf9 --- /dev/null +++ b/src/test/run-make-fulldeps/c-dynamic-rlib/cfoo.c @@ -0,0 +1,4 @@ +#ifdef _WIN32 +__declspec(dllexport) +#endif +int foo() { return 0; } diff --git a/src/test/run-make-fulldeps/c-dynamic-rlib/foo.rs b/src/test/run-make-fulldeps/c-dynamic-rlib/foo.rs new file mode 100644 index 000000000..3dd376f1f --- /dev/null +++ b/src/test/run-make-fulldeps/c-dynamic-rlib/foo.rs @@ -0,0 +1,10 @@ +#![crate_type = "rlib"] + +#[link(name = "cfoo")] +extern "C" { + fn foo(); +} + +pub fn rsfoo() { + unsafe { foo() } +} -- cgit v1.2.3