Bug #76825 [Asn->Csd]: Undefined symbols ___cpuid_count

From: Date: Mon, 05 Nov 2018 17:26:09 +0000
Subject: Bug #76825 [Asn->Csd]: Undefined symbols ___cpuid_count
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-217833@lists.php.net to get a copy of this message
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:             Assigned
+Status:             Closed
 Type:               Bug
 Package:            Compile Failure
 Operating System:   Mac OS X 10.7.5
 PHP Version:        7.3.0beta3
 Assigned To:        cmb
 Block user comment: N
 Private report:     N

 New Comment:

Automatic comment on behalf of cmbecker69@gmx.de
Revision: http://git.php.net/?p=php-src.git;a=commit;h=7625f972db10fe1a69757b97c6dec57ea049129b
Log: Fix #76825: Undefined symbols ___cpuid_count


Previous Comments:
------------------------------------------------------------------------
[2018-10-26 15:58:27] php-bugs-2018 at ryandesign dot com

Yes, it works with AC_LINK_IFELSE. Thanks!

------------------------------------------------------------------------
[2018-10-26 14:46:28] cmb@php.net

> It looks like the problem is that the compiler is being invoked
> using the "-c" flag, which skips the link phase which is where
> the error occurs.

Then we'll have to replace the AC_COMPILE_IFELSE with
AC_LINK_IFELSE.  Can you please try that?

------------------------------------------------------------------------
[2018-10-26 14:36:13] php-bugs-2018 at ryandesign dot com

Sorry for the delay. The configure test says __cpuid_count
is available, though it's obviously not. Here's what
config.log says about it:


configure:5874: checking whether __cpuid_count is available
configure:5896: /usr/bin/clang -c -pipe -Os -arch x86_64 -fvisibility=hidden -I/opt/local/include
-no-cpp-precomp conftest.c >&5
conftest.c:34:3: warning: implicit declaration of function '__cpuid_count' is invalid in
C99 [-Wimplicit-function-declaration]
  __cpuid_count(0, 0, eax, ebx, ecx, edx);
  ^
1 warning generated.
configure:5896: $? = 0
configure:5907: result: yes


It looks like the problem is that the compiler is being
invoked using the "-c" flag, which skips the link phase
which is where the error occurs. I can reproduce this
with a small test program:


$ clang -c test.c; echo $?
test.c:5:1: warning: implicit declaration of function '__cpuid_count' is invalid in C99
[-Wimplicit-function-declaration]
__cpuid_count(0, 0, eax, ebx, ecx, edx);
^
1 warning generated.
0


$ clang test.c; echo $?
test.c:5:1: warning: implicit declaration of function '__cpuid_count' is invalid in C99
[-Wimplicit-function-declaration]
__cpuid_count(0, 0, eax, ebx, ecx, edx);
^
1 warning generated.
Undefined symbols for architecture x86_64:
  "___cpuid_count", referenced from:
      _main in test-eIiJ3P.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
1

------------------------------------------------------------------------
[2018-10-17 12:00:00] cmb@php.net

Please check the attached check-cpuid-count patch.

------------------------------------------------------------------------
[2018-10-17 11:59:56] cmb@php.net

The following patch has been added/updated:

Patch Name: check-cpuid-count
Revision:   1539777596
URL:        https://bugs.php.net/patch-display.php?bug=76825&patch=check-cpuid-count&revision=1539777596

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=76825


--
Edit this bug report at https://bugs.php.net/bug.php?id=76825&edit=1


Thread (13 messages)

« previous php.bugs (#217833) next »