Patch zend_cpuinfo.c.patch for Compile Failure Bug #76654
Patch version 2018-11-15 07:11 UTC
Return to Bug #76654 |
Download this patch
Patch Revisions:
Developer: php-bugs-2018@ryandesign.com
Provide an i386 implementation of __zend_cpuid, based on __cpuid_count from
cpuid.h in Xcode 5.1.1.
https://bugs.php.net/bug.php?id=76654
--- a/Zend/zend_cpuinfo.c.orig 2018-11-06 04:22:56.000000000 -0600
+++ b/Zend/zend_cpuinfo.c 2018-11-15 00:16:54.000000000 -0600
@@ -36,11 +36,23 @@
}
# else
static void __zend_cpuid(uint32_t func, uint32_t subfunc, zend_cpu_info *cpuinfo) {
+#ifdef __i386__
+ /* PIC on i386 uses %ebx, so preserve it. */
+ __asm__ __volatile__ (
+ "pushl %%ebx\n"
+ "cpuid\n"
+ "mov %%ebx,%1\n"
+ "popl %%ebx"
+ : "=a"(cpuinfo->eax), "=r"(cpuinfo->ebx), "=c"(cpuinfo->ecx), "=d"(cpuinfo->edx)
+ : "a"(func), "c"(subfunc)
+ );
+#else
__asm__ __volatile__ (
"cpuid"
: "=a"(cpuinfo->eax), "=b"(cpuinfo->ebx), "=c"(cpuinfo->ecx), "=d"(cpuinfo->edx)
: "a"(func), "c"(subfunc)
);
+#endif
}
# endif
#elif defined(ZEND_WIN32) && !defined(__clang__)
|