From e8a0d2b477d8da7a087bef98feb7e08d320b8051 Mon Sep 17 00:00:00 2001 From: YANG XIN Date: Mon, 22 Jun 2026 16:57:49 +0800 Subject: [PATCH] Fix rdtscp detection with --with-lg-vaddr The rdtscp probe was nested inside the x86_64 LG_VADDR auto-detection block. Passing --with-lg-vaddr skipped the probe and left JEMALLOC_HAVE_RDTSCP undefined even when the instruction was available. Keep the probe in the x86_64 branch, but run it independently from LG_VADDR auto-detection. --- configure.ac | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/configure.ac b/configure.ac index 6532af1c..c2b83a1f 100644 --- a/configure.ac +++ b/configure.ac @@ -600,9 +600,10 @@ typedef unsigned __int32 uint32_t; else AC_MSG_ERROR([cannot determine number of significant virtual address bits]) fi - AC_CACHE_CHECK([rdtscp support], - [je_cv_rdtscp], - AC_RUN_IFELSE([AC_LANG_PROGRAM( + fi + AC_CACHE_CHECK([rdtscp support], + [je_cv_rdtscp], + AC_RUN_IFELSE([AC_LANG_PROGRAM( [[ #include ]], @@ -611,12 +612,11 @@ typedef unsigned __int32 uint32_t; asm volatile("rdtscp" : "=d"(dx) ::); return 0; ]])], - [je_cv_rdtscp=yes], - [je_cv_rdtscp=no], - [je_cv_rdtscp=no])) - if test "x${je_cv_rdtscp}" = "xyes"; then - AC_DEFINE([JEMALLOC_HAVE_RDTSCP], [ ], [ ]) - fi + [je_cv_rdtscp=yes], + [je_cv_rdtscp=no], + [je_cv_rdtscp=no])) + if test "x${je_cv_rdtscp}" = "xyes"; then + AC_DEFINE([JEMALLOC_HAVE_RDTSCP], [ ], [ ]) fi ;; *)