[php-src] Issue #8521: Unable to load dynamic library 'ffi.so': undefined symbol: ffi_type_pointer

From: Date: Mon, 09 May 2022 20:41:17 +0000
Subject: [php-src] Issue #8521: Unable to load dynamic library 'ffi.so': undefined symbol: ffi_type_pointer
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-241445@lists.php.net to get a copy of this message
Issue: https://github.com/php/php-src/issues/8521 Author: phpmooc ### Description ## Environment * CentOS 6.5 * PHP 7.4.16 (cli) * libffi 3.4.2 * GCC 4.8.5 ## Step to reproduce: ```sh 1. cd /path/to/src/php-7.4.16/ext/ffi 2. ./configure --with-php-config=/usr/local/php74/bin/php-config FFI_CFLAGS=/usr/local/include/ FFI_LIBS=/usrlocal/lib64/ 3. make 4. make install 5. echo "extension=ffi.so" >> /usr/local/php74/lib/php.ini 6. /usr/local/php74/bin/php -v ``` ## Current behavior Warning: PHP Startup: Unable to load dynamic library 'ffi.so' (/usr/local/php74/lib/php/extensions/debug-non-zts-20190902/ffi.so: undefined symbol: ffi_type_pointer) ## Expected outcome ffi extension can work normally as expected ## More info Acturally, I also tried PHP 8.1.5, but still failed, Additionally I have did the same job for extension [php-ffi](https://github.com/dstogov/php-ffi/) which even cound **NOT** be compiled successfully, and throw error messages as below: ``` /user/local/php74/ext/php-ffi/ffi.c: In function ‘zif_ffi_trampoline’: /user/local/php74/ext/php-ffi/ffi.c:2380:3: warning: implicit declaration of function ‘ffi_prep_cif_var’ [-Wimplicit-function-declaration] if (ffi_prep_cif_var(&cif, type->func.abi, arg_count, EX_NUM_ARGS(), ret_type, arg_types) != FFI_OK) { ^ /user/local/php74/ext/php-ffi/ffi.c: In function ‘zend_ffi_make_func_type’: /user/local/php74/ext/php-ffi/ffi.c:5545:21: error: ‘FFI_FASTCALL’ undeclared (first use in this function) type->func.abi = FFI_FASTCALL; ^ /user/local/php74/ext/php-ffi/ffi.c:5545:21: note: each undeclared identifier is reported only once for each function it appears in /user/local/php74/ext/php-ffi/ffi.c:5548:21: error: ‘FFI_THISCALL’ undeclared (first use in this function) type->func.abi = FFI_THISCALL; ^ /user/local/php74/ext/php-ffi/ffi.c:5551:21: error: ‘FFI_STDCALL’ undeclared (first use in this function) type->func.abi = FFI_STDCALL; ^ make: *** [ffi.lo] Error 1 ``` ### PHP Version PHP 7.4.16 ### Operating System CentOS 6.5

« previous php.bugs (#241445) next »