rewrite and rename issue-36710 to rmake

This commit is contained in:
Oneirical 2024-07-18 13:04:45 -04:00
parent 8f641b1b95
commit 5b44f800f3
5 changed files with 27 additions and 20 deletions

View File

@ -11,7 +11,6 @@ run-make/emit-to-stdout/Makefile
run-make/extern-fn-reachable/Makefile run-make/extern-fn-reachable/Makefile
run-make/foreign-exceptions/Makefile run-make/foreign-exceptions/Makefile
run-make/incr-add-rust-src-component/Makefile run-make/incr-add-rust-src-component/Makefile
run-make/issue-36710/Makefile
run-make/issue-84395-lto-embed-bitcode/Makefile run-make/issue-84395-lto-embed-bitcode/Makefile
run-make/issue-88756-default-output/Makefile run-make/issue-88756-default-output/Makefile
run-make/jobserver-error/Makefile run-make/jobserver-error/Makefile

View File

@ -0,0 +1,27 @@
// Some start files were missed when originally writing the logic to swap in musl start files.
// This caused #36710. After the fix in #50105, this test checks that linking to C++ code
// with global destructors works.
// See https://github.com/rust-lang/rust/pull/50105
//@ ignore-cross-compile
// Reason: the compiled binary is executed
// FIXME(Oneirical): are these really necessary? This test is supposed to test a musl
// bug... and it ignores musl? This wasn't part of the original test at its creation, which
// had no ignores.
//# ignore-none no-std is not supported
//# ignore-wasm32 FIXME: don't attempt to compile C++ to WASM
//# ignore-wasm64 FIXME: don't attempt to compile C++ to WASM
//# ignore-nvptx64-nvidia-cuda FIXME: can't find crate for `std`
//# ignore-musl FIXME: this makefile needs teaching how to use a musl toolchain
//# (see dist-i586-gnu-i586-i686-musl Dockerfile)
//# ignore-sgx
use run_make_support::{build_native_static_lib_cxx, run, rustc};
fn main() {
build_native_static_lib_cxx("foo");
rustc().input("foo.rs").arg("-lfoo").extra_rs_cxx_flags().run();
run("foo");
}

View File

@ -1,19 +0,0 @@
# ignore-cross-compile
# ignore-none no-std is not supported
# ignore-wasm32 FIXME: don't attempt to compile C++ to WASM
# ignore-wasm64 FIXME: don't attempt to compile C++ to WASM
# ignore-nvptx64-nvidia-cuda FIXME: can't find crate for `std`
# ignore-musl FIXME: this makefile needs teaching how to use a musl toolchain
# (see dist-i586-gnu-i586-i686-musl Dockerfile)
# ignore-sgx
include ../tools.mk
all: foo
$(call RUN,foo)
foo: foo.rs $(call NATIVE_STATICLIB,foo)
$(RUSTC) $< -lfoo $(EXTRARSCXXFLAGS) --target $(TARGET)
$(TMPDIR)/libfoo.o: foo.cpp
$(call COMPILE_OBJ_CXX,$@,$<)