swoole/phpx

PHP 7.3: make -j 4 報錯

Closed this issue · 1 comments

System:

  • OS: Arch Linux, Linux Kernel 4.20.13
  • cmake: 3.13.4
  • gcc, g++: 8.2.1
  • phpize: PHP API Version 20180731, Zend Module Api No: 20180731, Zend Extension Api No: 320180731

Error Message:

Scanning dependencies of target phpx
[  9%] Building CXX object CMakeFiles/phpx.dir/src/exec.o
[ 18%] Building CXX object CMakeFiles/phpx.dir/src/class.o
[ 36%] Building CXX object CMakeFiles/phpx.dir/src/array.o
[ 36%] Building CXX object CMakeFiles/phpx.dir/src/base.o
/home/chivincent/tmp/phpx/src/class.cc: In member function 「bool php::Class::activate()」:
/home/chivincent/tmp/phpx/src/class.cc:226:75: 錯誤:too few arguments to function 「int zend_register_class_alias_ex(const char*, size_t, zend_class_entry*, int)」
if (zend_register_class_alias_ex(alias.c_str(), alias.length(), ce) < 0)
^
In file included from /usr/include/php/main/php.h:37,
from /home/chivincent/tmp/phpx/include/phpx.h:23,
from /home/chivincent/tmp/phpx/src/class.cc:19:
/usr/include/php/Zend/zend_API.h:289:14: 附註:declared here
ZEND_API int zend_register_class_alias_ex(const char *name, size_t name_len, zend_class_entry *ce, int persistent);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/chivincent/tmp/phpx/src/base.cc: In function 「int php::validate_constant_array(HashTable*)」:
/home/chivincent/tmp/phpx/src/base.cc:74:13: 錯誤:「struct _zend_array::<unnamed union>::<unnamed>」 has no member named 「nApplyCount」
ht->u.v.nApplyCount++;
^~~~~~~~~~~
/home/chivincent/tmp/phpx/src/base.cc:84:46: 錯誤:「struct _zend_array::<unnamed union>::<unnamed>」 has no member named 「nApplyCount」
if (Z_ARRVAL_P(val)->u.v.nApplyCount > 0)
^~~~~~~~~~~
/home/chivincent/tmp/phpx/src/base.cc:106:13: 錯誤:「struct _zend_array::<unnamed union>::<unnamed>」 has no member named 「nApplyCount」
ht->u.v.nApplyCount--;
^~~~~~~~~~~
/home/chivincent/tmp/phpx/src/base.cc: In function 「bool php::define(const char*, const php::Variant&, bool)」:
/home/chivincent/tmp/phpx/src/base.cc:211:26: 錯誤:「zend_constant」 {aka 「struct _zend_constant」} has no member named 「flags」
register_constant: c.flags = case_sensitive ? CONST_CS : 0; /* non persistent */
^~~~~
/home/chivincent/tmp/phpx/src/base.cc:213:7: 錯誤:「zend_constant」 {aka 「struct _zend_constant」} has no member named 「module_number」
c.module_number = PHP_USER_CONSTANT;
^~~~~~~~~~~~~
/home/chivincent/tmp/phpx/src/base.cc: In function 「ZEND_RESULT_CODE php::_check_args_num(zend_execute_data*, int)」:
/home/chivincent/tmp/phpx/src/base.cc:342:82: 錯誤:too many arguments to function 「void zend_wrong_parameters_count_error(int, int)」
zend_wrong_parameters_count_error(1, num_args, min_num_args, max_num_args);
^
In file included from /usr/include/php/main/php.h:37,
from /home/chivincent/tmp/phpx/include/phpx.h:23,
from /home/chivincent/tmp/phpx/src/base.cc:19:
/usr/include/php/Zend/zend_API.h:701:39: 附註:declared here
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameters_count_error(int min_num_args, int max_num_args);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
make[2]: *** [CMakeFiles/phpx.dir/build.make:89: CMakeFiles/phpx.dir/src/class.o] Error 1
make[2]: *** Waiting for unfinished jobs....
[ 45%] Building CXX object CMakeFiles/phpx.dir/src/extension.o
make[2]: *** [CMakeFiles/phpx.dir/build.make:76: CMakeFiles/phpx.dir/src/base.o] Error 1
/home/chivincent/tmp/phpx/src/extension.cc: In member function 「void php::Extension::registerIniEntries(int)」:
/home/chivincent/tmp/phpx/src/extension.cc:213:23: 警告:narrowing conversion of 「entry.php::Extension::IniEntry::modifiable」 from 「int」 to 「uint32_t」 {aka 「unsigned int」} inside { } [-Wnarrowing]
entry.modifiable, // modifiable
~~~~~~^~~~~~~~~~
/home/chivincent/tmp/phpx/src/extension.cc:214:17: 警告:narrowing conversion of 「(uint)entry.php::Extension::IniEntry::name.std::__cxx11::basic_string<char>::size()」 from 「uint」 {aka 「unsigned int」} to 「uint16_t」 {aka 「short unsigned int」} inside { } [-Wnarrowing]
(uint)entry.name.size(), // name_length
^~~~~~~~~~~~~~~~~~~~~~~
/home/chivincent/tmp/phpx/src/extension.cc:215:17: 警告:narrowing conversion of 「(uint)entry.php::Extension::IniEntry::default_value.std::__cxx11::basic_string<char>::size()」 from 「uint」 {aka 「unsigned int」} to 「uint8_t」 {aka 「unsigned char」} inside { } [-Wnarrowing]
(uint)entry.default_value.size(), // value_length
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
make[1]: *** [CMakeFiles/Makefile2:73: CMakeFiles/phpx.dir/all] Error 2
make: *** [Makefile:130: all] Error 2

Errors 可能發生原因:

  1. zend_register_class_alias_ex 函式簽名改變:另外新增 int presistent 參數
  1. (_zend_array)hashTable->u.v.nApplyCount 未定義:改為 zend_uchar _unused
  1. _zend_constant 未包含 flagsmodule_number:使用 ZEND_CONSTANT_FLAGSZEND_CONSTANT_MODULE_NUMBER macro 計算 flasg 與 module_number
  1. zend_worng_parameters_count_error 函式簽名改變:不需再傳入 should_free 參數
  1. php_addslashes 函式簽名改變

Warnings 可能發生原因:

  1. _zend_ini_entry_def 結構內容改變

已支持 php 73