Skip to content
New issue

Have a question about this project? Sign 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

make fail, ZEND_ACC_PRELOADED not found #21

Open
yanggs07 opened this issue Jan 8, 2019 · 3 comments
Open

make fail, ZEND_ACC_PRELOADED not found #21

yanggs07 opened this issue Jan 8, 2019 · 3 comments

Comments

@yanggs07
Copy link

yanggs07 commented Jan 8, 2019

ygs@proxy:~/php-ffi$ make
/bin/bash /home/ygs/php-ffi/libtool --mode=compile cc  -I. -I/home/ygs/php-ffi -DPHP_ATOM_INC -I/home/ygs/php-ffi/include -I/home/ygs/php-ffi/main -I/home/ygs/php-ffi -I/usr/include/php/20180731 -I/usr/include/php/20180731/main -I/usr/include/php/20180731/TSRM -I/usr/include/php/20180731/Zend -I/usr/include/php/20180731/ext -I/usr/include/php/20180731/ext/date/lib  -DHAVE_CONFIG_H  -g
-O2   -c /home/ygs/php-ffi/ffi.c -o ffi.lo
libtool: compile:  cc -I. -I/home/ygs/php-ffi -DPHP_ATOM_INC -I/home/ygs/php-ffi/include -I/home/ygs/php-ffi/main -I/home/ygs/php-ffi -I/usr/include/php/20180731 -I/usr/include/php/20180731/main -I/usr/include/php/20180731/TSRM -I/usr/include/php/20180731/Zend -I/usr/include/php/20180731/ext -I/usr/include/php/20180731/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /home/ygs/php-ffi/ffi.c  -fPIC -DPIC -o .libs/ffi.o
/home/ygs/php-ffi/ffi.c: In function ‘zend_ffi_validate_api_restriction’:
/home/ygs/php-ffi/ffi.c:2530:66: error: ‘ZEND_ACC_PRELOADED’ undeclared (first use in this function); did you mean ‘ZEND_FFI_PRELOAD’?
     && (execute_data->prev_execute_data->func->common.fn_flags & ZEND_ACC_PRELOADED))
                                                                  ^~~~~~~~~~~~~~~~~~
                                                                  ZEND_FFI_PRELOAD
/home/ygs/php-ffi/ffi.c:2530:66: note: each undeclared identifier is reported only once for each
function it appears in
/home/ygs/php-ffi/ffi.c:2531:31: error: ‘ZEND_COMPILE_PRELOAD’ undeclared (first use in this function); did you mean ‘ZEND_FFI_PRELOAD’?
    || (CG(compiler_options) & ZEND_COMPILE_PRELOAD)) {
                               ^~~~~~~~~~~~~~~~~~~~
                               ZEND_FFI_PRELOAD
/home/ygs/php-ffi/ffi.c: In function ‘zim_FFI_load’:
/home/ygs/php-ffi/ffi.c:2819:46: error: ‘ZEND_COMPILE_PRELOAD’ undeclared (first use in this function); did you mean ‘ZEND_FFI_PRELOAD’?
  zend_bool preload = (CG(compiler_options) & ZEND_COMPILE_PRELOAD) != 0;
                                              ^~~~~~~~~~~~~~~~~~~~
                                              ZEND_FFI_PRELOAD
In file included from /usr/include/php/20180731/Zend/zend.h:29:0,
                 from /usr/include/php/20180731/main/php.h:34,
                 from /home/ygs/php-ffi/ffi.c:23:
/home/ygs/php-ffi/ffi.c: In function ‘zim_FFI_free’:
/home/ygs/php-ffi/ffi.c:3411:76: warning: implicit declaration of function ‘is_zend_ptr’; did you mean ‘is_zend_mm’? [-Wimplicit-function-declaration]
    pefree(cdata->ptr_holder, (cdata->flags & ZEND_FFI_FLAG_PERSISTENT) || !is_zend_ptr(cdata->ptr_holder));
                                                                            ^
/usr/include/php/20180731/Zend/zend_alloc.h:195:36: note: in definition of macro ‘pefree’
 #define pefree(ptr, persistent)  ((persistent)?free(ptr):efree(ptr))
                                    ^~~~~~~~~~
Makefile:194: recipe for target 'ffi.lo' failed
make: *** [ffi.lo] Error 1

@yanggs07
Copy link
Author

yanggs07 commented Jan 8, 2019

Env:
ubuntu18.04+php7.3
with libffi-dev 3.2.1-8 amd64
with the patch
https://github.com/fpoirotte/php-ffi/commit/734630fe3d2e3efd343d3f3636b58446abd9c941.diff
to pass the configure

@fpoirotte
Copy link
Contributor

Commit 86b43c3 introduced the notion of API restrictions.
These restrictions are based on the new preload RFC that has recently been added to PHP's master branch (see https://wiki.php.net/rfc/preload & php/php-src@f6d227e).
Unfortunately, this means that PHP must have been compiled from a nightly snapshot / fresh clone;

Keep in mind that this extension is still pretty new: the API may still change (see recent commits related to FFI:cdef, FFI::typeof, FFI::arrayType and so on).

@dstogov
Copy link
Owner

dstogov commented Jan 9, 2019

@yanggs07 @fpoirotte this extension is going to be part of PHP 7.4 (7.3 is not supported, however it might be possible to make it compatible)

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

3 participants