DEV Community

x1957
x1957

Posted on

3

使用指定glibc

使用Rust在编译机器上copy过来之后,运行报错: "GLIBC_2.18" not found
glib 不对

通过 strings /lib64/libc.so.6 | grep GLIBC_ 命令查看发现这台机器上只有2.17,开始本来想升级glibc,但是这个东西确实太底层了,怕影响其他东西,所以决定编译到自定义目录然后指定加载就行。

编译流程很简单 http://ftp.gnu.org/gnu/glibc 下载一个需要的版本,我这儿就选了2.18。

解压后新建一个目录glibc-build(因为它不让在源代码目录build),和一个我们放编译好的glibc目录,然后在build目录里面 ../glibc-xxx/configure --prefix=../glibc/

configure好之后 make make install

我们编译好的glibc就在glibc这个目录啦,运行是这样

RUST_LOG=info ./glibc/lib/ld-linux-x86-64.so.2  --library-path ./glibc/lib:/lib64:/usr/lib64 ./order-server
Enter fullscreen mode Exit fullscreen mode

Top comments (0)

Speedy emails, satisfied customers

Postmark Image

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up