Skip to content

Commit

Permalink
Auto merge of #71023 - mati865:mingw-unwind-linking-cleanup, r=Amanieu
Browse files Browse the repository at this point in the history
[windows] Add testscase for self-contained executables and fix pthread linking

Fixes #71061
  • Loading branch information
bors committed Apr 13, 2020
2 parents 9fed360 + a32e340 commit cc07228
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/librustc_target/spec/windows_base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ pub fn opts() -> TargetOptions {
// binaries to be redistributed without the libgcc_s-dw2-1.dll
// dependency, but unfortunately break unwinding across DLL
// boundaries when unwinding across FFI boundaries.
"-lgcc".to_string(),
"-lgcc_eh".to_string(),
"-lpthread".to_string(),
"-l:libpthread.a".to_string(),
"-lgcc".to_string(),
// libpthread depends on libmsvcrt, so we need to link it *again*.
"-lmsvcrt".to_string(),
"-lkernel32".to_string(),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
-include ../tools.mk

# only-windows

PATH=$(SYSTEMROOT)/system32

all:
$(RUSTC) hello.rs
$(TMPDIR)/hello.exe
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fn main() {
println!("Hello World!");
}

0 comments on commit cc07228

Please sign in to comment.