mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-23 20:34:06 +00:00
Include the "unwind" crate to link with libunwind instead of the "libc" crate.
This commit is contained in:
parent
71042b4b20
commit
467ce2695a
@ -1,14 +1,10 @@
|
|||||||
#![feature(lang_items)]
|
#![feature(lang_items, panic_unwind)]
|
||||||
#![no_std]
|
#![no_std]
|
||||||
|
|
||||||
// Since `rustc` generally passes `-nodefaultlibs` to the linker,
|
// Since the `unwind` crate is a dependency of the `std` crate, and we have
|
||||||
// Rust programs link necessary system libraries via `#[link()]`
|
// `#![no_std]`, the unwinder is not included in the link command by default.
|
||||||
// attributes in the `libc` crate. `libc` is a dependency of `std`,
|
// We need to include crate `unwind` manually.
|
||||||
// but as we are `#![no_std]`, we need to include it manually.
|
extern crate unwind;
|
||||||
// Except on windows-msvc.
|
|
||||||
#![feature(rustc_private)]
|
|
||||||
#[cfg(not(all(windows, target_env = "msvc")))]
|
|
||||||
extern crate libc;
|
|
||||||
|
|
||||||
#[panic_handler]
|
#[panic_handler]
|
||||||
pub fn begin_panic_handler(_info: &core::panic::PanicInfo<'_>) -> ! {
|
pub fn begin_panic_handler(_info: &core::panic::PanicInfo<'_>) -> ! {
|
||||||
|
Loading…
Reference in New Issue
Block a user