Skip to content

Can't compile libc on m68k-unknown-linux-gnu: LLVM ERROR: unable to allocate function return #2 #93940

Open
@glaubitz

Description

@glaubitz

Building libc for m68k-unknown-linux-gnu currently fails an LLVM error:

Building stage1 std artifacts (x86_64-unknown-linux-gnu -> m68k-unknown-linux-gnu)
   Compiling core v0.0.0 (/data/home/glaubitz/rust-m68k/library/core)
   Compiling compiler_builtins v0.1.67
   Compiling libc v0.2.116
   Compiling memchr v2.4.1
   Compiling unwind v0.0.0 (/data/home/glaubitz/rust-m68k/library/unwind)
   Compiling std v0.0.0 (/data/home/glaubitz/rust-m68k/library/std)
   Compiling rustc-std-workspace-core v1.99.0 (/data/home/glaubitz/rust-m68k/library/rustc-std-workspace-core)
   Compiling alloc v0.0.0 (/data/home/glaubitz/rust-m68k/library/alloc)
   Compiling cfg-if v0.1.10
   Compiling adler v0.2.3
   Compiling rustc-demangle v0.1.21
LLVM ERROR: unable to allocate function return #2
error: could not compile `libc`
warning: build failed, waiting for other jobs to finish...
LLVM ERROR: unable to allocate function return #2
rustc: /data/home/glaubitz/llvm-project/llvm/lib/Target/M68k/M68kInstrInfo.cpp:763: virtual void llvm::M68kInstrInfo::storeRegToStackSlot(llvm::MachineBasicBlock&, llvm::MachineBasicBlock::iterator, llvm::Register, bool, int, const llvm::TargetRegisterClass*, const llvm::TargetRegisterInfo*) const: Assertion `MF.getFrameInfo().getObjectSize(FrameIndex) == 4 && "Stack slot too small for store"' failed.
rustc exited with signal: 6 (core dumped)
rustc: /data/home/glaubitz/llvm-project/llvm/lib/Target/M68k/M68kInstrInfo.cpp:763: virtual void llvm::M68kInstrInfo::storeRegToStackSlot(llvm::MachineBasicBlock&, llvm::MachineBasicBlock::iterator, llvm::Register, bool, int, const llvm::TargetRegisterClass*, const llvm::TargetRegisterInfo*) const: Assertion `MF.getFrameInfo().getObjectSize(FrameIndex) == 4 && "Stack slot too small for store"' failed.
rustc exited with signal: 6 (core dumped)
rustc: /data/home/glaubitz/llvm-project/llvm/lib/Target/M68k/M68kInstrInfo.cpp:763: virtual void llvm::M68kInstrInfo::storeRegToStackSlot(llvm::MachineBasicBlock&, llvm::MachineBasicBlock::iterator, llvm::Register, bool, int, const llvm::TargetRegisterClass*, const llvm::TargetRegisterInfo*) const: Assertion `MF.getFrameInfo().getObjectSize(FrameIndex) == 4 && "Stack slot too small for store"' failed.
rustc exited with signal: 6 (core dumped)
rustc: /data/home/glaubitz/llvm-project/llvm/lib/CodeGen/LiveVariables.cpp:129: void llvm::LiveVariables::HandleVirtRegUse(llvm::Register, llvm::MachineBasicBlock*, llvm::MachineInstr&): Assertion `MRI->getVRegDef(Reg) && "Register use before def!"' failed.
rustc exited with signal: 6 (core dumped)
error: build failed
Build completed unsuccessfully in 0:06:30

Not sure whether this is a Rust or an LLVM bug.

CC @mshockwave @0x59616e @jrtc27 @ricky26 @AnnikaCodes

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️O-motorola68kTarget: Rust from the parallel universe where the Amiga won.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions