Skip to content

Commit 24c7eb5

Browse files
committed
Add crate "unwind" to link with libunwind on AIX.
1 parent 71042b4 commit 24c7eb5

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

tests/ui/extern-flag/auxiliary/panic_handler.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![feature(lang_items)]
1+
#![feature(lang_items, panic_unwind)]
22
#![no_std]
33

44
// Since `rustc` generally passes `-nodefaultlibs` to the linker,
@@ -10,6 +10,12 @@
1010
#[cfg(not(all(windows, target_env = "msvc")))]
1111
extern crate libc;
1212

13+
// Since crate `unwind` is a dependency of crate `std`, and we are using
14+
// `#![no_std]`, `libunwind` is not included in the link command on AIX
15+
// by default. We need to include crate `unwind` manually.
16+
#[cfg(target_os = "aix")]
17+
extern crate unwind;
18+
1319
#[panic_handler]
1420
pub fn begin_panic_handler(_info: &core::panic::PanicInfo<'_>) -> ! {
1521
loop {}

0 commit comments

Comments
 (0)