无法在 CentOS 7 上使用 glibc-2.17 运行 uWebSockets

Can't run uWebSockets on CentOS 7 with glibc-2.17

Error: /lib64/libc.so.6: version `GLIBC_2.18' not found (required by /root/workspace/backend/node_modules/uWebSockets.js/uws_linux_x64_72.node)

CentOS 7 的最新 glibc 版本是 2.17。 我知道 CentOS 8 的最新版本是 2.30,但我无法升级,因为我的 VDS 取决于主机的机器内核(非常旧)。

有什么方法可以 run/compile 使用 glibc-2.17 或更新 glibc 吗?

编辑: 我的内核版本是 2.6.32-042stab141.3.

我可以构建它并安装到 /opt/glibc-2.18 而不会出错,但是当我尝试使用它时我看到 Segmentation fault 错误。

P.S. I builded it successfully on Fedora 23 with same OpenVZ kernel.

Is there any way to run/compile it with glibc-2.17

是的:就去做吧(下载源码,在你的目标机器上构建,获利)。

or update glibc?

你没有说你的 "very old kernel" 是什么,但是如果 GLIBC-2.18 支持它,那么是的,你可以更新 GLIBC。

但是,您在此过程中犯的任何错误都可能导致您的系统无法启动。参见 this answer

我已经构建了一个自定义二进制文件(和教程)来解决您的确切问题。

在这里阅读:https://github.com/dominicklee/uWebSockets.js-for-Centos7