]> granicus.if.org Git - php/commitdiff
The cpu setup is still needed when ifunc is supported
authorAnatol Belski <ab@php.net>
Tue, 16 Jan 2018 10:55:19 +0000 (11:55 +0100)
committerAnatol Belski <ab@php.net>
Tue, 16 Jan 2018 10:55:19 +0000 (11:55 +0100)
Zend/zend.c
Zend/zend_cpuinfo.c

index effc95deb2060237fc0485a6705b721514bc15e7..ba84f84def2d0ed7e1f19157c8a8319f25017795 100644 (file)
@@ -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);
index ce92460fb4d09419d9d14c908db2d0f985db05d8..2b087afaefb88ffdaaadc49fdba6c2ea34e83df0 100644 (file)
@@ -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 {