]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
configure.ac: fix build lzcnt test to work on both i386 and amd64
authorMark Wielaard <mark@klomp.org>
Sun, 26 Oct 2025 14:23:23 +0000 (15:23 +0100)
committerMark Wielaard <mark@klomp.org>
Sun, 26 Oct 2025 14:23:31 +0000 (15:23 +0100)
The BUILD_LZCNT_TESTS conditional is used in both
none/tests/x86/Makefile.am and none/tests/amd64/Makefile.am to check
whether to build the lzcnt32 and lzcnt64 test program. However the
configure test uses %rax which is only available on amd64. Use %eax
instead to make sure the configure test succeeds on both i386 and
amd64.

configure.ac

index 9629e24ca09e3df3e3964b8f88aa96c39f3ad1e5..0092ad2ae037f1480e5828cd96d40b77ee782837 100644 (file)
@@ -3343,7 +3343,7 @@ AC_MSG_CHECKING([if x86/amd64 assembler supports 'lzcnt'])
 
 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
   do {                  
-      __asm__ __volatile__("lzcnt %%rax,%%rax" : : : "rax");
+      __asm__ __volatile__("lzcnt %%eax,%%eax" : : : "eax");
   } while (0)
 ]])], [
   ac_have_as_lzcnt=yes