[llvm] [gn build] Guard the BLAKE3 assembly sources with platform (PR #70110)

Gowtham Tammana via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 24 12:58:01 PDT 2023


https://github.com/gowtham-sarc created https://github.com/llvm/llvm-project/pull/70110

The source_set target defined for `llvm/lib/Support/BLAKE3` has assembly files that are specific to x64 platform. Adding the relevant  conditional for this target.

>From a245796b8776bb44b864fc6396dbeac367e9921d Mon Sep 17 00:00:00 2001
From: Gowtham Tammana <g.tammana at samsung.com>
Date: Tue, 24 Oct 2023 13:21:09 -0500
Subject: [PATCH] [gn build] Guard the BLAKE3 assembly sources with platform

The source_set target defined for `llvm/lib/Support/BLAKE3` has assembly
files that are specific to x64 platform. Adding the relevant  conditional
for this target.

Signed-off-by: Gowtham Tammana <g.tammana at samsung.com>
---
 .../llvm/lib/Support/BLAKE3/BUILD.gn          | 31 ++++++++++++-------
 1 file changed, 19 insertions(+), 12 deletions(-)

diff --git a/llvm/utils/gn/secondary/llvm/lib/Support/BLAKE3/BUILD.gn b/llvm/utils/gn/secondary/llvm/lib/Support/BLAKE3/BUILD.gn
index e980be728ed4e30..18f382ea3086c24 100644
--- a/llvm/utils/gn/secondary/llvm/lib/Support/BLAKE3/BUILD.gn
+++ b/llvm/utils/gn/secondary/llvm/lib/Support/BLAKE3/BUILD.gn
@@ -15,16 +15,23 @@ static_library("BLAKE3") {
   ]
 }
 
-source_set("hack") {
-  sources = [
-    "blake3_avx2_x86-64_unix.S",
-    "blake3_avx2_x86-64_windows_gnu.S",
-    "blake3_avx512_x86-64_unix.S",
-    "blake3_avx512_x86-64_windows_gnu.S",
-    "blake3_neon.c",
-    "blake3_sse2_x86-64_unix.S",
-    "blake3_sse2_x86-64_windows_gnu.S",
-    "blake3_sse41_x86-64_unix.S",
-    "blake3_sse41_x86-64_windows_gnu.S",
-  ]
+if (current_cpu == "x64") {
+  source_set("hack") {
+    sources = [ "blake3_neon.c " ]
+    if (current_os == "linux") {
+      sources += [
+        "blake3_avx2_x86-64_unix.S",
+        "blake3_avx512_x86-64_unix.S",
+        "blake3_sse2_x86-64_unix.S",
+        "blake3_sse41_x86-64_unix.S",
+      ]
+    } else if (current_os == "win") {
+      sources += [
+        "blake3_avx2_x86-64_windows_gnu.S",
+        "blake3_avx512_x86-64_windows_gnu.S",
+        "blake3_sse2_x86-64_windows_gnu.S",
+        "blake3_sse41_x86-64_windows_gnu.S",
+      ]
+    }
+  }
 }



More information about the llvm-commits mailing list