Auto merge of #71023 - mati865:mingw-unwind-linking-cleanup, r=Amanieu

[windows] Add testscase for self-contained executables and fix pthread linking

Fixes https://github.com/rust-lang/rust/issues/71061
This commit is contained in:
bors 2020-04-13 00:59:36 +00:00
commit cc072281f9
3 changed files with 14 additions and 2 deletions

View file

@ -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(),

View file

@ -0,0 +1,9 @@
-include ../tools.mk
# only-windows
PATH=$(SYSTEMROOT)/system32
all:
$(RUSTC) hello.rs
$(TMPDIR)/hello.exe

View file

@ -0,0 +1,3 @@
fn main() {
println!("Hello World!");
}