Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
matthiaskrgr opened this issue Mar 27, 2023 · 3 comments
Open

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

matthiaskrgr opened this issue Mar 27, 2023 · 3 comments
Assignees
Labels
A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. C-bug Category: This is a bug. glacier ICE tracked in rust-lang/glacier. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ requires-nightly This issue requires a nightly compiler in some way. S-bug-has-test Status: This bug is tracked inside the repo by a `known-bug` test. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@matthiaskrgr
Copy link
Member

matthiaskrgr commented Mar 27, 2023

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!

@matthiaskrgr matthiaskrgr added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. C-bug Category: This is a bug. S-has-mcve Status: A Minimal Complete and Verifiable Example has been found for this issue requires-nightly This issue requires a nightly compiler in some way. labels Mar 27, 2023
@rust-lang-glacier-bot rust-lang-glacier-bot added the glacier ICE tracked in rust-lang/glacier. label Apr 7, 2023
@mojingran
Copy link
Contributor

@rustbot claim

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Sep 8, 2023
Tests crash from inappropriate use of common linkage

Follows up my proposal under the [tracking issue for the linkage feature](rust-lang#29603 (comment)). Adds test for [issue 109681](rust-lang#109681).
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Sep 9, 2023
Rollup merge of rust-lang#113807 - mojingran:master, r=WaffleLapkin

Tests crash from inappropriate use of common linkage

Follows up my proposal under the [tracking issue for the linkage feature](rust-lang#29603 (comment)). Adds test for [issue 109681](rust-lang#109681).
@mojingran
Copy link
Contributor

mojingran commented Sep 11, 2023

@matthiaskrgr This issue should be closed, right?

@matthiaskrgr
Copy link
Member Author

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

@matthiaskrgr matthiaskrgr added the S-bug-has-test Status: This bug is tracked inside the repo by a `known-bug` test. label Apr 15, 2024
@jackh726 jackh726 removed the S-has-mcve Status: A Minimal Complete and Verifiable Example has been found for this issue label Sep 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. C-bug Category: This is a bug. glacier ICE tracked in rust-lang/glacier. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ requires-nightly This issue requires a nightly compiler in some way. S-bug-has-test Status: This bug is tracked inside the repo by a `known-bug` test. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

4 participants