]> git.lizzy.rs Git - rust.git/commitdiff
Auto merge of #75364 - rylev:libpanic-abort-failfast, r=alexcrichton
authorbors <bors@rust-lang.org>
Tue, 25 Aug 2020 07:36:52 +0000 (07:36 +0000)
committerbors <bors@rust-lang.org>
Tue, 25 Aug 2020 07:36:52 +0000 (07:36 +0000)
Call into fastfail on abort in libpanic_abort on Windows x86(_64)

This partially resolves #73215 though this is only for x86 targets. This code is directly lifted from [libstd](https://github.com/rust-lang/rust/blob/13290e83a6e20f3b408d177a9d64d8cf98fe4615/library/std/src/sys/windows/mod.rs#L315). `__fastfail` is the preferred way to abort a process on Windows as it will hook into debugger toolchains.

Other platforms expose a `_rust_abort` symbol which wraps `std::sys::abort_internal`. This would also work on Windows, but is a slightly largely change as we'd need to make sure that the symbol is properly exposed to the linker. I'm inlining the call to the `__fastfail`, but the indirection through `rust_abort` might be a cleaner approach.

 A different instruction must be used on ARM architectures. I'd like to verify this works first before tackling ARM.


Trivial merge