Open Aaron1011 opened 3 years ago
The post https://lists.llvm.org/pipermail/llvm-bugs/2016-November/052080.html looks very similar - we're compiling with ThinLTO, and the pre-LTO bitcode for the affected module contains a switch
:
; Function Attrs: nonlazybind uwtable
define internal fastcc void @"_ZN4core3ptr90drop_in_place$LT$chalk_ir..DomainGoal$LT$rustc_middle..traits..chalk..RustInterner$GT$$GT$17hc2fab4088400a657E"(%"chalk_ir::DomainGoal<rustc_middle::traits::ChalkRustInterner>"* %0) unnamed_addr #1 !dbg !3222 {
%2 = getelementptr %"chalk_ir::DomainGoal<rustc_middle::traits::ChalkRustInterner>", %"chalk_ir::DomainGoal<rustc_middle::traits::ChalkRustInterner>"* %0, i64 0, i32 0, i64 0, !dbg !3223
%3 = load i32, i32* %2, align 8, !dbg !3223, !range !3224
%4 = zext i32 %3 to i64, !dbg !3223
switch i64 %4, label %5 [
i64 0, label %6
i64 1, label %22
i64 2, label %33
i64 3, label %44
i64 4, label %47
i64 5, label %50
i64 6, label %53
i64 7, label %56
i64 9, label %59
], !dbg !3223
However, the reproduction instructions in that post don't trigger a crash for me - it compiles successfully. Additionally, the issue in that thread was deterministic (without any caching involved), while this issue happens intermittently.
The LLVM bug is https://bugs.llvm.org/show_bug.cgi?id=31052, and was apparently fixed in https://reviews.llvm.org/D26880 (https://github.com/llvm/llvm-project/commit/185b4ab6d4435be5804272587a0871b38a7eef08).
Just got this error while linking rustc_driver
with incremental enabled (not for the first time).
= note: ld.lld: error: undefined symbol: anon.91c2f56426c5022640e519f02889d07d.8.llvm.746630307250149404
>>> referenced by C:\msys64\home\we\rust\library\core\src/option.rs:0
>>> librustc_resolve-fac19ceb16326411.rlib(rustc_resolve-fac19ceb16326411.1brnvk2mjzqx5b9n.rcgu.o):(rustc_resolve::macros::registered_idents)
>>> referenced by C:\msys64\home\we\rust\library\alloc\src\vec/mod.rs:425
>>> librustc_resolve-fac19ceb16326411.rlib(rustc_resolve-fac19ceb16326411.2u8t3u4aqh8idzl4.rcgu.o):(<rustc_resolve::late::lifetimes::LifetimeContext>::with::<<rustc_resolve::late::lifetimes::LifetimeContext>::visit_fn_like_elision::{closure#9}>)
>>> referenced by C:\msys64\home\we\rust\library\alloc\src\vec/mod.rs:425
>>> librustc_resolve-fac19ceb16326411.rlib(rustc_resolve-fac19ceb16326411.2u8t3u4aqh8idzl4.rcgu.o):(<rustc_resolve::late::lifetimes::LifetimeContext>::with::<<rustc_resolve::late::lifetimes::LifetimeContext>::visit_segment_args::{closure#6}>)
>>> referenced 30 more times
ld.lld: error: undefined symbol: anon.91c2f56426c5022640e519f02889d07d.9.llvm.746630307250149404
>>> referenced by C:\msys64\home\we\rust\library\alloc\src\vec/mod.rs:425
>>> librustc_resolve-fac19ceb16326411.rlib(rustc_resolve-fac19ceb16326411.2u8t3u4aqh8idzl4.rcgu.o):(<rustc_resolve::late::lifetimes::LifetimeContext>::with::<<rustc_resolve::late::lifetimes::LifetimeContext>::visit_fn_like_elision::{closure#9}>)
>>> referenced by C:\msys64\home\we\rust\library\alloc\src\vec/mod.rs:425
>>> librustc_resolve-fac19ceb16326411.rlib(rustc_resolve-fac19ceb16326411.2u8t3u4aqh8idzl4.rcgu.o):(<rustc_resolve::late::lifetimes::LifetimeContext>::with::<<rustc_resolve::late::lifetimes::LifetimeContext>::visit_segment_args::{closure#6}>)
>>> referenced by C:\msys64\home\we\rust\library\alloc\src\vec/mod.rs:425
>>> librustc_resolve-fac19ceb16326411.rlib(rustc_resolve-fac19ceb16326411.2u8t3u4aqh8idzl4.rcgu.o):(<rustc_resolve::late::lifetimes::LifetimeContext>::with::<<rustc_resolve::late::lifetimes::LifetimeContext>::visit_segment_args::{closure#7}>)
>>> referenced 30 more times
ld.lld: error: undefined symbol: core::ptr::drop_in_place::<rustc_span::FileName> (.llvm.1438190246702246187)
>>> referenced by C:\msys64\home\we\rust\library\core\src\ptr/mod.rs:188
>>> librustc_resolve-fac19ceb16326411.rlib(rustc_resolve-fac19ceb16326411.3bc39m1okvl6wof.rcgu.o):(<&mut <rustc_resolve::Resolver>::check_unused::{closure#0} as core::ops::function::FnMut<(&rustc_span::span_encoding::Span,)>>::call_mut)
>>> referenced by C:\msys64\home\we\rust\library\core\src\ptr/mod.rs:0
>>> librustc_resolve-fac19ceb16326411.rlib(rustc_resolve-fac19ceb16326411.3bc39m1okvl6wof.rcgu.o):(<&mut <rustc_resolve::Resolver>::check_unused::{closure#0} as core::ops::function::FnMut<(&rustc_span::span_encoding::Span,)>>::call_mut)
>>> referenced by C:\msys64\home\we\rust\library\core\src\ptr/mod.rs:188
>>> librustc_resolve-fac19ceb16326411.rlib(rustc_resolve-fac19ceb16326411.4391tludo7n7dv8i.rcgu.o):(core::ptr::drop_in_place::<rustc_span::SpanSnippetError>)
>>> referenced 9 more times
ld.lld: error: undefined symbol: core::ptr::drop_in_place::<(rustc_span::FileName, rustc_span::BytePos)> (.llvm.1438190246702246187)
>>> referenced by C:\msys64\home\we\rust\library\core\src\ptr/mod.rs:188
>>> librustc_resolve-fac19ceb16326411.rlib(rustc_resolve-fac19ceb16326411.3bc39m1okvl6wof.rcgu.o):(<&mut <rustc_resolve::Resolver>::check_unused::{closure#0} as core::ops::function::FnMut<(&rustc_span::span_encoding::Span,)>>::call_mut)
>>> referenced by C:\msys64\home\we\rust\library\core\src\ptr/mod.rs:188
>>> librustc_resolve-fac19ceb16326411.rlib(rustc_resolve-fac19ceb16326411.4391tludo7n7dv8i.rcgu.o):(core::ptr::drop_in_place::<rustc_span::SpanSnippetError>)
>>> referenced by C:\msys64\home\we\rust\library\core\src\ptr/mod.rs:188
>>> librustc_resolve-fac19ceb16326411.rlib(rustc_resolve-fac19ceb16326411.5327cotcw21h0vj4.rcgu.o):(core::ptr::drop_in_place::<core::result::Result<alloc::string::String, rustc_span::SpanSnippetError>>)
>>> referenced 2 more times
collect2.exe: error: ld returned 1 exit status
I've been getting the following errors (seemingly at random) while building rustc: