swoole / swoole-src

🚀 Coroutine-based concurrency library for PHP
https://www.swoole.com
Apache License 2.0
18.4k stars 3.16k forks source link

macOS arm64 build failed with php 8.3.x #5424

Closed crazywhalecc closed 1 month ago

crazywhalecc commented 1 month ago

Please answer these questions before submitting your issue.

  1. What did you do? If possible, provide a simple script for reproducing the error.

在 macOS 上编译 Swoole 并启用 --enable-swoole-sqlite 时,出现了 error。

  1. What did you expect to see?

编译成功。

  1. What did you see instead?
/tmp/h/swoole-5.1.3/thirdparty/php83/pdo_sqlite/sqlite_driver.c:354:5: error: type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int]
    HOOK_PHP_CALL_STACK(ret = zend_call_function(&fc->fci, &fc->fcc););
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    int
/tmp/h/swoole-5.1.3/ext-src/php_swoole_call_stack.h:21:10: note: expanded from macro 'HOOK_PHP_CALL_STACK'
    auto __stack_limit = EG(stack_limit);                                                                              \
    ~~~~ ^
/tmp/h/swoole-5.1.3/thirdparty/php83/pdo_sqlite/sqlite_driver.c:354:5: error: incompatible pointer to integer conversion initializing 'int' with an expression of type 'void *' [-Wint-conversion]
    HOOK_PHP_CALL_STACK(ret = zend_call_function(&fc->fci, &fc->fcc););
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/h/swoole-5.1.3/ext-src/php_swoole_call_stack.h:21:10: note: expanded from macro 'HOOK_PHP_CALL_STACK'
    auto __stack_limit = EG(stack_limit);                                                                              \
         ^               ~~~~~~~~~~~~~~~
/tmp/h/swoole-5.1.3/thirdparty/php83/pdo_sqlite/sqlite_driver.c:354:5: error: type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int]
    HOOK_PHP_CALL_STACK(ret = zend_call_function(&fc->fci, &fc->fcc););
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/h/swoole-5.1.3/ext-src/php_swoole_call_stack.h:22:10: note: expanded from macro 'HOOK_PHP_CALL_STACK'
    auto __stack_base = EG(stack_base);                                                                                \
    ~~~~ ^
/tmp/h/swoole-5.1.3/thirdparty/php83/pdo_sqlite/sqlite_driver.c:354:5: error: incompatible pointer to integer conversion initializing 'int' with an expression of type 'void *' [-Wint-conversion]
    HOOK_PHP_CALL_STACK(ret = zend_call_function(&fc->fci, &fc->fcc););
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/h/swoole-5.1.3/ext-src/php_swoole_call_stack.h:22:10: note: expanded from macro 'HOOK_PHP_CALL_STACK'
    auto __stack_base = EG(stack_base);                                                                                \
         ^              ~~~~~~~~~~~~~~
/tmp/h/swoole-5.1.3/thirdparty/php83/pdo_sqlite/sqlite_driver.c:354:5: error: incompatible integer to pointer conversion assigning to 'void *' from 'int' [-Wint-conversion]
    HOOK_PHP_CALL_STACK(ret = zend_call_function(&fc->fci, &fc->fcc););
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/h/swoole-5.1.3/ext-src/php_swoole_call_stack.h:25:30: note: expanded from macro 'HOOK_PHP_CALL_STACK'
    callback EG(stack_limit) = __stack_limit;                                                                          \
                             ^ ~~~~~~~~~~~~~
/tmp/h/swoole-5.1.3/thirdparty/php83/pdo_sqlite/sqlite_driver.c:354:5: error: incompatible integer to pointer conversion assigning to 'void *' from 'int' [-Wint-conversion]
    HOOK_PHP_CALL_STACK(ret = zend_call_function(&fc->fci, &fc->fcc););
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/h/swoole-5.1.3/ext-src/php_swoole_call_stack.h:26:20: note: expanded from macro 'HOOK_PHP_CALL_STACK'
    EG(stack_base) = __stack_base;
                   ^ ~~~~~~~~~~~~
/tmp/h/swoole-5.1.3/thirdparty/php83/pdo_sqlite/sqlite_driver.c:459:5: error: type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int]
    HOOK_PHP_CALL_STACK(ret = zend_call_function(&collation->fc.fci, &collation->fc.fcc););
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    int
/tmp/h/swoole-5.1.3/ext-src/php_swoole_call_stack.h:21:10: note: expanded from macro 'HOOK_PHP_CALL_STACK'
    auto __stack_limit = EG(stack_limit);                                                                              \
    ~~~~ ^
/tmp/h/swoole-5.1.3/thirdparty/php83/pdo_sqlite/sqlite_driver.c:459:5: error: incompatible pointer to integer conversion initializing 'int' with an expression of type 'void *' [-Wint-conversion]
    HOOK_PHP_CALL_STACK(ret = zend_call_function(&collation->fc.fci, &collation->fc.fcc););
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/h/swoole-5.1.3/ext-src/php_swoole_call_stack.h:21:10: note: expanded from macro 'HOOK_PHP_CALL_STACK'
    auto __stack_limit = EG(stack_limit);                                                                              \
         ^               ~~~~~~~~~~~~~~~
/tmp/h/swoole-5.1.3/thirdparty/php83/pdo_sqlite/sqlite_driver.c:459:5: error: type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int]
    HOOK_PHP_CALL_STACK(ret = zend_call_function(&collation->fc.fci, &collation->fc.fcc););
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/h/swoole-5.1.3/ext-src/php_swoole_call_stack.h:22:10: note: expanded from macro 'HOOK_PHP_CALL_STACK'
    auto __stack_base = EG(stack_base);                                                                                \
    ~~~~ ^
/tmp/h/swoole-5.1.3/thirdparty/php83/pdo_sqlite/sqlite_driver.c:459:5: error: incompatible pointer to integer conversion initializing 'int' with an expression of type 'void *' [-Wint-conversion]
    HOOK_PHP_CALL_STACK(ret = zend_call_function(&collation->fc.fci, &collation->fc.fcc););
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/h/swoole-5.1.3/ext-src/php_swoole_call_stack.h:22:10: note: expanded from macro 'HOOK_PHP_CALL_STACK'
    auto __stack_base = EG(stack_base);                                                                                \
         ^              ~~~~~~~~~~~~~~
/tmp/h/swoole-5.1.3/thirdparty/php83/pdo_sqlite/sqlite_driver.c:459:5: error: incompatible integer to pointer conversion assigning to 'void *' from 'int' [-Wint-conversion]
    HOOK_PHP_CALL_STACK(ret = zend_call_function(&collation->fc.fci, &collation->fc.fcc););
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/h/swoole-5.1.3/ext-src/php_swoole_call_stack.h:25:30: note: expanded from macro 'HOOK_PHP_CALL_STACK'
    callback EG(stack_limit) = __stack_limit;                                                                          \
                             ^ ~~~~~~~~~~~~~
/tmp/h/swoole-5.1.3/thirdparty/php83/pdo_sqlite/sqlite_driver.c:459:5: error: incompatible integer to pointer conversion assigning to 'void *' from 'int' [-Wint-conversion]
    HOOK_PHP_CALL_STACK(ret = zend_call_function(&collation->fc.fci, &collation->fc.fcc););
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/h/swoole-5.1.3/ext-src/php_swoole_call_stack.h:26:20: note: expanded from macro 'HOOK_PHP_CALL_STACK'
    EG(stack_base) = __stack_base;
                   ^ ~~~~~~~~~~~~
12 errors generated.
make: *** [thirdparty/php83/pdo_sqlite/sqlite_driver.lo] Error 1
make: *** Waiting for unfinished jobs....
  1. What version of Swoole are you using (show your php --ri swoole)?
  1. What is your machine environment used (show your uname -a & php -v & gcc -v) ?
# php -v
PHP 8.3.9 (cli) (built: Jul  2 2024 14:10:14) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.3.9, Copyright (c) Zend Technologies
    with Xdebug v3.3.1, Copyright (c) 2002-2023, by Derick Rethans
    with Zend OPcache v8.3.9, Copyright (c), by Zend Technologies
# clang --version
Apple clang version 15.0.0 (clang-1500.3.9.4)
Target: arm64-apple-darwin23.5.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
# uname -a
Darwin jerry-mba.local 23.5.0 Darwin Kernel Version 23.5.0: Wed May  1 20:19:05 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T8112 arm64
NathanFreeman commented 1 month ago

高版本的gcc或者clang在这里会报错,等swoole5.1.4吧 https://github.com/swoole/swoole-src/pull/5363