3 ms·
Perhaps it's just an issue of me not being educated enough with this kind of low-level Rust. Setting panic to abort in the cargo config did indeed fix `eh_perso
by jefftime 9y ago
Perhaps it's just an issue of me not being educated enough with this kind of low-level Rust. Setting panic to abort in the cargo config did indeed fix `eh_personality` being undefined, but `eh_unwind_resume` still seems finnicky. Building in release will work, but building in debug will still complain
- red75prime 9y agoI'm a little rusty on the topic, but it seems ([0]) that adding `#[no_mangle]` before `panic_fmt` should fix it. [0] https://github.com/rust-lang/rust/issues/38281 https://github.com/rust-lang/rust/issues/38281
- steveklabnik 9y agoSee also https://doc.rust-lang.org/nightly/unstable-book/language-features/lang-items.html#writing-an-executable-without-stdlib https://doc.rust-lang.org/nightly/unstable-book/language-fea...
- jefftime 9y agoEven specifying `eh_unwind_resume` as a lang item gives me a linking error in debug builds.
- steveklabnik 9y agoDid you define them exactly the same way? Every aspect has to be identical; extern, no mangle, function name, arguments, lang item. If this happens to be open source, I can take a look at it.
- jefftime 9y agoI just whipped this up yesterday to test if I was still having the same issues. Debug fails to build with a linking error "undefined reference to `_Unwind_Resume`". Release build works fine. I'm using rustc 1.25.0-nightly on Ubuntu 17.10 https://gist.github.com/jefftime/d7e96461138b5aa6895550b63caac66c https://gist.github.com/jefftime/d7e96461138b5aa6895550b63ca...
- steveklabnik 9y agoThe lang item symbol names need to be prefixed with rust_ like this: https://gist.github.com/steveklabnik/5abd59a8fe7e5abda3db58bd8c208fbb https://gist.github.com/steveklabnik/5abd59a8fe7e5abda3db58b...
- jefftime 9y agoThis didn't fix the compilation errors for me. I can set my own no_mangle pub extern `_Unwind_Resume` function (without declaring it a lang_item) and fix the undefined reference that way, but I'm pretty sure that's not how one's supposed to solve this
- steveklabnik 9y agoHm, it compiled for me. Well, it didn't know about the C functions that were being linked in, but it didn't complain about the lang items. You should file a bug, maybe.