On Tue, Jul 29, 2025 at 11:21:41AM +0900, Michael Paquier wrote:
> The attached warrants a backpatch to me, thoughts?

That's of course better with the patch.
--
Michael
From de3aa52f66829043fb50957fcd2b6b57c5309220 Mon Sep 17 00:00:00 2001
From: Michael Paquier <mich...@paquier.xyz>
Date: Tue, 29 Jul 2025 11:20:22 +0900
Subject: [PATCH] Fix ./configure checks with __cpuidex() and __cpuid()

---
 configure    | 4 ++--
 configure.ac | 4 ++--
 meson.build  | 5 +----
 3 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/configure b/configure
index 6d7c22e153fe..903e748e90bf 100755
--- a/configure
+++ b/configure
@@ -17646,7 +17646,7 @@ int
 main ()
 {
 unsigned int exx[4] = {0, 0, 0, 0};
-  __get_cpuid(exx[0], 1);
+  __cpuid(exx, 1);
 
   ;
   return 0;
@@ -17680,7 +17680,7 @@ int
 main ()
 {
 unsigned int exx[4] = {0, 0, 0, 0};
-  __get_cpuidex(exx[0], 7, 0);
+  __cpuidex(exx, 7, 0);
 
   ;
   return 0;
diff --git a/configure.ac b/configure.ac
index c2877e369350..fe754a36d8d4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2070,7 +2070,7 @@ fi
 AC_CACHE_CHECK([for __cpuid], [pgac_cv__cpuid],
 [AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <intrin.h>],
   [[unsigned int exx[4] = {0, 0, 0, 0};
-  __get_cpuid(exx[0], 1);
+  __cpuid(exx, 1);
   ]])],
   [pgac_cv__cpuid="yes"],
   [pgac_cv__cpuid="no"])])
@@ -2081,7 +2081,7 @@ fi
 AC_CACHE_CHECK([for __cpuidex], [pgac_cv__cpuidex],
 [AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <intrin.h>],
   [[unsigned int exx[4] = {0, 0, 0, 0};
-  __get_cpuidex(exx[0], 7, 0);
+  __cpuidex(exx, 7, 0);
   ]])],
   [pgac_cv__cpuidex="yes"],
   [pgac_cv__cpuidex="no"])])
diff --git a/meson.build b/meson.build
index 5365aaf95e64..ca423dc8e12f 100644
--- a/meson.build
+++ b/meson.build
@@ -1996,10 +1996,7 @@ if cc.links('''
   cdata.set('HAVE__BUILTIN_OP_OVERFLOW', 1)
 endif
 
-
-# XXX: The configure.ac check for __cpuid() is broken, we don't copy that
-# here. To prevent problems due to two detection methods working, stop
-# checking after one.
+# Check for __get_cpuid() and __cpuid().
 if cc.links('''
     #include <cpuid.h>
     int main(int arg, char **argv)
-- 
2.50.0

Attachment: signature.asc
Description: PGP signature

Reply via email to