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

8.4.1 安装 swoole 5.1.5 编译报错 #5591

Closed
wheakerd opened this issue Nov 26, 2024 · 6 comments
Closed

8.4.1 安装 swoole 5.1.5 编译报错 #5591

wheakerd opened this issue Nov 26, 2024 · 6 comments

Comments

@wheakerd
Copy link

Please answer these questions before submitting your issue.

  1. What did you do? If possible, provide a simple script for reproducing the error.
    ./configure --with-php-config=php-config
    make -j8
  2. What did you see instead?

/ext-src/swoole_coroutine.cc:1004:38: 错误:‘ZEND_EXIT’ was not declared in this scope; did you mean ‘ZEND_CAST’?
1004 | zend_set_user_opcode_handler(ZEND_EXIT, coro_exit_handler);
| ^~~~~~~~~
| ZEND_CAST

  1. What version of Swoole are you using (show your php --ri swoole)?
    none

  2. What is your machine environment used (show your uname -a & php -v & gcc -v) ?
    uname -a :
    Linux wheakerd 6.11.10-300.fc41.x86_64 编译出错 #1 SMP PREEMPT_DYNAMIC Sat Nov 23 00:51:20 UTC 2024 x86_64 GNU/Linux
    php -v :
    PHP 8.4.1 (cli) (built: Nov 25 2024 22:09:44) (NTS)
    Copyright (c) The PHP Group
    Zend Engine v4.4.1, Copyright (c) Zend Technologies
    gcc -v :
    使用内建 specs。
    COLLECT_GCC=gcc
    COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/14/lto-wrapper
    OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa
    OFFLOAD_TARGET_DEFAULT=1
    目标:x86_64-redhat-linux
    配置为:../configure --enable-bootstrap --enable-languages=c,c++,fortran,objc,obj-c++,ada,go,d,m2,lto --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --enable-libstdcxx-backtrace --with-libstdcxx-zoneinfo=/usr/share/zoneinfo --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl=/builddir/build/BUILD/gcc-14.2.1-build/gcc-14.2.1-20240912/obj-x86_64-redhat-linux/isl-install --enable-offload-targets=nvptx-none,amdgcn-amdhsa --enable-offload-defaulted --without-cuda-driver --enable-gnu-indirect-function --enable-cet --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux --with-build-config=bootstrap-lto --enable-link-serialization=1
    线程模型:posix
    支持的 LTO 压缩算法:zlib zstd
    gcc 版本 14.2.1 20240912 (Red Hat 14.2.1-3) (GCC)

@wheakerd
Copy link
Author

#5451
#5462
#5465
bug 未修复

@wheakerd
Copy link
Author

ext-src/swoole_redis_server.cc: In function ‘int php_swoole_redis_server_onReceive(swoole::Server*, swoole::RecvData*)’:
ext-src/swoole_redis_server.cc:159:5: 错误:‘php_strtolower’ was not declared in this scope; did you mean ‘php_strtok_r’?
159 | php_strtolower(_command, _command_len);
| ^~~~~~~~~~~~~~
| php_strtok_r
/ext-src/swoole_redis_server.cc: In function ‘void zim_swoole_redis_server_setHandler(zend_execute_data*, zval*)’:
/ext-src/swoole_redis_server.cc:217:5: 错误:‘php_strtolower’ was not declared in this scope; did you mean ‘php_strtok_r’?
217 | php_strtolower(_command, _command_len);
| ^~~~~~~~~~~~~~
| php_strtok_r
ext-src/swoole_redis_server.cc: In function ‘void zim_swoole_redis_server_getHandler(zend_execute_data*, zval*)’:
ext-src/swoole_redis_server.cc:243:5: 错误:‘php_strtolower’ was not declared in this scope; did you mean ‘php_strtok_r’?
243 | php_strtolower(_command, _command_len);
| ^~~~~~~~~~~~~~
| php_strtok_r

@wheakerd
Copy link
Author

The php_strtoupper(), php_string_toupper(), php_strtolower(), and
php_string_tolower() functions has been removed, use zend_str_toupper(),
zend_string_toupper(), zend_str_tolower(), and zend_string_tolower()
respectively instead.

@wheakerd
Copy link
Author

解决方案:
ext-src/swoole_coroutine.cc [994,995] 替换 ZEND_EXIT 为 ZEND_STR_EXIT
ext-src/swoole_redis_server.cc [*] php_strtolower 函数已被弃用,替换为zend_str_tolower

@jingjingxyk
Copy link
Contributor

你用swoole master 分支代码 编译即可,已经修复了哈

@matyhtf
Copy link
Member

matyhtf commented Nov 26, 2024

goto #5590

@matyhtf matyhtf closed this as completed Nov 26, 2024
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