Skip to content

ICE: linkage: LLVM ERROR: global must have a zero initializer! #109681

Closed

Description

@matthiaskrgr

Code

#![crate_type="lib"]
#![feature(linkage)]

#[linkage = "common"]
pub static TEST3: bool = true;

Meta

rustc --version --verbose:

rustc 1.70.0-nightly (db0cbc48d 2023-03-26)
binary: rustc
commit-hash: db0cbc48d4aaa300713a95d9b317a365a474490c
commit-date: 2023-03-26
host: x86_64-unknown-linux-gnu
release: 1.70.0-nightly
LLVM version: 16.0.0

Error output

<output>
Backtrace

'common' global must have a zero initializer!
ptr @_ZN10treereduce5TEST317hd1b26bd49e54e1d4E
LLVM ERROR: Broken module found, compilation aborted!

Activity

  1. added
    A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.
    I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    C-bugCategory: This is a bug.
    S-has-mcveStatus: A Minimal Complete and Verifiable Example has been found for this issue
    requires-nightlyThis issue requires a nightly compiler in some way. When possible, use a F-* label instead.
    on Mar 27, 2023
  2. mojingran commented on Jul 14, 2023

    @mojingran
    Contributor

    @rustbot claim

  3. added a commit that references this issue on Sep 8, 2023
  4. added a commit that references this issue on Sep 9, 2023
  5. mojingran commented on Sep 11, 2023

    @mojingran
    Contributor

    @matthiaskrgr This issue should be closed, right?

  6. matthiaskrgr commented on Sep 11, 2023

    @matthiaskrgr
    MemberAuthor

    Why? I can still reproduce the llvm error on latest nightly.

  7. added
    S-bug-has-testStatus: This bug is tracked inside the repo by a `known-bug` test.
    on Apr 15, 2024
  8. removed
    S-has-mcveStatus: A Minimal Complete and Verifiable Example has been found for this issue
    on Sep 22, 2024
  9. bjorn3 commented on Oct 9, 2026

    @bjorn3
    Member

    #[linkage = "common"] has been removed in #163405.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to 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-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️S-bug-has-testStatus: This bug is tracked inside the repo by a `known-bug` test.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.glacierICE tracked in rust-lang/glacier.requires-nightlyThis issue requires a nightly compiler in some way. When possible, use a F-* label instead.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions