diff --git a/dev-lang/rust/rust-1.50.0.ebuild b/dev-lang/rust/rust-1.50.0.ebuild index e98848b6f..70f49cda1 100644 --- a/dev-lang/rust/rust-1.50.0.ebuild +++ b/dev-lang/rust/rust-1.50.0.ebuild @@ -260,6 +260,19 @@ src_configure() { fi rust_target="$(rust_abi)" + llvm_libunwind="false" + if tc-is-clang; then + local compiler_rt=$($(tc-getCC) ${CPPFLAGS} ${CFLAGS} ${LDFLAGS} -print-libgcc-file-name) + if [[ ${compiler_rt} == *libclang_rt* ]]; then + if has_version sys-libs/llvm-libunwind; then + einfo "Linking with llvm-libunwind" + llvm_libunwind=true + else + einfo "Linking with gcc_s unwinder" + llvm_libunwind=false + fi + fi + fi cat <<- _EOF_ > "${S}"/config.toml [llvm] @@ -316,6 +329,7 @@ src_configure() { lld = $(usex system-llvm false $(toml_usex wasm)) backtrace-on-ice = true jemalloc = false + llvm-libunwind = ${llvm_libunwind} [dist] src-tarball = false _EOF_