Description
We use the llvm-unwind
feature which means that we build LLVM's libunwind and statically link it into Rust's libunwind. This is critical for our use cases because there's no system unwinder (e.g. libunwind or libgcc) available on systems we target (both Linux and Fuchsia).
dbebcee changed the Rust backend behavior where it no longer exports C symbols from rlibs and dylibs. This means that libstd no longer exports _Unwind_*
symbols (that came from LLVM's libunwind which was built as part unwind rlib) and since no other library provides these symbols in our Rust toolchain, any crate that uses unwinding fails to link, most notably rustc
itself:
= note: ld.lld: error: build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_driver-3561bb4b801d0722.so: undefined reference to _Unwind_Resume
ld.lld: error: build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/librustc-fef1aa24ee35e8f2.so: undefined reference to _Unwind_FindEnclosingFunction
ld.lld: error: build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/librustc-fef1aa24ee35e8f2.so: undefined reference to _Unwind_GetIP
ld.lld: error: build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/librustc-fef1aa24ee35e8f2.so: undefined reference to _Unwind_Backtrace
While I think that dbebcee behavior is desirable in general, it's undesirable in this specific case and I'd like to somehow mark _Unwind_*
symbols to be exported if llvm-unwind
feature is enabled, but I haven't found a way to do so.