Auto merge of #51687 - japaric:gh51671, r=alexcrichton

translate / export weak lang items

see #51671 for details

fixes #51671
fixes #51342

r? @michaelwoerister or @alexcrichton
This commit is contained in:
bors 2018-06-28 15:34:17 +00:00
commit e3bf634e06
4 changed files with 52 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,28 @@
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![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() {}