Skip to content

Conversation

@oerdnj
Copy link
Contributor

@oerdnj oerdnj commented Jul 17, 2018

While reviewing while PHP 7.3 fails to build on Debian Jessie i386 (yeah, buggy gcc), I changed the custom assembly (that doesn't have to be volatile anyway) to use __cpuid_count() from #include <cpuid.h> (provided both by GCC and Clang).

@KalleZ
Copy link
Member

KalleZ commented Jul 17, 2018

Shouldn't there be a fallback on the assembly here? (Not familiar with the Unix build system)

@oerdnj
Copy link
Contributor Author

oerdnj commented Jul 17, 2018

cpuid.h header dates as far as CentOS 6 and gcc 4.4:

# find / -name cpuid.h
/usr/lib/gcc/x86_64-redhat-linux/4.4.4/include/cpuid.h

And __cpuid_count() was committed to gcc ~10 years ago:

gcc-mirror/gcc@25010f2#diff-7b30c1b65dd03819c31106f3963a17b3

So, in theory, it might be better to wrap the code into HAVE___CPUID_COUNT, in practise, I don't think it's worth the effort.

@cmb69
Copy link
Member

cmb69 commented Jul 18, 2018

@laruence Okay to merge?

@cmb69
Copy link
Member

cmb69 commented Jul 23, 2018

See https://bugs.php.net/76654.

@laruence
Copy link
Member

it's better to still include the asm codes as a backup... :)

@oerdnj
Copy link
Contributor Author

oerdnj commented Jul 23, 2018

@laruence Why exactly? Do you know any platform that is supported and would break without the fallback to the assembly? I can’t think of any.

@nikic
Copy link
Member

nikic commented Jul 23, 2018

Imho we should not include backup code unless someone actually complains. PHP already has a problem with too many useless and outdated #if's, let's please not add more.

@KalleZ
Copy link
Member

KalleZ commented Jul 23, 2018

I agree with @nikic let's go without and take it from there

@laruence
Copy link
Member

@oerdnj I just not sure about that...

@laruence
Copy link
Member

ok, fine, we could add it if there comes a broken build..

@php-pulls php-pulls merged commit 1a07811 into php:master Jul 24, 2018
@ryandesign
Copy link
Contributor

Imho we should not include backup code unless someone actually complains

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants