translate / export weak lang items

see #51671 for details

fixes #51671
fixes #51342
This commit is contained in:
Jorge Aparicio 2018-06-21 13:01:16 -05:00
parent 01172a7d13
commit 9ef134dcad
4 changed files with 42 additions and 0 deletions

View file

@ -0,0 +1,13 @@
-include ../tools.mk
ifdef IS_WINDOWS
# Do nothing on MSVC.
all:
exit 0
else
all:
$(RUSTC) --emit=obj app.rs
nm $(TMPDIR)/app.o | $(CGREP) rust_begin_unwind
nm $(TMPDIR)/app.o | $(CGREP) rust_eh_personality
nm $(TMPDIR)/app.o | $(CGREP) rust_oom
endif

View file

@ -0,0 +1,18 @@
#![crate_type = "bin"]
#![feature(lang_items)]
#![feature(panic_implementation)]
#![no_main]
#![no_std]
use core::panic::PanicInfo;
#[panic_implementation]
fn panic(_: &PanicInfo) -> ! {
loop {}
}
#[lang = "eh_personality"]
fn eh() {}
#[lang = "oom"]
fn oom() {}