From 6a966a55ad376a266e31e5aac834fe055a51205a Mon Sep 17 00:00:00 2001
From: Sergey Fedorov <vital.had@gmail.com>
Date: Mon, 15 Dec 2025 19:33:17 +0800
Subject: [PATCH] x86_64 target: 128-bit atomics is broken, default to
 64-bit

---
 compiler/rustc_target/src/spec/x86_64_apple_darwin.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/compiler/rustc_target/src/spec/x86_64_apple_darwin.rs b/compiler/rustc_target/src/spec/x86_64_apple_darwin.rs
index dc7597fe7b2..c4c9443cfb5 100644
--- a/compiler/rustc_target/src/spec/x86_64_apple_darwin.rs
+++ b/compiler/rustc_target/src/spec/x86_64_apple_darwin.rs
@@ -3,7 +3,7 @@
 pub fn target() -> Target {
     let mut base = super::apple_base::opts("macos");
     base.cpu = "core2".to_string();
-    base.max_atomic_width = Some(128); // core2 support cmpxchg16b
+    base.max_atomic_width = Some(64); // core2 support cmpxchg16b, but LLVM produces broken code for it.
     base.eliminate_frame_pointer = false;
     base.pre_link_args.insert(
         LinkerFlavor::Gcc,
