Skip to content

Commit cc07228

Browse files
committedApr 13, 2020
Auto merge of #71023 - mati865:mingw-unwind-linking-cleanup, r=Amanieu
[windows] Add testscase for self-contained executables and fix pthread linking Fixes #71061
2 parents 9fed360 + a32e340 commit cc07228

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed
 

‎src/librustc_target/spec/windows_base.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ pub fn opts() -> TargetOptions {
5757
// binaries to be redistributed without the libgcc_s-dw2-1.dll
5858
// dependency, but unfortunately break unwinding across DLL
5959
// boundaries when unwinding across FFI boundaries.
60-
"-lgcc".to_string(),
6160
"-lgcc_eh".to_string(),
62-
"-lpthread".to_string(),
61+
"-l:libpthread.a".to_string(),
62+
"-lgcc".to_string(),
6363
// libpthread depends on libmsvcrt, so we need to link it *again*.
6464
"-lmsvcrt".to_string(),
6565
"-lkernel32".to_string(),
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
-include ../tools.mk
2+
3+
# only-windows
4+
5+
PATH=$(SYSTEMROOT)/system32
6+
7+
all:
8+
$(RUSTC) hello.rs
9+
$(TMPDIR)/hello.exe
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
fn main() {
2+
println!("Hello World!");
3+
}

0 commit comments

Comments
 (0)
Please sign in to comment.