Skip to content

Commit 5ba95ac

Browse files
committed
Patch __cpuid_count too
1 parent 6c2a3b2 commit 5ba95ac

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

cpython-unix/build-cpython.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ if [ -n "${PYTHON_MEETS_MINIMUM_VERSION_3_12}" ]; then
318318
fi
319319

320320

321-
# For Python 3.14+, the include for `cpuid.h` is improperly guarded
321+
# For Python 3.14+, use of `cpuid` is improperly guarded
322322
if [[ -n "${PYTHON_MEETS_MINIMUM_VERSION_3_14}" && "${CC}" = "musl-clang" ]]; then
323323
patch -p1 -i ${ROOT}/patch-blake-musl-314.patch
324324
fi

cpython-unix/patch-blake-musl-314.patch

+9
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,12 @@ diff --git a/Modules/blake2module.c b/Modules/blake2module.c
1010
#include <cpuid.h>
1111
#elif defined(_M_X64)
1212
#include <intrin.h>
13+
@@ -76,7 +76,7 @@ void detect_cpu_features(cpu_flags *flags) {
14+
if (!flags->done) {
15+
int eax1 = 0, ebx1 = 0, ecx1 = 0, edx1 = 0;
16+
int eax7 = 0, ebx7 = 0, ecx7 = 0, edx7 = 0;
17+
-#if defined(__x86_64__) && defined(__GNUC__)
18+
+#if defined(__x86_64__) && defined(__GNULIBC__)
19+
__cpuid_count(1, 0, eax1, ebx1, ecx1, edx1);
20+
__cpuid_count(7, 0, eax7, ebx7, ecx7, edx7);
21+
#elif defined(_M_X64)

0 commit comments

Comments
 (0)