diff --git a/pkgs/by-name/fo/folly/memset-benchmark-darwin.patch b/pkgs/by-name/fo/folly/memset-benchmark-darwin.patch new file mode 100644 index 000000000000..218789a22acb --- /dev/null +++ b/pkgs/by-name/fo/folly/memset-benchmark-darwin.patch @@ -0,0 +1,11 @@ +--- a/folly/test/MemsetBenchmark.cpp ++++ b/folly/test/MemsetBenchmark.cpp +@@ -40,7 +40,7 @@ + + template + 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) diff --git a/pkgs/by-name/fo/folly/package.nix b/pkgs/by-name/fo/folly/package.nix index 196179c9e423..379312d79ad4 100644 --- a/pkgs/by-name/fo/folly/package.nix +++ b/pkgs/by-name/fo/folly/package.nix @@ -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.