depends, qt: Fix build on aarch64 macOS 26.4
What changed, and why it matters
This commit fixes a build problem when compiling Bitcoin Core's bundled Qt library on Apple Silicon Macs using a future macOS 26.4 software development kit. It changes the order in which the compiler checks for a low-level CPU 'yield' instruction so that the correct built-in function is chosen, avoiding an 'implicit function declaration' compiler error. There is no runtime security issue here; it is purely a compilation fix.
No security action required. Treat as a normal build-fix patch. Reviewers may verify the patch applies cleanly and that aarch64 macOS builds succeed.
Security signals we found
No security-relevant code change identified
Build-system / compilation compatibility patch only
No memory safety, cryptography, consensus, network, or permission changes
Evidence from the diff
The patch backports a Qt fix (QTBUG-145239) for qyieldcpu.h. On macOS 26.4 SDK, Clang reports __has_builtin(__yield) as true, but __yield() now requires
Changed components
depends/packages/native_qt.mkdepends/packages/qt.mkdepends/patches/qt/fix-macos26-qyield.patchInspect captured patch +49 / −1
diff --git a/depends/packages/native_qt.mk b/depends/packages/native_qt.mk
index 3e1e5626..2bf088c1 100644
--- a/depends/packages/native_qt.mk
+++ b/depends/packages/native_qt.mk
@@ -9,6 +9,7 @@ $(package)_patches := dont_hardcode_pwd.patch
$(package)_patches += qtbase_skip_tools.patch
$(package)_patches += rcc_hardcode_timestamp.patch
$(package)_patches += qttools_skip_dependencies.patch
+$(package)_patches += fix-macos26-qyield.patch
$(package)_qttranslations_file_name=$(qt_details_qttranslations_file_name)
$(package)_qttranslations_sha256_hash=$(qt_details_qttranslations_sha256_hash)
@@ -137,7 +138,8 @@ define $(package)_preprocess_cmds
patch -p1 -i $($(package)_patch_dir)/dont_hardcode_pwd.patch && \
patch -p1 -i $($(package)_patch_dir)/qtbase_skip_tools.patch && \
patch -p1 -i $($(package)_patch_dir)/rcc_hardcode_timestamp.patch && \
- patch -p1 -i $($(package)_patch_dir)/qttools_skip_dependencies.patch
+ patch -p1 -i $($(package)_patch_dir)/qttools_skip_dependencies.patch && \
+ patch -p1 -i $($(package)_patch_dir)/fix-macos26-qyield.patch
endef
define $(package)_config_cmds
diff --git a/depends/packages/qt.mk b/depends/packages/qt.mk
index 9b5069a5..9b7cec34 100644
--- a/depends/packages/qt.mk
+++ b/depends/packages/qt.mk
@@ -24,6 +24,7 @@ $(package)_patches += fix-gcc16-sfinae-qregularexpression.patch
$(package)_patches += fix-gcc16-sfinae-qchar.patch
$(package)_patches += fix-gcc16-sfinae-qbitarray.patch
$(package)_patches += fix-gcc16-sfinae-qanystringview.patch
+$(package)_patches += fix-macos26-qyield.patch
$(package)_patches += fix-qbytearray-include.patch
$(package)_qttranslations_file_name=$(qt_details_qttranslations_file_name)
@@ -282,6 +283,7 @@ define $(package)_preprocess_cmds
patch -p1 -i $($(package)_patch_dir)/fix-gcc16-sfinae-qchar.patch && \
patch -p1 -i $($(package)_patch_dir)/fix-gcc16-sfinae-qbitarray.patch && \
patch -p1 -i $($(package)_patch_dir)/fix-gcc16-sfinae-qanystringview.patch && \
+ patch -p1 -i $($(package)_patch_dir)/fix-macos26-qyield.patch && \
patch -p1 -i $($(package)_patch_dir)/fix-qbytearray-include.patch
endef
ifeq ($(host),$(build))
diff --git a/depends/patches/qt/fix-macos26-qyield.patch b/depends/patches/qt/fix-macos26-qyield.patch
new file mode 100644
index 00000000..65514a01
--- /dev/null
+++ b/depends/patches/qt/fix-macos26-qyield.patch
@@ -0,0 +1,44 @@
+commit a76004f16fdc43e1b7af83bfdf3f1a613491b234
+Author: Paul Wicking <paul.wicking@qt.io>
+Date: Thu Mar 26 07:09:43 2026 +0100
+
+ qyieldcpu: Fix compilation with macOS 26.4 SDK
+
+ After updating to the macOS 26.4 SDK, qtbase fails to compile on
+ Apple Silicon with an implicit function declaration error for
+ __yield() in qyieldcpu.h. It appears that the SDK's Clang now
+ reports __has_builtin(__yield) as true, but __yield() requires
+ <arm_acle.h> for its declaration.
+
+ The compiler's own __builtin_arm_yield intrinsic was already checked
+ further down in the cascade. Moving it above the __yield check resolves
+ the build failure, without unnecessarily pulling in the header.
+
+ Fixes: QTBUG-145239
+ Change-Id: I94b4d8f72385a4944c272ed7a66d249537a82e7d
+ Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
+ Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
+
+--- a/qtbase/src/corelib/thread/qyieldcpu.h
++++ b/qtbase/src/corelib/thread/qyieldcpu.h
+@@ -31,7 +31,9 @@ void qYieldCpu(void)
+ noexcept
+ #endif
+ {
+-#if __has_builtin(__yield)
++#if __has_builtin(__builtin_arm_yield)
++ __builtin_arm_yield();
++#elif __has_builtin(__yield)
+ __yield(); // Generic
+ #elif defined(_YIELD_PROCESSOR) && defined(Q_CC_MSVC)
+ _YIELD_PROCESSOR(); // Generic; MSVC's <atomic>
+@@ -45,9 +47,6 @@ void qYieldCpu(void)
+ _mm_pause();
+ #elif defined(Q_PROCESSOR_X86)
+ __asm__("pause"); // hopefully asm() works in this compiler
+-
+-#elif __has_builtin(__builtin_arm_yield)
+- __builtin_arm_yield();
+ #elif defined(Q_PROCESSOR_ARM) && Q_PROCESSOR_ARM >= 7 && defined(Q_CC_GNU)
+ __asm__("yield"); // this works everywhere
+
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.