在 Centos 7 上从源代码构建 v8

Building v8 from source on Centos 7

如何在最新的 Centos 7 上从源代码构建 v8

我试过了,但是 ninja 构建总是立即失败并显示 "centos /lib64/libc.so.6: version `GLIBC_2.18' not found" 消息。

另外,依赖安装程序脚本告诉我们不支持 Centos 平台。

那么,有什么办法吗?

谢谢!

您可以尝试使用 docker 构建 V8。 参见 https://github.com/gengjiawen/v8-build

该错误是由于 C 编译器不兼容,请尝试编译更新的 GCC。在 CentOS 7 上:

sudo yum install bzip2
cd /usr/local/src
wget https://www.mirrorservice.org/sites/sourceware.org/pub/gcc/releases/gcc-8.3.0/gcc-8.3.0.tar.gz
tar zxf gcc-8.3.0.tar.gz
cd gcc-8.3.0/
./contrib/download_prerequisites
./configure --disable-multilib --enable-languages=c,c++
make
sudo make install
export LD_LIBRARY_PATH=/usr/local/lib:/usr/lib:/usr/local/lib64:/usr/lib64

echo "/usr/local/lib64" > /etc/ld.so.conf.d/gcc-8.3.0.x86_64.conf
ldconfig

(来自他们的wiki