swoole / swoole-src

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

swoole 5.1.2编译安装提示error: ‘gettid’ was not declared in this scope; did you mean ‘getuid’ #5299

Open hanwei88 opened 3 weeks ago

hanwei88 commented 3 weeks ago

Please answer these questions before submitting your issue.

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

thirdparty/php83/Zend/zend_call_stack.cc:106:28: error: ‘gettid’ was not declared in this scope; did you mean ‘getuid’? 106 | return getpid() == gettid(); | ^~ | getuid make: *** [Makefile:573:thirdparty/php83/Zend/zend_call_stack.lo] 错误 1

NathanFreeman commented 3 weeks ago

麻烦提供一下编译的环境参数

hanwei88 commented 3 weeks ago

麻烦提供一些编译的环境参数

./configure --with-php-config=/media/hanwei/68477DFF36C47279/php/83/bin/php-config --enable-openssl --enable-swoole-curl --enable-cares --enable-brotli --enable-swoole-pgsql --enable-swoole-sqlite --enable-mysqlnd --enable-sockets && make -j8 && make -j8 install

NathanFreeman commented 3 weeks ago

服务器是什么类型的服务器,php的版本是多少

hanwei88 commented 3 weeks ago

deepin 23 beta3 ,php版本是 php-8.3

deepin 23 beta3 ,php版本是 php-8.3

hanwei88 commented 3 weeks ago

服务器是什么类型的服务器,php的版本是多少 这与系统没啥关系吧,swoole 5.1.1版本可以编译的

NathanFreeman commented 3 weeks ago

deepin的系统我得下载一个看看,可能真的没gettid这个函数

hanwei88 commented 3 weeks ago

deepin我得下载一个看看,可能真的没有gettid这个函数

我在/media/hanwei/68477DFF36C47279/软件包/编程/php/swoole-src-5.1.2/thirdparty/php83/Zend/zend_call_stack.cc头部加上这个就可以编译通过了: image image

include <sys/syscall.h>

define gettid() syscall(__NR_gettid)