Closed
Description
The time has come again, LLVM is releasing 5.0 soon and Rust wants to / needs to follow.
I have started work on the upgrade in these branches:
rust-lang/rust
: https://github.com/alexcrichton/rust/tree/llvm50rust-lang/llvm
: https://github.com/rust-lang/llvm/tree/rust-llvm-2017-07-20rust-lang/compiler-rt
: https://github.com/rust-lang/compiler-rt/tree/rust-2017-07-20rust-lang-nursery/compiler-builtins
: https://github.com/rust-lang-nursery/compiler-builtins/tree/llvm50
Open tasks
- get asm.js working again - reenable
JSBackend
as a target- add asm.js target to our fork - rust-lang/llvm@c9a2123
Completed tasks
Next steps:
- Get
rustllvm
to compile (error log)
Current issues:
- A lot changed around attributes (Update Rust LLVM bindings for LLVM 5.0 #43387)
LLVMMetadataRef
was added, this can / should likely replaceLLVMRustMetadataRef
(Update Rust LLVM bindings for LLVM 5.0 #43387)DebugLoc
was replaced byDiagnosticLocation
in LLVMDiagnosticInfo
(Update Rust LLVM bindings for LLVM 5.0 #43387)compiler segfault when testing in stage2 - usingx86_64-gnu
imagefix compilation of fuzzer on various platformsupstream buglocal fix/workaroundupstream fix
fix compilation of LLVM on i686-unknown-linux-gnuupstream buglocal workaroundupstream fix
codegen/issue-37945.rs
- info belowFreeBSD failed to compilestd::to_string
referencesfixrun-make/sanitizer-leak
- apparently hit a fatal error when run locally?--privileged
needed when running the docker container Flag docker invocations as --privileged on CI #43536
run-make/simd-ffi
mips failed to compile cargorelateddebuginfo-gdb
test failures - LLVM5: Update DW_OP_plus to DW_OP_plus_uconst #47610rustc with LLVM 5 reports invalid DIExpression (rustc with LLVM 5 reports invalid DIExpression #47464) - fixed in LLVM5: Update DW_OP_plus to DW_OP_plus_uconst #47610LLVM 5 fails debuginfo/by-value-self-argument-in-trait-impl.rs (LLVM 5 fails debuginfo/by-value-self-argument-in-trait-impl.rs #47611)
All but the first issues seem straight forward to fix, so I'll try to send PRs for those soon.
Activity
TimNN commentedon Jul 20, 2017
cc @nagisa, @michaelwoerister, @arielb1, @eddyb: You have been recommend as familiar with the rust llvm wrapper, would one of you mind looking into the attributes changes?
alexcrichton commentedon Jul 21, 2017
With #43387 looks like rustc can bootstrap on x86_64-unknown-linux-gnu, but there's a lot of test failures. A full stage2 test run has tons of errors, lots of compiler segfaults. A stage1 test run has much fewer errors:
alexcrichton commentedon Jul 21, 2017
@eddyb indicated on IRC that this function call may be responsible for the
debuginfo-gdb
failures, and he was spot on!alexcrichton commentedon Jul 21, 2017
I've filed https://bugs.llvm.org/show_bug.cgi?id=33883 related to the
run-make/simd-ffi
failureeddyb commentedon Jul 21, 2017
So LLVM got even worse (the current implementation sometimes creates an
alloca
to avoid pretty much this kind of misoptimization ruining complexllvm.dbg.declare
).The proper solution here at this point is to produce a pointer to every single closure capture (which means loading the respective pointer from the environment, if the capture is already by-ref), and then use
llvm.dbg.value
to indicate that... oh, wait, that won't work, let me step back.Using
llvm.dbg.declare
once means that even if the value is modified later, a debugger knows where to get the value during the scope the name is defined for.OTOH,
llvm.dbg.value
gives the value at that time, and even if you say the value is behind a pointer, that won't let the debugger see updated values from later writes to the same location.Which means we need one
alloca
for every single capture (holding the pointers mentioned above). This is because of idiosyncratic LLVM limitations - even though there is a system for indicating multiple pointer offsets and dereferences to get from the argument tollvm.dbg.declare
(orllvm.dbg.value
) (a subset of "DWARF expressions"), and there's enough information to start from an arbitrary pointer on stack or in a register (forllvm.dbg.value
), analloca
is still required.But with one
llvm.dbg.declare
peralloca
, they should be simple enough not to break.alexcrichton commentedon Jul 21, 2017
The
codegen/issue-37945.rs
failure looks related to rust-lang/llvm#90. @arielb1 would you be able to help out diagnosing this one? I've verified that the llvm branch we have for 5.0 does indeed include those commits:Do you think that this may have regressed in upstream LLVM?
alexcrichton commentedon Jul 21, 2017
I think I fixed
codegen/lifetime_start_end.rs
in 38e40ceTimNN commentedon Jul 22, 2017
Edit: Nevermind this comment, those tests are expected to fail on stage 1.
Original comment
For a stage 1 test run, I get the same failures as @alexcrichton, for compile-fail proc macro derive:
full logs
I'm not sure about the initial panic message, but the "failed to initiate panic" seems kind of bad (
error 5
is apparently_URC_END_OF_STACK
)For
run-pass
proc-macro-derive:That also seems bad.
alexcrichton commentedon Jul 22, 2017
@TimNN oh no need to worry about those, that's a benign failure. Procedural macros don't work in stage1 and not all tests are flagged as
// ignore-stage1
Auto merge of #43387 - TimNN:rustllvm50, r=alexcrichton
alexcrichton commentedon Jul 24, 2017
Filed an upstream bug for the segfaults in rustc I've been seeing. (segfaults were happening on all platforms)
113 remaining items