File tree 5 files changed +35
-15
lines changed
run-make-support/src/external_deps
5 files changed +35
-15
lines changed Original file line number Diff line number Diff line change @@ -344,6 +344,21 @@ impl Rustc {
344
344
// endif
345
345
// ```
346
346
let flag = if is_windows ( ) {
347
+ // So this is a bit hacky: we can't use the DLL version of libstdc++ because
348
+ // it pulls in the DLL version of libgcc, which means that we end up with 2
349
+ // instances of the DW2 unwinding implementation. This is a problem on
350
+ // i686-pc-windows-gnu because each module (DLL/EXE) needs to register its
351
+ // unwind information with the unwinding implementation, and libstdc++'s
352
+ // __cxa_throw won't see the unwinding info we registered with our statically
353
+ // linked libgcc.
354
+ //
355
+ // Now, simply statically linking libstdc++ would fix this problem, except
356
+ // that it is compiled with the expectation that pthreads is dynamically
357
+ // linked as a DLL and will fail to link with a statically linked libpthread.
358
+ //
359
+ // So we end up with the following hack: we link use static:-bundle to only
360
+ // link the parts of libstdc++ that we actually use, which doesn't include
361
+ // the dependency on the pthreads DLL.
347
362
if is_msvc ( ) { None } else { Some ( "-lstatic:-bundle=stdc++" ) }
348
363
} else {
349
364
match & uname ( ) [ ..] {
Original file line number Diff line number Diff line change @@ -29,7 +29,6 @@ run-make/extern-fn-with-union/Makefile
29
29
run-make/extern-multiple-copies/Makefile
30
30
run-make/extern-multiple-copies2/Makefile
31
31
run-make/fmt-write-bloat/Makefile
32
- run-make/foreign-exceptions/Makefile
33
32
run-make/foreign-rust-exceptions/Makefile
34
33
run-make/incr-add-rust-src-component/Makefile
35
34
run-make/incr-foreign-head-span/Makefile
Original file line number Diff line number Diff line change 12
12
//@ ignore-cross-compile
13
13
// Reason: the compiled binary is executed
14
14
15
- use run_make_support:: { build_native_static_lib_cxx, run , rustc} ;
15
+ use run_make_support:: { build_native_static_lib_cxx, run_fail , rustc} ;
16
16
17
17
fn main ( ) {
18
18
build_native_static_lib_cxx ( "foo" ) ;
19
19
rustc ( ) . input ( "foo.rs" ) . arg ( "-lfoo" ) . extra_rs_cxx_flags ( ) . run ( ) ;
20
- run ( "foo" ) . assert_stdout_not_contains ( "unreachable" ) ;
20
+ run_fail ( "foo" ) . assert_stdout_not_contains ( "unreachable" ) ;
21
21
}
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ // This test was created to check that compilation and execution still works
2
+ // after the addition of a new feature, in #65646: the ability to unwind panics
3
+ // and exceptions back and forth between Rust and C++. Should this feature be broken,
4
+ // the test should fail.
5
+ // See https://github.com/rust-lang/rust/pull/65646
6
+
7
+ //@ needs-unwind
8
+ // Reason: this test exercises panic unwinding
9
+ //@ ignore-cross-compile
10
+ // Reason: the compiled binary is executed
11
+
12
+ use run_make_support:: { build_native_static_lib_cxx, run, rustc} ;
13
+
14
+ fn main ( ) {
15
+ build_native_static_lib_cxx ( "foo" ) ;
16
+ rustc ( ) . input ( "foo.rs" ) . arg ( "-lfoo" ) . extra_rs_cxx_flags ( ) . run ( ) ;
17
+ run ( "foo" ) ;
18
+ }
You can’t perform that action at this time.
0 commit comments