diff --git a/utils/bazel/llvm-project-overlay/llvm/BUILD.bazel b/utils/bazel/llvm-project-overlay/llvm/BUILD.bazel --- a/utils/bazel/llvm-project-overlay/llvm/BUILD.bazel +++ b/utils/bazel/llvm-project-overlay/llvm/BUILD.bazel @@ -193,7 +193,19 @@ "lib/Support/BLAKE3/blake3.c", "lib/Support/BLAKE3/blake3_dispatch.c", "lib/Support/BLAKE3/blake3_portable.c", - ], + ] + select({ + "@platforms//cpu:aarch64": [ + "lib/Support/BLAKE3/blake3_neon.c", + ], + "@platforms//cpu:x86_64": [ + "lib/Support/BLAKE3/blake3_sse2_x86-64_unix.S", + "lib/Support/BLAKE3/blake3_sse41_x86-64_unix.S", + "lib/Support/BLAKE3/blake3_avx2_x86-64_unix.S", + "lib/Support/BLAKE3/blake3_avx512_x86-64_unix.S", + ], + "//conditions:default": [ + ] + }), hdrs = glob([ "include/llvm/Support/**/*.h", "include/llvm/ADT/*.h", @@ -213,13 +225,22 @@ "include/llvm/Support/VCSRevision.h", ], copts = llvm_copts, - defines = [ - "BLAKE3_NO_AVX2", - "BLAKE3_NO_AVX512", - "BLAKE3_NO_SSE2", - "BLAKE3_NO_SSE41", - "BLAKE3_USE_NEON=0", - ], + defines = select({ + "@platforms//cpu:aarch64": [ + ], + "//conditions:default": [ + "BLAKE3_USE_NEON=0", + ] + }) + select({ + "@platforms//cpu:x86_64": [ + ], + "//conditions:default": [ + "BLAKE3_NO_AVX2", + "BLAKE3_NO_AVX512", + "BLAKE3_NO_SSE2", + "BLAKE3_NO_SSE41", + ] + }), includes = ["include"], linkopts = select({ "@bazel_tools//src/conditions:windows": [],