Skip to content

SIGSEGV in LLVM when linking to extern "Rust" { fn main(); } #67946

Closed
@jonas-schievink

Description

@jonas-schievink

This code crashes in LLVM during codegen on stable, beta, and nightly:

#[no_mangle]
fn whatever() {
    extern "Rust" {
        fn main();
    }

    unsafe { main(); }
}

This originally happened in real-world code (a code base derived from cortex-m-rt).

This issue has been assigned to @jumbatm via this comment.

Metadata

Metadata

Assignees

Labels

A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.C-bugCategory: This is a bug.I-crashIssue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.P-highHigh priorityT-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