From 36ad0375fa6bd13c1c4e8fa89896e0f32fa22e1f Mon Sep 17 00:00:00 2001 From: Mauricio G Date: Thu, 31 Aug 2023 10:39:04 -0700 Subject: [PATCH 1/4] Disable using NEON instructions on linux arm64 otherwise getting libunix_jni.so: undefined symbol: blake3_hash_many_neon see https://github.com/bazelbuild/bazel/commit/d0de5e044c65fe7c5e414f860887be20087732da --- third_party/blake3/blake3.BUILD | 3 +++ 1 file changed, 3 insertions(+) diff --git a/third_party/blake3/blake3.BUILD b/third_party/blake3/blake3.BUILD index f141a9c32503d6..d89030ea76b33b 100644 --- a/third_party/blake3/blake3.BUILD +++ b/third_party/blake3/blake3.BUILD @@ -57,6 +57,9 @@ cc_library( # lacking the headers to compile AVX512. "-DBLAKE3_NO_AVX512", ], + "@bazel_tools//src/conditions:linux_arm64": [ + "-DBLAKE3_USE_NEON=0", + ], "@bazel_tools//src/conditions:windows_x64": [], "@bazel_tools//src/conditions:windows_arm64": [ "-DBLAKE3_USE_NEON=0", From 380762f3c716c7827c63906b69675b4403dc221a Mon Sep 17 00:00:00 2001 From: Mauricio G Date: Thu, 31 Aug 2023 10:44:21 -0700 Subject: [PATCH 2/4] Update blake3.BUILD --- third_party/blake3/blake3.BUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third_party/blake3/blake3.BUILD b/third_party/blake3/blake3.BUILD index d89030ea76b33b..b9cd0803b4e119 100644 --- a/third_party/blake3/blake3.BUILD +++ b/third_party/blake3/blake3.BUILD @@ -57,7 +57,7 @@ cc_library( # lacking the headers to compile AVX512. "-DBLAKE3_NO_AVX512", ], - "@bazel_tools//src/conditions:linux_arm64": [ + "@bazel_tools//src/conditions:linux_aarch64": [ "-DBLAKE3_USE_NEON=0", ], "@bazel_tools//src/conditions:windows_x64": [], From 8b3ed2234f3d52ebf8ff35ac579e5eab4cb6627c Mon Sep 17 00:00:00 2001 From: Mauricio G Date: Thu, 31 Aug 2023 13:32:43 -0700 Subject: [PATCH 3/4] Update blake3.BUILD --- third_party/blake3/blake3.BUILD | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/third_party/blake3/blake3.BUILD b/third_party/blake3/blake3.BUILD index b9cd0803b4e119..205bc44fd16a2d 100644 --- a/third_party/blake3/blake3.BUILD +++ b/third_party/blake3/blake3.BUILD @@ -36,6 +36,9 @@ cc_library( "c/blake3_sse2_x86-64_unix.S", "c/blake3_sse41_x86-64_unix.S", ], + "@bazel_tools//src/conditions:linux_aarch64": [ + "c/blake3_neon.c", + ], "@bazel_tools//src/conditions:windows_x64": [ "c/blake3_avx2_x86-64_windows_msvc.asm", "c/blake3_avx512_x86-64_windows_msvc.asm", @@ -57,8 +60,8 @@ cc_library( # lacking the headers to compile AVX512. "-DBLAKE3_NO_AVX512", ], - "@bazel_tools//src/conditions:linux_aarch64": [ - "-DBLAKE3_USE_NEON=0", + "@bazel_tools//src/conditions:linux_aarch64": [ + "-DBLAKE3_USE_NEON=1", ], "@bazel_tools//src/conditions:windows_x64": [], "@bazel_tools//src/conditions:windows_arm64": [ From a8a8182944760ddbddc0650604dd97025837e5da Mon Sep 17 00:00:00 2001 From: Mauricio G Date: Fri, 1 Sep 2023 09:19:39 -0700 Subject: [PATCH 4/4] Update blake3.BUILD --- third_party/blake3/blake3.BUILD | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/third_party/blake3/blake3.BUILD b/third_party/blake3/blake3.BUILD index 205bc44fd16a2d..d8e76ece8660aa 100644 --- a/third_party/blake3/blake3.BUILD +++ b/third_party/blake3/blake3.BUILD @@ -45,6 +45,9 @@ cc_library( "c/blake3_sse2_x86-64_windows_msvc.asm", "c/blake3_sse41_x86-64_windows_msvc.asm", ], + "@bazel_tools//src/conditions:windows_arm64": [ + "c/blake3_neon.c", + ], "@bazel_tools//src/conditions:darwin_arm64": [ "c/blake3_neon.c", ], @@ -65,7 +68,7 @@ cc_library( ], "@bazel_tools//src/conditions:windows_x64": [], "@bazel_tools//src/conditions:windows_arm64": [ - "-DBLAKE3_USE_NEON=0", + "-DBLAKE3_USE_NEON=1", ], "@bazel_tools//src/conditions:darwin_arm64": [ "-DBLAKE3_USE_NEON=1",