php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #81008 PHP ZTS 7.4.18 compilation failure when building --with-ffi
Submitted: 2021-05-03 14:54 UTC Modified: 2021-05-11 06:36 UTC
From: al dot volf dot av at gmail dot com Assigned:
Status: Not a bug Package: Compile Failure
PHP Version: 7.4.18 OS: Ubuntu 18.04 LTS
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: al dot volf dot av at gmail dot com
New email:
PHP Version: OS:

 

 [2021-05-03 14:54 UTC] al dot volf dot av at gmail dot com
Description:
------------
I'm trying to build custom php binary with libffi using that script:
https://github.com/Frago9876543210/php-build-scripts/blob/master/compile.sh

However, the build failed while compiling ext-ffi.

All build logs available here:
1) Appveyor CI
https://ci.appveyor.com/project/Frago9876543210/php-build-scripts
2) install.log artifact
https://ci.appveyor.com/api/buildjobs/kjnbmmoj875p7j24/artifacts/install.log

CI script completed successfully, but it doesn't contains php binary


/bin/bash /opt/php74/install_data/subdir/php/libtool --silent --preserve-dup-deps --mode=compile gcc -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -Iext/filter/ -I/opt/php74/install_data/subdir/php/ext/filter/ -DPHP_ATOM_INC -I/opt/php74/install_data/subdir/php/include -I/opt/php74/install_data/subdir/php/main -I/opt/php74/install_data/subdir/php -I/opt/php74/install_data/subdir/php/ext/date/lib -I/opt/php74/bin/php7/include/libxml2 -I/opt/php74/bin/php7/include -I/opt/php74/install_data/subdir/php/ext/chunkutils2 -I/opt/php74/install_data/subdir/php/ext/chunkutils2/gsl/include -I/opt/php74/bin/php7/include/libpng16 -I/opt/php74/install_data/subdir/php/ext/mbstring/libmbfl -I/opt/php74/install_data/subdir/php/ext/mbstring/libmbfl/mbfl -I/opt/php74/install_data/subdir/php/ext/morton -I/opt/php74/install_data/subdir/php/ext/morton/libmorton/libmorton/include -I/opt/php74/install_data/subdir/php/ext/pthreads -I/opt/php74/install_data/subdir/php/TSRM -I/opt/php74/install_data/subdir/php/Zend  -D_REENTRANT -pthread  -O2 -fPIC -march=x86-64 -mtune=nocona -fno-gcse -m64 -O2 -ffast-math -ftree-vectorize -fomit-frame-pointer -funswitch-loops -fivopts -funsafe-loop-optimizations -fpredictive-commoning -ftracer -ftree-loop-im -frename-registers -fcx-limited-range -fvisibility=hidden -pthread -Wall -Wno-strict-aliasing -DZTS -DZEND_SIGNALS   -c /opt/php74/install_data/subdir/php/ext/filter/filter.c -o ext/filter/filter.lo 
/opt/php74/install_data/subdir/php/ext/ffi/ffi.c: In function ‘zend_ffi_make_func_type’:
/opt/php74/install_data/subdir/php/ext/ffi/ffi.c:6105:21: error: ‘FFI_FASTCALL’ undeclared (first use in this function); did you mean ‘FFI_LAST_ABI’?
    type->func.abi = FFI_FASTCALL;
                     ^~~~~~~~~~~~
                     FFI_LAST_ABI
/opt/php74/install_data/subdir/php/ext/ffi/ffi.c:6105:21: note: each undeclared identifier is reported only once for each function it appears in
/opt/php74/install_data/subdir/php/ext/ffi/ffi.c:6110:21: error: ‘FFI_THISCALL’ undeclared (first use in this function); did you mean ‘FFI_FASTCALL’?
    type->func.abi = FFI_THISCALL;
                     ^~~~~~~~~~~~
                     FFI_FASTCALL
/opt/php74/install_data/subdir/php/ext/ffi/ffi.c:6115:21: error: ‘FFI_STDCALL’ undeclared (first use in this function); did you mean ‘FFI_FASTCALL’?
    type->func.abi = FFI_STDCALL;
                     ^~~~~~~~~~~
                     FFI_FASTCALL
/opt/php74/install_data/subdir/php/ext/ffi/ffi.c:6120:21: error: ‘FFI_PASCAL’ undeclared (first use in this function); did you mean ‘FFI_FASTCALL’?
    type->func.abi = FFI_PASCAL;
                     ^~~~~~~~~~
                     FFI_FASTCALL
/opt/php74/install_data/subdir/php/ext/ffi/ffi.c:6125:21: error: ‘FFI_REGISTER’ undeclared (first use in this function); did you mean ‘HAVE_FFI_REGISTER’?
    type->func.abi = FFI_REGISTER;
                     ^~~~~~~~~~~~
                     HAVE_FFI_REGISTER
/opt/php74/install_data/subdir/php/ext/ffi/ffi.c:6135:21: error: ‘FFI_SYSV’ undeclared (first use in this function); did you mean ‘FFI_OK’?
    type->func.abi = FFI_SYSV;
                     ^~~~~~~~
                     FFI_OK

Expected result:
----------------
It's expected to be able to build PHP 7.4 ZTS with ffi ext.

Actual result:
--------------
Compilation error

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2021-05-03 16:32 UTC] cmb@php.net
Are you trying to cross-compile?
 [2021-05-03 17:15 UTC] al dot volf dot av at gmail dot com
@cmb No, I'm trying to build regular dynamically linked binary for x86_64
 [2021-05-11 06:36 UTC] krakjoe@php.net
-Status: Open +Status: Not a bug
 [2021-05-11 06:36 UTC] krakjoe@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

That build script is wrong, it configures libffi in a non-standard location and does not paass that location to --with-ffi.

The build is linking against a system libffi which is too old (missing symbols).

This has been reported before and is not a bug in ffi, it's a bug in your build.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 15:01:28 2024 UTC