Skip to content

mipsel targets: compilation fails with "Undefined temporary symbol $BB0_4" #108835

Closed
@Mrmaxmeier

Description

@Mrmaxmeier

Hi,

I hit a strange build failure in CI where rustc-demangle fails to build for mipsel-unknown-linux-gnu .

Here's a reduced reproducer:

// ⋊> rustc ./repro.rs --crate-type=lib --target mipsel-unknown-linux-gnu
// error: Undefined temporary symbol $BB0_4
//
// error: aborting due to previous error
pub fn func(s: &()) -> usize {
    #[allow(dead_code)]
    enum Error {
        VarA,
        VarB,
    }

    fn subfunc<'a>(_s: &'a ()) -> Result<&'a str, Error> {
        loop {}
    }
    match subfunc(s) {
        Ok(_d) => 1,
        Err(Error::VarA) | Err(Error::VarB) => 2,
    }
}

Meta

I'm using current nightly, but this is a regression from stable (1.67.1) to beta (1.68.0-beta.7).

rustc --version --verbose:

rustc 1.70.0-nightly (7820b62d2 2023-03-05)
binary: rustc
commit-hash: 7820b62d20bc548096d4632a3487987308cb4b5d
commit-date: 2023-03-05
host: x86_64-unknown-linux-gnu
release: 1.70.0-nightly
LLVM version: 15.0.7

cargo bisect-rustc points to d726c84 (in nightly-2022-11-01), but this feels like an LLVM bug.
I can't trigger it via --emit=llvm-ir and llc repro.ll -o repro.o -filetype=obj though. The LLVM version matches, but I'm probably not reproducing rustc's interactions with LLVM faithfully..

Sorry for the noise with obscure target architectures, but I'm reporting the issue here because I don't know how to reproduce it on LLVM's side 🙂

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.O-MIPSTarget: MIPS processorsllvm-fixed-upstreamIssue expected to be fixed by the next major LLVM upgrade, or backported fixes

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions