@@ -55,7 +55,13 @@ fn start(_argc: isize, _argv: *const *const u8) -> isize {
5555// provided by libstd. 
5656#[lang = "eh_personality"] 
5757#[no_mangle] 
58- pub extern fn eh_personality() { 
58+ pub extern fn rust_eh_personality() { 
59+ } 
60+ 
61+ // This function may be needed based on the compilation target. 
62+ #[lang = "eh_unwind_resume"] 
63+ #[no_mangle] 
64+ pub extern fn rust_eh_unwind_resume() { 
5965} 
6066
6167#[lang = "panic_fmt"] 
@@ -87,12 +93,18 @@ pub extern fn main(_argc: i32, _argv: *const *const u8) -> i32 {
8793    0 
8894} 
8995
90- // These functions and traits  are used by the compiler, but not 
96+ // These functions are used by the compiler, but not 
9197// for a bare-bones hello world. These are normally 
9298// provided by libstd. 
9399#[lang = "eh_personality"] 
94100#[no_mangle] 
95- pub extern fn eh_personality() { 
101+ pub extern fn rust_eh_personality() { 
102+ } 
103+ 
104+ // This function may be needed based on the compilation target. 
105+ #[lang = "eh_unwind_resume"] 
106+ #[no_mangle] 
107+ pub extern fn rust_eh_unwind_resume() { 
96108} 
97109
98110#[lang = "panic_fmt"] 
@@ -104,23 +116,28 @@ pub extern fn rust_begin_panic(_msg: core::fmt::Arguments,
104116} 
105117``` 
106118
107- ## More about the langauge  items  
119+ ## More about the language  items  
108120
109121The compiler currently makes a few assumptions about symbols which are
110122available in the executable to call. Normally these functions are provided by
111123the standard library, but without it you must define your own. These symbols
112124are called "language items", and they each have an internal name, and then a
113125signature that an implementation must conform to.
114126
115- The first of these two  functions, ` eh_personality ` , is used by the failure
127+ The first of these functions, ` rust_eh_personality ` , is used by the failure
116128mechanisms of the compiler. This is often mapped to GCC's personality function
117129(see the [ libstd implementation] [ unwind ]  for more information), but crates
118130which do not trigger a panic can be assured that this function is never
119- called. Both the  language item and the symbol  name are  ` eh_personality ` .
120-   
131+ called. The  language item's  name is  ` eh_personality ` .
132+ 
121133[ unwind ] : https://github.com/rust-lang/rust/blob/master/src/libpanic_unwind/gcc.rs 
122134
123- The second function, ` panic_fmt ` , is also used by the failure mechanisms of the
135+ The second function, ` rust_begin_panic ` , is also used by the failure mechanisms of the
124136compiler. When a panic happens, this controls the message that's displayed on
125137the screen. While the language item's name is ` panic_fmt ` , the symbol name is
126138` rust_begin_panic ` .
139+ 
140+ A third function, ` rust_eh_unwind_resume ` , is also needed if the ` custom_unwind_resume ` 
141+ flag is set in the options of the compilation target. It allows customizing the
142+ process of resuming unwind at the end of the landing pads. The language item's name
143+ is ` eh_unwind_resume ` .
0 commit comments