8000 macOS Catalina 10.15.1 and php 7.4 compile error · Issue #32 · longxinH/xhprof · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

macOS Catalina 10.15.1 and php 7.4 compile error #32

New issue

Have a question about this project? Sig 8000 n up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
nohnaimer opened this issue Dec 4, 2019 · 7 comments
Closed

macOS Catalina 10.15.1 and php 7.4 compile error #32

nohnaimer opened this issue Dec 4, 2019 · 7 comments

Comments

@nohnaimer
Copy link

Hello,
After update on php 7.4 extension compile error:

and1@and1pc:~/Desktop/xhprof/extension$ make
/bin/sh /Users/and1/Desktop/xhprof/extension/libtool --mode=compile cc  -I. -I/Users/and1/Desktop/xhprof/extension -DPHP_ATOM_INC -I/Users/and1/Desktop/xhprof/extension/include -I/Users/and1/Desktop/xhprof/extension/main -I/Users/and1/Desktop/xhprof/extension -I/usr/local/Cellar/php/7.4.0/include/php -I/usr/local/Cellar/php/7.4.0/include/php/main -I/usr/local/Cellar/php/7.4.0/include/php/TSRM -I/usr/local/Cellar/php/7.4.0/include/php/Zend -I/usr/local/Cellar/php/7.4.0/include/php/ext -I/usr/local/Cellar/php/7.4.0/include/php/ext/date/lib  -DHAVE_CONFIG_H  -g -O2   -c /Users/and1/Desktop/xhprof/extension/xhprof.c -o xhprof.lo 
 cc -I. -I/Users/and1/Desktop/xhprof/extension -DPHP_ATOM_INC -I/Users/and1/Desktop/xhprof/extension/include -I/Users/and1/Desktop/xhprof/extension/main -I/Users/and1/Desktop/xhprof/extension -I/usr/local/Cellar/php/7.4.0/include/php -I/usr/local/Cellar/php/7.4.0/include/php/main -I/usr/local/Cellar/php/7.4.0/include/php/TSRM -I/usr/local/Cellar/php/7.4.0/include/php/Zend -I/usr/local/Cellar/php/7.4.0/include/php/ext -I/usr/local/Cellar/php/7.4.0/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /Users/and1/Desktop/xhprof/extension/xhprof.c  -fno-common -DPIC -o .libs/xhprof.o
/Users/and1/Desktop/xhprof/extension/xhprof.c:361:10: error: expected ';' after expression
    ulong h = 5381;
         ^
         ;
/Users/and1/Desktop/xhprof/extension/xhprof.c:361:5: error: use of undeclared identifier 'ulong'
    ulong h = 5381;
    ^
/Users/and1/Desktop/xhprof/extension/xhprof.c:361:11: error: use of undeclared identifier 'h'
    ulong h = 5381;
          ^
/Users/and1/Desktop/xhprof/extension/xhprof.c:366:9: error: use of undeclared identifier 'h'
        h += (h << 5);
        ^
/Users/and1/Desktop/xhprof/extension/xhprof.c:366:15: error: use of undeclared identifier 'h'
        h += (h << 5);
              ^
/Users/and1/Desktop/xhprof/extension/xhprof.c:367:9: error: use of undeclared identifier 'h'
        h ^= (ulong) *str++;
        ^
/Users/and1/Desktop/xhprof/extension/xhprof.c:367:15: error: use of undeclared identifier 'ulong'; did you
      mean 'long'?
        h ^= (ulong) *str++;
              ^~~~~
              long
/Users/and1/Desktop/xhprof/extension/xhprof.c:367:14: error: reference to overloaded function could not be
      resolved; did you mean to call it?
        h ^= (ulong) *str++;
             ^~~~~~~
