Skip to content

Using -C codegen_units=N while bootstrapping rust generates an LLVM assertion #19826

Closed
@japaric

Description

@japaric

STR

$ git clone https://github.com/rust-lang/rust
$ cd rust
$ mkdir build
$ cd build
$ ../configure
$ RUSTFLAGS=-Ccodegen_units=2 make
rustc: x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc
rustc: x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib/librand
rustc: x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunicode
rustc: x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc
rustc: /home/rustbuild/src/rust-buildbot/slave/snap3-linux/build/src/llvm/lib/IR/Constants.cpp:1609: static llvm::Constant* llvm::ConstantExpr::getPointerCast(llvm::Constant*, llvm::Type*): Assertion `S->getType()->isPtrOrPtrVectorTy() && "Invalid cast"' failed.
Aborted (core dumped)

Version

444fa1b


Sadly, I couldn't generate a minimal script that reproduces the problem. But these seem to be the required ingredients:

  • Cross crate. The linked crate must use unboxed closures.
  • There must be some #[inline]d function in the root crate.
  • And, of course, the -C codegen_units flag.

cc @nikomatsakis @nick29581

Metadata

Metadata

Assignees

Labels

I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions