diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:13 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:13 +0000 |
commit | 218caa410aa38c29984be31a5229b9fa717560ee (patch) | |
tree | c54bd55eeb6e4c508940a30e94c0032fbd45d677 /tests/run-make-fulldeps/cross-lang-lto-upstream-rlibs | |
parent | Releasing progress-linux version 1.67.1+dfsg1-1~progress7.99u1. (diff) | |
download | rustc-218caa410aa38c29984be31a5229b9fa717560ee.tar.xz rustc-218caa410aa38c29984be31a5229b9fa717560ee.zip |
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/run-make-fulldeps/cross-lang-lto-upstream-rlibs')
3 files changed, 43 insertions, 0 deletions
diff --git a/tests/run-make-fulldeps/cross-lang-lto-upstream-rlibs/Makefile b/tests/run-make-fulldeps/cross-lang-lto-upstream-rlibs/Makefile new file mode 100644 index 000000000..6f1caa31a --- /dev/null +++ b/tests/run-make-fulldeps/cross-lang-lto-upstream-rlibs/Makefile @@ -0,0 +1,32 @@ +include ../tools.mk + +# ignore windows due to libLLVM being present in PATH and the PATH and library path being the same +# (so fixing it is harder). See #57765 for context +ifndef IS_WINDOWS + +# This test makes sure that we don't loose upstream object files when compiling +# staticlibs with -C linker-plugin-lto + +all: staticlib.rs upstream.rs + $(RUSTC) upstream.rs -C linker-plugin-lto -Ccodegen-units=1 + + # Check No LTO + $(RUSTC) staticlib.rs -C linker-plugin-lto -Ccodegen-units=1 -L. -o $(TMPDIR)/staticlib.a + (cd $(TMPDIR); "$(LLVM_BIN_DIR)"/llvm-ar x ./staticlib.a) + # Make sure the upstream object file was included + ls $(TMPDIR)/upstream.*.rcgu.o + + # Cleanup + rm $(TMPDIR)/* + + # Check ThinLTO + $(RUSTC) upstream.rs -C linker-plugin-lto -Ccodegen-units=1 -Clto=thin + $(RUSTC) staticlib.rs -C linker-plugin-lto -Ccodegen-units=1 -Clto=thin -L. -o $(TMPDIR)/staticlib.a + (cd $(TMPDIR); "$(LLVM_BIN_DIR)"/llvm-ar x ./staticlib.a) + ls $(TMPDIR)/upstream.*.rcgu.o + +else + +all: + +endif diff --git a/tests/run-make-fulldeps/cross-lang-lto-upstream-rlibs/staticlib.rs b/tests/run-make-fulldeps/cross-lang-lto-upstream-rlibs/staticlib.rs new file mode 100644 index 000000000..34951dda3 --- /dev/null +++ b/tests/run-make-fulldeps/cross-lang-lto-upstream-rlibs/staticlib.rs @@ -0,0 +1,8 @@ +#![crate_type="staticlib"] + +extern crate upstream; + +#[no_mangle] +pub extern "C" fn bar() { + upstream::foo(); +} diff --git a/tests/run-make-fulldeps/cross-lang-lto-upstream-rlibs/upstream.rs b/tests/run-make-fulldeps/cross-lang-lto-upstream-rlibs/upstream.rs new file mode 100644 index 000000000..bd6820098 --- /dev/null +++ b/tests/run-make-fulldeps/cross-lang-lto-upstream-rlibs/upstream.rs @@ -0,0 +1,3 @@ +#![crate_type = "rlib"] + +pub fn foo() {} |