folly: fix x86_64-darwin build

This commit is contained in:
Matteo Pacini
2026-06-18 15:32:08 +01:00
parent f8a250e19b
commit 6a2b8031f1
2 changed files with 16 additions and 0 deletions
@@ -0,0 +1,11 @@
--- a/folly/test/MemsetBenchmark.cpp
+++ b/folly/test/MemsetBenchmark.cpp
@@ -40,7 +40,7 @@
template <void* memset_impl(void*, int, size_t)>
void bmMemset(void* buf, size_t length, size_t iters) {
-#if !defined(__aarch64__)
+#if !defined(__aarch64__) && !defined(__APPLE__)
__asm__ volatile(".align 64\n");
#endif
#pragma unroll(1)
+5
View File
@@ -144,6 +144,11 @@ stdenv.mkDerivation (finalAttrs: {
# https://github.com/facebook/folly/pull/2561
./memset-memcpy-aarch64.patch
# `.align 64` is invalid on x86_64 Mach-O, where `.align` takes a
# power-of-two exponent (64 means 2^64). The guard only excluded
# aarch64, so add !__APPLE__ to also skip x86_64-darwin.
./memset-benchmark-darwin.patch
# Use feature detection directly instead of private standard library
# macros to detect the presence of ASAN and otherwise fallback to
# _not_ having ASAN.