Skip to content

Commit ec1ed26

Browse files
committed
rewrite raw-dylib-cross-compilation to rmake
1 parent a4f3e5f commit ec1ed26

File tree

3 files changed

+41
-21
lines changed

3 files changed

+41
-21
lines changed

src/tools/tidy/src/allowed_run_make_makefiles.txt

-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ run-make/profile/Makefile
136136
run-make/prune-link-args/Makefile
137137
run-make/raw-dylib-alt-calling-convention/Makefile
138138
run-make/raw-dylib-c/Makefile
139-
run-make/raw-dylib-cross-compilation/Makefile
140139
run-make/raw-dylib-custom-dlltool/Makefile
141140
run-make/raw-dylib-import-name-type/Makefile
142141
run-make/raw-dylib-inline-cross-dylib/Makefile

tests/run-make/raw-dylib-cross-compilation/Makefile

-20
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
// When cross-compiling using `raw-dylib`, rustc would try to fetch some
2+
// very specific `dlltool` to complete the cross-compilation (such as `i686-w64-mingw32-dlltool`)
3+
// when Windows only calls it `dlltool`. This test performs some cross-compilation in a
4+
// way that previously failed due to this bug, and checks that it succeeds.
5+
// See https://github.com/rust-lang/rust/pull/108355
6+
7+
//@ ignore-i686-pc-windows-msvc
8+
// Reason: dlltool on this distribution is unable to produce x64 binaries
9+
//@ needs-dlltool
10+
// Reason: this is the utility being checked by this test
11+
12+
use run_make_support::{llvm_objdump, rust_lib_name, rustc};
13+
14+
fn main() {
15+
// Build as x86 and make sure that we have x86 objects only.
16+
rustc()
17+
.crate_type("lib")
18+
.crate_name("i686_raw_dylib_test")
19+
.target("i686-pc-windows-gnu")
20+
.input("lib.rs")
21+
.run();
22+
llvm_objdump()
23+
.arg("-a")
24+
.input(rust_lib_name("i686_raw_dylib_test"))
25+
.run()
26+
.assert_stdout_contains("file format coff-i386")
27+
.assert_stdout_not_contains("file format coff-x86-64");
28+
// Build as x64 and make sure that we have x64 objects only.
29+
rustc()
30+
.crate_type("lib")
31+
.crate_name("x64_raw_dylib_test")
32+
.target("x86-64-pc-windows-gnu")
33+
.input("lib.rs")
34+
.run();
35+
llvm_objdump()
36+
.arg("-a")
37+
.input(rust_lib_name("i686_raw_dylib_test"))
38+
.run()
39+
.assert_stdout_not_contains("file format coff-i386")
40+
.assert_stdout_contains("file format coff-x86-64");
41+
}

0 commit comments

Comments
 (0)