com php-src: The cpu setup is still needed when ifunc is supported: Zend/zend.c Zend/zend_cpuinfo.c
| From: | Anatol Belski | Date: | Tue, 16 Jan 2018 10:55:19 +0000 |
| Subject: | com php-src: The cpu setup is still needed when ifunc is supported: Zend/zend.c Zend/zend_cpuinfo.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-100910@lists.php.net to get a copy of this message | ||
Commit: 74de5461eb97536ef774fb61ce373d2edbe8d82a
Author: Anatol Belski <ab@php.net> Tue, 16 Jan 2018 11:55:19 +0100
Parents: 1fd651650fb4821054decac5a0664f88fe4e55c3
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=74de5461eb97536ef774fb61ce373d2edbe8d82a
Log:
The cpu setup is still needed when ifunc is supported
Changed paths:
M Zend/zend.c
M Zend/zend_cpuinfo.c
Diff:
diff --git a/Zend/zend.c b/Zend/zend.c
index effc95d..ba84f84 100644
--- a/Zend/zend.c
+++ b/Zend/zend.c
@@ -753,7 +753,9 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions) /
extern zend_php_scanner_globals language_scanner_globals;
#endif
+#ifndef HAVE_FUNC_ATTRIBUTE_IFUNC
zend_cpu_startup();
+#endif
#ifdef ZEND_WIN32
php_win32_cp_set_by_id(65001);
diff --git a/Zend/zend_cpuinfo.c b/Zend/zend_cpuinfo.c
index ce92460..2b087af 100644
--- a/Zend/zend_cpuinfo.c
+++ b/Zend/zend_cpuinfo.c
@@ -68,6 +68,10 @@ void zend_cpu_startup(void)
}
ZEND_API int zend_cpu_supports(zend_cpu_feature feature) {
+#ifdef HAVE_FUNC_ATTRIBUTE_IFUNC
+ /* The resolver is invoked before zend_startup(). */
+ zend_cpu_startup();
+#endif
if (feature & ZEND_CPU_EDX_MASK) {
return (cpuinfo.edx & (feature & ~ZEND_CPU_EDX_MASK));
} else {