What changed, and why it matters
This is a one-line build fix for compiling XMRig on ARM64 systems using the Clang compiler. It changes a preprocessor condition so that Clang on ARM64 does not try to use a GCC-specific memory prefetch instruction that Clang does not support in that configuration. There is no indication this affects runtime security, user data, or mining behavior; it only affects whether the source code compiles successfully.
No security action required. Treat as a normal build-compatibility fix. If deploying, verify ARM64 Clang builds now succeed and that RandomX performance is unchanged.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch narrows the __GNUC__ guard around __builtin_prefetch wrappers (rx_prefetch_nta/rx_prefetch_t0) to exclude Clang unless Clang actually provides __builtin_prefetch. On Clang/ARM64, __builtin_prefetch was apparently unavailable or problematic, causing compilation failures. The change is purely a portability/build-system fix in src/crypto/randomx/intrin_portable.h.
Changed components
src/crypto/randomx/intrin_portable.hInspect captured patch +1 / −1
### src/crypto/randomx/intrin_portable.h
@@ -577,7 +577,7 @@ inline void* rx_aligned_alloc(size_t size, size_t align) {
# define rx_aligned_free(a) free(a)
#endif
-#ifdef __GNUC__
+#if defined(__GNUC__) && (!defined(__clang__) || __has_builtin(__builtin_prefetch))
#define rx_prefetch_nta(x) __builtin_prefetch((x), 0, 0)
#define rx_prefetch_t0(x) __builtin_prefetch((x), 0, 3)
#elseWhy this scored 19/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.