Edit report at https://bugs.php.net/bug.php?id=76825&edit=1
ID: 76825
Updated by: cmb@php.net
Reported by: php-bugs-2018 at ryandesign dot com
Summary: Undefined symbols ___cpuid_count
Status: Open
Type: Bug
Package: Compile Failure
Operating System: Mac OS X 10.7.5
PHP Version: 7.3.0beta3
Block user comment: N
Private report: N
New Comment:
I don't understand the compile failure under Clang, since the
respective code is guarded by defined(__GNUC__)[1].
Anyhow, we should use feature detection (AC_TRY_LINK) instead of
inferring by compiler, in my opinion.
[1] <https://github.com/php/php-src/blob/php-7.3.0beta3/Zend/zend_cpuinfo.c#L31-L35>
Previous Comments:
------------------------------------------------------------------------
[2018-08-31 02:35:32] php-bugs-2018 at ryandesign dot com
Description:
------------
Hello, php 7.3.0beta3 fails to build on Mac OS X 10.7.5 using the clang 425.0.28 compiler that ships
with Xcode 4.6.3:
Zend/zend_cpuinfo.c:34:2: warning: implicit declaration of function '__cpuid_count' is
invalid in C99 [-Wimplicit-function-declaration]
__cpuid_count(func, subfunc, cpuinfo->eax, cpuinfo->ebx, cpuinfo->ecx,
cpuinfo->edx);
^
...
Undefined symbols for architecture x86_64:
"___cpuid_count", referenced from:
_zend_cpu_startup in zend_cpuinfo.o
On Mac OS X 10.6.8 using the Apple gcc 4.2.1 compiler that ships with Xcode 3.2.6, there is a
different but seemingly related error:
Zend/zend_cpuinfo.c:32:19: error: cpuid.h: No such file or directory
The commit that probably introduced this problem is https://github.com/php/php-src/commit/1a078117b5ae862b18ef5362accef4b4d0a6b7c4
Using a newer compiler does work around the problem, but requiring users to install or possibly even
build a newer compiler can be an imposition. It looks like php used to have some custom assembly
that was replaced with a call to __cpuid_count, and there was discussion in https://github.com/php/php-src/pull/3395 about
whether the old code should be retained as a fallback, and it was decided not to do so until someone
reported a build failure; this ticket is that build failure report.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=76825&edit=1