SWIG 生成的代码无法在 PHP 5.3.2 上运行未定义的符号:zend_error_noreturn

发布于 2024-08-27 06:53:13 字数 637 浏览 5 评论 0原文

我有一个库,在 SWIG (v1.3.40)。

我刚刚升级到 PHP 5.3.2,看到以下错误:

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/myLib_php.so' - /usr/lib/php/modules/myLib_php.so: undefined symbol: zend_error_noreturn in Unknown on line 0 

经调查,SWIG (myLib_wrap.c) 生成的包装器代码似乎包含对 PHP 函数的调用:zend_error_noreturn 并且这个函数在 PHP 5.3.2 中不可用?

以前有人见过这个问题吗? 如果我手动更新生成的代码,而不是调用 zend_error_noreturn ,它只会调用 zend_error ,事情似乎就可以了。这种方法安全吗?

I have a library that I have been using successfully with PHP 5.1.6 with the help of some wrapper code generated by SWIG (v1.3.40).

I have just upgraded to PHP 5.3.2 and I am seeing the following error:

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/myLib_php.so' - /usr/lib/php/modules/myLib_php.so: undefined symbol: zend_error_noreturn in Unknown on line 0 

On investigation it appears that the wrapper code produced by SWIG (myLib_wrap.c) includes calls to the PHP function: zend_error_noreturn and that this function isn't available in PHP 5.3.2?

Has anyone seen this issue before?
Things seem to work if I manually update the generated code so that instead of calling zend_error_noreturn it just calls zend_error. Is this approach safe?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

孤单情人 2024-09-03 06:53:13

PHP 最近进行了一项更改,如果使用 GCC 版本 3 或更高版本构建,则仅将 zend_error_noreturn 符号定义为 zend_error 的符号别名,而之前如果使用GCC 2。

符号别名只是 PHP 中的一种优化尝试,没有任何好处,而且最近重新访问引擎这一部分的人确实应该放弃它。在其他构建情况下,它只是#define 为zend_error

zend_error 替换 zend_error_noreturn 调用是安全的。

PHP had a change recently that only defined the zend_error_noreturn symbol as a symbol alias for zend_error if building with GCC version 3 or greater, whereas previously it had also defined the symbol if using GCC 2.

The symbol alias is just an optimisation attempt in PHP that offers no benefit whatsoever, and it should really have been dropped by whoever had revisited that part of the engine recently. In other build cases it's just #defined as zend_error.

Replacing zend_error_noreturn calls by zend_error is safe.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文