Skip to content

Commit 34e65f7

Browse files
committed
Merge branch 'PHP-7.3'
* PHP-7.3: Fix #76825: Undefined symbols ___cpuid_count
2 parents dbef28e + 7625f97 commit 34e65f7

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

Zend/Zend.m4

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -491,3 +491,21 @@ dnl This is the most probable fallback so we assume yes in case of cross compile
491491
if test "$ac_cv_huge_val_nan" = "yes"; then
492492
AC_DEFINE([HAVE_HUGE_VAL_NAN], 1, [whether HUGE_VAL + -HUGEVAL == NAN])
493493
fi
494+
495+
dnl
496+
dnl Check whether __cpuid_count is available
497+
dnl
498+
AC_CACHE_CHECK(whether __cpuid_count is available, ac_cv_cpuid_count_available, [
499+
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
500+
#include <cpuid.h>
501+
]], [[
502+
unsigned eax, ebx, ecx, edx;
503+
__cpuid_count(0, 0, eax, ebx, ecx, edx);
504+
]])], [
505+
ac_cv_cpuid_count_available=yes
506+
], [
507+
ac_cv_cpuid_count_available=no
508+
])])
509+
if test "$ac_cv_cpuid_count_available" = "yes"; then
510+
AC_DEFINE([HAVE_CPUID_COUNT], 1, [whether __cpuid_count is available])
511+
fi

Zend/zend_cpuinfo.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ typedef struct _zend_cpu_info {
2929
static zend_cpu_info cpuinfo = {0};
3030

3131
#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
32-
# ifdef HAVE_CPUID_H
32+
# if defined(HAVE_CPUID_H) && defined(HAVE_CPUID_COUNT)
3333
# include <cpuid.h>
3434
static void __zend_cpuid(uint32_t func, uint32_t subfunc, zend_cpu_info *cpuinfo) {
3535
__cpuid_count(func, subfunc, cpuinfo->eax, cpuinfo->ebx, cpuinfo->ecx, cpuinfo->edx);

0 commit comments

Comments
 (0)