Closed
Description
Update: I forgot to write the command, its
RUSTFLAGS="-Z sanitizer=thread" cargo +nightly test -Z build-std --target aarch64-apple-darwin "$@"
I tried this code:
// A blank lib.rs for a library project also works.
use core::sync::atomic::AtomicUsize;
fn main() {
println!("Hello, world!",);
}
I expected to see this happen: compiles fine
Instead, this happened: I get an rustc-LLVM ERROR: Broken function found, compilation aborted!
.
This does not occur on nightly-2024-03-12
.
Meta
rustc --version --verbose
:
rustc 1.78.0-nightly (3cbb93223 2024-03-13)
binary: rustc
commit-hash: 3cbb93223f33024db464a4df27a13c7cce870173
commit-date: 2024-03-13
host: aarch64-apple-darwin
release: 1.78.0-nightly
LLVM version: 18.1.0
Backtrace
janggun@J-Lee-MacBook-Air RUSTFLAGS="-Z sanitizer=thread" cargo +nightly test -Z build-std --target aarch64-apple-darwin "$@"
Compiling std v0.0.0 (/Users/janggun/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std)
Compiling rustc-std-workspace-std v1.99.0 (/Users/janggun/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/rustc-std-workspace-std)
Compiling proc_macro v0.0.0 (/Users/janggun/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/proc_macro)
Compiling unicode-width v0.1.11
Compiling getopts v0.2.21
Compiling test v0.0.0 (/Users/janggun/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/test)
ZExt only operates on integer
%13 = zext ptr %1 to i64, !dbg !6602
ZExt only operates on integer
%16 = zext ptr %1 to i64, !dbg !6603
ZExt only operates on integer
%19 = zext ptr %1 to i64, !dbg !6604
ZExt only operates on integer
%22 = zext ptr %1 to i64, !dbg !6605
ZExt only operates on integer
%25 = zext ptr %1 to i64, !dbg !6606
in function _ZN4core4sync6atomic11atomic_swap17hd7a3400f2ad7716aE
rustc-LLVM ERROR: Broken function found, compilation aborted!
error: could not compile `std` (lib)
warning: build failed, waiting for other jobs to finish...
ZExt only operates on integer
%13 = zext ptr %1 to i64, !dbg !5113
ZExt only operates on integer
%16 = zext ptr %1 to i64, !dbg !5114
ZExt only operates on integer
%19 = zext ptr %1 to i64, !dbg !5115
ZExt only operates on integer
%22 = zext ptr %1 to i64, !dbg !5116
ZExt only operates on integer
%25 = zext ptr %1 to i64, !dbg !5117
in function _ZN4core4sync6atomic11atomic_swap17h83c92551d8fdbc7aE
rustc-LLVM ERROR: Broken function found, compilation aborted!
error: could not compile `test` (lib)
Metadata
Metadata
Assignees
Labels
Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: Atomics, barriers, and sync primitivesArea: Sanitizers for correctness and code qualityCategory: This is a bug.Status: A Minimal Complete and Verifiable Example has been found for this issueRelevant to the compiler team, which will review and decide on the PR/issue.Issue expected to be fixed by the next major LLVM upgrade, or backported fixesThis issue requires a nightly compiler in some way.