Skip to content

Commit 4424d23

Browse files
committed
Auto merge of rust-lang#128804 - ChrisDenton:redudant, r=<try>
run-make: enable msvc for redundant-libs The issue here was that `foo` was not exporting any functions therefore creating an import library was unnecessary and elided by the linker. I fixed it by exporting the functions. try-job: x86_64-msvc try-job: i686-msvc
2 parents 86e7875 + 599bcb5 commit 4424d23

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

tests/run-make/redundant-libs/foo.c

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,8 @@
1-
void foo1() {}
2-
void foo2() {}
1+
#ifdef _MSC_VER
2+
#define DllExport __declspec(dllexport)
3+
#else
4+
#define DllExport
5+
#endif
6+
7+
DllExport void foo1() {}
8+
DllExport void foo2() {}

tests/run-make/redundant-libs/rmake.rs

-6
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,6 @@
1010

1111
//@ ignore-cross-compile
1212
// Reason: the compiled binary is executed
13-
//@ ignore-windows-msvc
14-
// Reason: this test links libraries via link.exe, which only accepts the import library
15-
// for the dynamic library, i.e. `foo.dll.lib`. However, build_native_dynamic_lib only
16-
// produces `foo.dll` - the dynamic library itself. To make this test work on MSVC, one
17-
// would need to derive the import library from the dynamic library.
18-
// See https://stackoverflow.com/questions/9360280/
1913

2014
use run_make_support::{
2115
build_native_dynamic_lib, build_native_static_lib, cwd, is_msvc, rfs, run, rustc,

0 commit comments

Comments
 (0)