Skip to content

Commit f86107e

Browse files
committed
libblake3: use windows asm under cygwin; disable avx512
the first one made it crash when using asm, the later avoids it failing to link at build time
1 parent 96e876c commit f86107e

File tree

2 files changed

+26
-3
lines changed

2 files changed

+26
-3
lines changed

libblake3/0001-use-windows-asm.patch

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
--- BLAKE3-1.6.1/c/CMakeLists.txt.orig 2025-03-15 08:06:05.461612600 +0100
2+
+++ BLAKE3-1.6.1/c/CMakeLists.txt 2025-03-15 08:06:15.407136700 +0100
3+
@@ -45,7 +45,7 @@
4+
set(BLAKE3_CFLAGS_AVX2 "-mavx2" CACHE STRING "the compiler flags to enable AVX2")
5+
set(BLAKE3_CFLAGS_AVX512 "-mavx512f -mavx512vl" CACHE STRING "the compiler flags to enable AVX512")
6+
7+
- if (WIN32)
8+
+ if (WIN32 OR CYGWIN)
9+
set(BLAKE3_AMD64_ASM_SOURCES
10+
blake3_avx2_x86-64_windows_gnu.S
11+
blake3_avx512_x86-64_windows_gnu.S

libblake3/PKGBUILD

+15-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
_realname=BLAKE3
44
pkgname=libblake3
55
pkgver=1.6.1
6-
pkgrel=1
6+
pkgrel=2
77
pkgdesc='The official C implementation of BLAKE3'
88
arch=(x86_64 i686)
99
url=https://github.com/BLAKE3-team/BLAKE3
@@ -19,10 +19,22 @@ makedepends=(
1919
cmake
2020
ninja
2121
)
22-
source=("https://github.com/BLAKE3-team/BLAKE3/archive/${pkgver}/${_realname}-${pkgver}.tar.gz")
23-
sha256sums=('1f2fbd93790694f1ad66eef26e23c42260a1916927184d78d8395ff1a512d285')
22+
source=("https://github.com/BLAKE3-team/BLAKE3/archive/${pkgver}/${_realname}-${pkgver}.tar.gz"
23+
0001-use-windows-asm.patch)
24+
sha256sums=('1f2fbd93790694f1ad66eef26e23c42260a1916927184d78d8395ff1a512d285'
25+
'ae47916bb5b5ae870718ffe09e58539513379ca2f1161d79f3cf28d4230d8e36')
26+
27+
prepare() {
28+
cd "${_realname}-${pkgver}"
29+
30+
patch -Np1 -i ../0001-use-windows-asm.patch
31+
}
2432

2533
build() {
34+
35+
# FIXME: fails to link otherwise
36+
CFLAGS+=" -DBLAKE3_NO_AVX512"
37+
2638
cmake \
2739
-GNinja \
2840
-DCMAKE_INSTALL_PREFIX=/usr \

0 commit comments

Comments
 (0)