`rust_begin_unwind` symbol doesn't have the right visibility
japaric opened this issue · 1 comments
japaric commented
when emitted from a bin crate.
STR
$ cat foo.rs#![feature(panic_implementation)]
#![no_main]
#![no_std]
use core::panic::PanicInfo;
#[panic_implementation]
fn panic(_info: &PanicInfo) -> ! {
loop {}
}$ rustc -C panic=abort --crate-type=bin --emit=obj foo.rs
$ nm -C foo.o
0000000000000000 t rust_begin_unwind
$ rustc -C panic=abort --crate-type=lib --emit=obj foo.rs
$ nm -C foo.o
0000000000000000 T rust_begin_unwindrust_begin_unwind being an internal / private symbol (t) causes linker errors of the form "undefined reference to rust_begin_unwind".
Meta
$ rustc -V
rustc 1.29.0-nightly (6a1c0637c 2018-07-23)alexcrichton commented
I believe this is fixed in #52993