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

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

Open
hanwei88 opened this issue Apr 22, 2024 · 7 comments

Comments

@hanwei88
Copy link

hanwei88 commented Apr 22, 2024

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
Copy link
Member

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

@hanwei88
Copy link
Author

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

./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
Copy link
Member

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

@hanwei88
Copy link
Author

deepin 23 beta3 ,php版本是 php-8.3

deepin 23 beta3 ,php版本是 php-8.3

@hanwei88
Copy link
Author

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

@NathanFreeman
Copy link
Member

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

@hanwei88
Copy link
Author

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)

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

2 participants