/Users/and1/Desktop/xhprof/extension/xhprof.c:370:28: error: use of undeclared identifier 'ulong'; did you
      mean 'long'?
    for (i = 0; i < sizeof(ulong); i++) {
                           ^~~~~
                           long
/Users/and1/Desktop/xhprof/extension/xhprof.c:370:27: error: reference to overloaded function could not be
      resolved; did you mean to call it?
    for (i = 0; i < sizeof(ulong); i++) {
                          ^~~~~~~
/Users/and1/Desktop/xhprof/extension/xhprof.c:371:27: error: use of undeclared identifier 'h'
        res += ((uint8 *)&h)[i];
                          ^
/Users/and1/Desktop/xhprof/extension/xhprof.c:806:43: warning: format specifies type 'int' but the argument
      has type '__darwin_time_t' (aka 'long') [-Wformat]
    snprintf(key, sizeof(key), "%d.%06d", XHPROF_G(last_sample_time).tv_sec, XHPROF_G(last_sample_time...
                                ~~        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                %ld
./php_xhprof.h:309:21: note: expanded from macro 'XHPROF_G'
#define XHPROF_G(v) (xhprof_globals.v)
                    ^
/Users/and1/Desktop/xhprof/extension/xhprof.c:1443:101: error: too many arguments to function call, expected
      8, have 9
  ...0/* global */, 0/* ZEND_NUM_ARGS() >= 4 */, 0/*flags PREG_OFFSET_CAPTURE*/, 0/* start_offset */);
                                                                                 ^
/usr/local/Cellar/php/7.4.0/include/php/ext/pcre/php_pcre.h:45:1: note: 'php_pcre_match_impl' declared here
PHPAPI void  php_pcre_match_impl(pcre_cache_entry *pce, zend_string *subject_str, zval *return_value,
^
/usr/local/Cellar/php/7.4.0/include/php/main/php.h:71:18: note: expanded from macro 'PHPAPI'
#               define PHPAPI __attribute__ ((visibility("default")))
                              ^
/Users/and1/Desktop/xhprof/extension/xhprof.c:1600:13: warning: use of GNU old-style field designator
      extension [-Wgnu-designator]
            size: sizeof(zend_fcall_info),
            ^~~~~
            .size = 
/Users/and1/Desktop/xhprof/extension/xhprof.c:1604:13: warning: use of GNU old-style field designator
      extension [-Wgnu-designator]
            function_name: func,
            ^~~~~~~~~~~~~~
            .function_name = 
/Users/and1/Desktop/xhprof/extension/xhprof.c:1608:13: warning: use of GNU old-style field designator
      extension [-Wgnu-designator]
            retval: &retval,
            ^~~~~~~
            .retval = 
/Users/and1/Desktop/xhprof/extension/xhprof.c:1609:13: warning: use of GNU old-style field designator
      extension [-Wgnu-designator]
            params: &params,
            ^~~~~~~
            .params = 
/Users/and1/Desktop/xhprof/extension/xhprof.c:1610:13: warning: use of GNU old-style field designator
      extension [-Wgnu-designator]
            object: NULL,
            ^~~~~~~
            .object = 
/Users/and1/Desktop/xhprof/extension/xhprof.c:1611:13: warning: use of GNU old-style field designator
      extension [-Wgnu-designator]
            no_separation: 1,
            ^~~~~~~~~~~~~~
            .no_separation = 
/Users/and1/Desktop/xhprof/extension/xhprof.c:1612:13: warning: use of GNU old-style field designator
      extension [-Wgnu-designator]
            param_count: 1
            ^~~~~~~~~~~~
            .param_count = 
/Users/and1/Desktop/xhprof/extension/xhprof.c:1609:21: warning: incompatible pointer types initializing
      'zval *' (aka 'struct _zval_struct *') with an expression of type 'zval (*)[1]'
      [-Wincompatible-pointer-types]
            params: &params,
                    ^~~~~~~
9 warnings and 12 errors generated.
make: *** [xhprof.lo] Error 1

Any ideas how to fix?
Thank you!

@longxinH
Copy link
Owner
longxinH commented Dec 4, 2019

php7.4 modified a zend api, this problem will be fixed in the near future, but I have not upgraded macOS Catalina 10.15.1, only can be verified under linux

@nohnaimer
Copy link
Author

I can test on macOS Catalina 10.15.1

longxinH added a commit that referenced this issue Dec 5, 2019
#32 fix for PHP 7.4
@longxinH
Copy link
Owner
longxinH commented Dec 5, 2019

Please verify if macOS Catalina 10.15.1 works

@nohnaimer
Copy link
Author

Same or different error:

and1@and1pc:~/Desktop/xhprof/extension$ make
/bin/sh /Users/and1/Desktop/xhprof/extension/libtool --mode=compile cc  -I. -I/Users/and1/Deskt
8000
op/xhprof/extension -DPHP_ATOM_INC -I/Users/and1/Desktop/xhprof/extension/include -I/Users/and1/Desktop/xhprof/extension/main -I/Users/and1/Desktop/xhprof/extension -I/usr/local/Cellar/php/7.4.0/include/php -I/usr/local/Cellar/php/7.4.0/include/php/main -I/usr/local/Cellar/php/7.4.0/include/php/TSRM -I/usr/local/Cellar/php/7.4.0/include/php/Zend -I/usr/local/Cellar/php/7.4.0/include/php/ext -I/usr/local/Cellar/php/7.4.0/include/php/ext/date/lib  -DHAVE_CONFIG_H  -g -O2   -c /Users/and1/Desktop/xhprof/extension/xhprof.c -o xhprof.lo 
mkdir .libs
 cc -I. -I/Users/and1/Desktop/xhprof/extension -DPHP_ATOM_INC -I/Users/and1/Desktop/xhprof/extension/include -I/Users/and1/Desktop/xhprof/extension/main -I/Users/and1/Desktop/xhprof/extension -I/usr/local/Cellar/php/7.4.0/include/php -I/usr/local/Cellar/php/7.4.0/include/php/main -I/usr/local/Cellar/php/7.4.0/include/php/TSRM -I/usr/local/Cellar/php/7.4.0/include/php/Zend -I/usr/local/Cellar/php/7.4.0/include/php/ext -I/usr/local/Cellar/php/7.4.0/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /Users/and1/Desktop/xhprof/extension/xhprof.c  -fno-common -DPIC -o .libs/xhprof.o
/Users/and1/Desktop/xhprof/extension/xhprof.c:361:10: error: expected ';' after expression
    ulong h = 5381;
         ^
         ;
/Users/and1/Desktop/xhprof/extension/xhprof.c:361:5: error: use of undeclared identifier 'ulong'
    ulong h = 5381;
    ^
/Users/and1/Desktop/xhprof/extension/xhprof.c:361:11: error: use of undeclared identifier 'h'
    ulong h = 5381;
          ^
/Users/and1/Desktop/xhprof/extension/xhprof.c:366:9: error: use of undeclared identifier 'h'
        h += (h << 5);
        ^
/Users/and1/Desktop/xhprof/extension/xhprof.c:366:15: error: use of undeclared identifier 'h'
        h += (h << 5);
              ^
/Users/and1/Desktop/xhprof/extension/xhprof.c:367:9: error: use of undeclared identifier 'h'
        h ^= (ulong) *str++;
        ^
/Users/and1/Desktop/xhprof/extension/xhprof.c:367:15: error: use of undeclared identifier 'ulong'; did you
      mean 'long'?
        h ^= (ulong) *str++;
              ^~~~~
              long
/Users/and1/Desktop/xhprof/extension/xhprof.c:367:14: error: reference to overloaded function could not be
      resolved; did you mean to call it?
        h ^= (ulong) *str++;
             ^~~~~~~
/Users/and1/Desktop/xhprof/extension/xhprof.c:370:28: error: use of undeclared identifier 'ulong'; did you
      mean 'long'?
    for (i = 0; i < sizeof(ulong); i++) {
                           ^~~~~
                           long
/Users/and1/Desktop/xhprof/extension/xhprof.c:370:27: error: reference to overloaded function could not be
      resolved; did you mean to call it?
    for (i = 0; i < sizeof(ulong); i++) {
                          ^~~~~~~
/Users/and1/Desktop/xhprof/extension/xhprof.c:371:27: error: use of undeclared identifier 'h'
        res += ((uint8 *)&h)[i];
                          ^
/Users/and1/Desktop/xhprof/extension/xhprof.c:806:43: warning: format specifies type 'int' but the argument
      has type '__darwin_time_t' (aka 'long') [-Wformat]
    snprintf(key, sizeof(key), "%d.%06d", XHPROF_G(last_sample_time).tv_sec, XHPROF_G(last_sample_time...
                                ~~        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                %ld
./php_xhprof.h:309:21: note: expanded from macro 'XHPROF_G'
#define XHPROF_G(v) (xhprof_globals.v)
                    ^
/Users/and1/Desktop/xhprof/extension/xhprof.c:1605:13: warning: use of GNU old-style field designator
      extension [-Wgnu-designator]
            size: sizeof(zend_fcall_info),
            ^~~~~
            .size = 
/Users/and1/Desktop/xhprof/extension/xhprof.c:1609:13: warning: use of GNU old-style field designator
      extension [-Wgnu-designator]
            function_name: func,
            ^~~~~~~~~~~~~~
            .function_name = 
/Users/and1/Desktop/xhprof/extension/xhprof.c:1613:13: warning: use of GNU old-style field designator
      extension [-Wgnu-designator]
            retval: &retval,
            ^~~~~~~
            .retval = 
/Users/and1/Desktop/xhprof/extension/xhprof.c:1614:13: warning: use of GNU old-style field designator
      extension [-Wgnu-designator]
            params: &params,
            ^~~~~~~
            .params = 
/Users/and1/Desktop/xhprof/extension/xhprof.c:1615:13: warning: use of GNU old-style field designator
      extension [-Wgnu-designator]
            object: NULL,
            ^~~~~~~
            .object = 
/Users/and1/Desktop/xhprof/extension/xhprof.c:1616:13: warning: use of GNU old-style field designator
      extension [-Wgnu-designator]
            no_separation: 1,
            ^~~~~~~~~~~~~~
            .no_separation = 
/Users/and1/Desktop/xhprof/extension/xhprof.c:1617:13: warning: use of GNU old-style field designator
      extension [-Wgnu-designator]
            param_count: 1
            ^~~~~~~~~~~~
            .param_count = 
/Users/and1/Desktop/xhprof/extension/xhprof.c:1614:21: warning: incompatible pointer types initializing
      'zval *' (aka 'struct _zval_struct *') with an expression of type 'zval (*)[1]'
      [-Wincompatible-pointer-types]
            params: &params,
                    ^~~~~~~
9 warnings and 11 errors generated.
make: *** [xhprof.lo] Error 1

and1@and1pc:~/Desktop/xhprof$ git log
commit 6bfef691a046679ac69f2a8d9f4b9fdec61c9c5e (HEAD -> master, origin/master, origin/HEAD)
Author: longxinhui <longxinhui.e@gmail.com>
Date:   Thu Dec 5 10:29:15 2019 +0800

    back to dev
    
    #32 fix for PHP 7.4

commit 613a88e9178c4555ea7958ea047d17923ee0027c
Author: longxinhui <longxinhui.e@gmail.com>
Date:   Wed Dec 4 09:47:04 2019 +0800

    Update version number 2.1.1
    
    Update version number 2.1.1

commit da6dcb1b549f7c47ffb14a7e0cf920f801d9db6b (tag: v2.1.1)
Author: longxinhui <longxinhui.e@gmail.com>
Date:   Tue Dec 3 17:07:14 2019 +0800

    Fix macOS time benchmark
    
    #31 Fix macOS time benchmark

longxinH added a commit that referenced this issue Dec 5, 2019
#32 modify 7.4 removed typedefs
@longxinH
Copy link
Owner
longxinH commented Dec 5, 2019

fixed

@nohnaimer
Copy link
Author
nohnaimer commented Dec 5, 2019

Compile, install, works!
Снимок экрана 2019-12-05 в 10 16 28

and1@and1pc:~/Desktop/xhprof/extension$ php -v
PHP 7.4.0 (cli) (built: Nov 29 2019 16:18:44) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Xdebug v2.8.0, Copyright (c) 2002-2019, by Derick Rethans
    with Zend OPcache v7.4.0, Copyright (c), by Zend Technologies
and1@and1pc:~/Desktop/xhprof/extension$ php -m | grep xhprof
xhprof

Thank you!

@nohnaimer
Copy link
Author

Compile with 9 warnings:

and1@and1pc:~/Desktop/xhprof/extension$ make
/bin/sh /Users/and1/Desktop/xhprof/extension/libtool --mode=compile cc  -I. -I/Users/and1/Desktop/xhprof/extension -DPHP_ATOM_INC -I/Users/and1/Desktop/xhprof/extension/include -I/Users/and1/Desktop/xhprof/extension/main -I/Users/and1/Desktop/xhprof/extension -I/usr/local/Cellar/php/7.4.0/include/php -I/usr/local/Cellar/php/7.4.0/include/php/main -I/usr/local/Cellar/php/7.4.0/include/php/TSRM -I/usr/local/Cellar/php/7.4.0/include/php/Zend -I/usr/local/Cellar/php/7.4.0/include/php/ext -I/usr/local/Cellar/php/7.4.0/include/php/ext/date/lib  -DHAVE_CONFIG_H  -g -O2   -c /Users/and1/Desktop/xhprof/extension/xhprof.c -o xhprof.lo 
mkdir .libs
 cc -I. -I/Users/and1/Desktop/xhprof/extension -DPHP_ATOM_INC -I/Users/and1/Desktop/xhprof/extension/include -I/Users/and1/Desktop/xhprof/extension/main -I/Users/and1/Desktop/xhprof/extension -I/usr/local/Cellar/php/7.4.0/include/php -I/usr/local/Cellar/php/7.4.0/include/php/main -I/usr/local/Cellar/php/7.4.0/include/php/TSRM -I/usr/local/Cellar/php/7.4.0/include/php/Zend -I/usr/local/Cellar/php/7.4.0/include/php/ext -I/usr/local/Cellar/php/7.4.0/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /Users/and1/Desktop/xhprof/extension/xhprof.c  -fno-common -DPIC -o .libs/xhprof.o
/Users/and1/Desktop/xhprof/extension/xhprof.c:806:43: warning: format specifies type 'int' but the argument
      has type '__darwin_time_t' (aka 'long') [-Wformat]
    snprintf(key, sizeof(key), "%d.%06d", XHPROF_G(last_sample_time).tv_sec, XHPROF_G(last_sample_time...
                                ~~        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                %ld
./php_xhprof.h:309:21: note: expanded from macro 'XHPROF_G'
#define XHPROF_G(v) (xhprof_globals.v)
                    ^
/Users/and1/Desktop/xhprof/extension/xhprof.c:1605:13: warning: use of GNU old-style field designator
      extension [-Wgnu-designator]
            size: sizeof(zend_fcall_info),
            ^~~~~
            .size = 
/Users/and1/Desktop/xhprof/extension/xhprof.c:1609:13: warning: use of GNU old-style field designator
      extension [-Wgnu-designator]
            function_name: func,
            ^~~~~~~~~~~~~~
            .function_name = 
/Users/and1/Desktop/xhprof/extension/xhprof.c:1613:13: warning: use of GNU old-style field designator
      extension [-Wgnu-designator]
            retval: &retval,
            ^~~~~~~
            .retval = 
/Users/and1/Desktop/xhprof/extension/xhprof.c:1614:13: warning: use of GNU old-style field designator
      extension [-Wgnu-designator]
            params: &params,
            ^~~~~~~
            .params = 
/Users/and1/Desktop/xhprof/extension/xhprof.c:1615:13: warning: use of GNU old-style field designator
      extension [-Wgnu-designator]
            object: NULL,
            ^~~~~~~
            .object = 
/Users/and1/Desktop/xhprof/extension/xhprof.c:1616:13: warning: use of GNU old-style field designator
      extension [-Wgnu-designator]
            no_separation: 1,
            ^~~~~~~~~~~~~~
            .no_separation = 
/Users/and1/Desktop/xhprof/extension/xhprof.c:1617:13: warning: use of GNU old-style field designator
      extension [-Wgnu-designator]
            param_count: 1
            ^~~~~~~~~~~~
            .param_count = 
/Users/and1/Desktop/xhprof/extension/xhprof.c:1614:21: warning: incompatible pointer types initializing
      'zval *' (aka 'struct _zval_struct *') with an expression of type 'zval (*)[1]'
      [-Wincompatible-pointer-types]
            params: &params,
                    ^~~~~~~
9 warnings generated.
/bin/sh /Users/and1/Desktop/xhprof/extension/libtool --mode=link cc -DPHP_ATOM_INC -I/Users/and1/Desktop/xhprof/extension/include -I/Users/and1/Desktop/xhprof/extension/main -I/Users/and1/Desktop/xhprof/extension -I/usr/local/Cellar/php/7.4.0/include/php -I/usr/local/Cellar/php/7.4.0/include/php/main -I/usr/local/Cellar/php/7.4.0/include/php/TSRM -I/usr/local/Cellar/php/7.4.0/include/php/Zend -I/usr/local/Cellar/php/7.4.0/include/php/ext -I/usr/local/Cellar/php/7.4.0/include/php/ext/date/lib  -DHAVE_CONFIG_H  -g -O2    -o xhprof.la -export-dynamic -avoid-version -prefer-pic -module -rpath /Users/and1/Desktop/xhprof/extension/modules  xhprof.lo 
cc ${wl}-flat_namespace ${wl}-undefined ${wl}suppress -o .libs/xhprof.so -bundle  .libs/xhprof.o  
dsymutil .libs/xhprof.so || :
creating xhprof.la
(cd .libs && rm -f xhprof.la && ln -s ../xhprof.la xhprof.la)
/bin/sh /Users/and1/Desktop/xhprof/extension/libtool --mode=install cp ./xhprof.la /Users/and1/Desktop/xhprof/extension/modules
cp ./.libs/xhprof.so /Users/and1/Desktop/xhprof/extension/modules/xhprof.so
cp ./.libs/xhprof.lai /Users/and1/Desktop/xhprof/extension/modules/xhprof.la
----------------------------------------------------------------------
Libraries have been installed in:
   /Users/and1/Desktop/xhprof/extension/modules

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `DYLD_LIBRARY_PATH' environment variable
     during execution

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------

Build complete.
Don't forget to run 'make test'.

longxinH added a commit that referenced this issue Dec 6, 2019
@longxinH longxinH closed this as completed Dec 6, 2019
4674
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

No branches or pull requests

2 participants
0