GLIBC_2.14 not found

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了GLIBC_2.14 not found相关的知识,希望对你有一定的参考价值。

参考技术A 从上面的日志可以分析出来,在执行android编译的时候,aapt执行失败了,因为aapt需要/lib64/libc.so.6文件

由上面的信息可以看出系统是CentOS 6.5,最高支持glibc的版本为2.12,而研发程序要2.14版本,所以需要升级。

将glibc-ports-2.14目录移动到 glibc-2.14/ports,并创建一个目录 glibc-build-2.14,并且接入该目录

直接编译会出错,会报一个错误 configure: error: no acceptable C compiler found in $PATH,查看提示发现是因为该Linux服务器上没有安装gcc编译器,缺少gcc编译环境,可以通过yum安装gcc编译环境:yum install gcc

错误提示

执行以下命令安装gcc

执行一会儿,gcc环境就安装好了。然后我们可以重新执行上面的编译命令

以上完成不报错的话,查看库文件,发现/lib64/libc.so.6软链接指向了2.14版本

可以看到glibc支持的版本已经到2.14,再次执行程序就不会报错了。

再一次重新运行Jenkins进行编译,发现是编译成功的。大功告成!

参考文档1
参考文档2

GLIBC_2.29 not found

GLIBC_2.29 not found

(Jin Qing’s Column, Nov. 4, 2021)

My Rust program failed when running in docker:

root@a26b49c91efb:/myapp# ldd libmyapp_py.so
./libmyapp_py.so: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.29' not found (required by ./libmyapp_py.so)

The problem is because I build in “rust:1.56”, and run in “debian:buster-slim” which is quite old. Run dpkg -l libc-bin shows the libc version is 2.28:

C:\\Users\\jinqing01>docker run debian:buster-slim dpkg -l libc-bin
Unable to find image 'debian:buster-slim' locally
buster-slim: Pulling from library/debian
b380bbd43752: Already exists
Digest: sha256:544c93597c784cf68dbe492ef35c00de7f4f6a990955c7144a40b20d86a3475f
Status: Downloaded newer image for debian:buster-slim
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version      Architecture Description
+++-==============-============-============-=================================
ii  libc-bin       2.28-10      amd64        GNU C Library: Binaries

Using the latest “debian:bookworm-slim” solved the problem.

Dockerfile:

FROM rust:1.56 as chef
RUN cargo install cargo-chef
WORKDIR /myapp

FROM chef AS planner
COPY . .
RUN cargo chef prepare --recipe-path recipe.json

FROM chef AS builder
COPY --from=planner /myapp/recipe.json recipe.json
# Build dependencies
RUN cargo chef cook --release --recipe-path recipe.json
# Build application
COPY . .
RUN cargo build --release

FROM debian:bookworm-slim AS runtime
WORKDIR /myapp
RUN apt-get update && apt-get install -y python3 python3-pip && rm -rf /var/lib/apt/lists/*
RUN pip3 install protobuf
COPY --from=builder /myapp/target/release/*.so /myapp/
COPY --from=builder /myapp/target/release/myapp /myapp/
COPY --from=builder /myapp/tests /myapp/tests

CMD ["myapp"]

以上是关于GLIBC_2.14 not found的主要内容,如果未能解决你的问题,请参考以下文章

使用腾讯互动直播 遇到的坑 'GLIBC_2.14' not found 问题解决

解决"libc.so.6: version `GLIBC_2.14' not found"问题

CentOS “/lib64/libc.so.6: version `GLIBC_2.14′ not found”系统glibc版本太低

/lib64/libc.so.6: version `GLIBC_2.14‘ not found

Centos6.X升级glibc解决“libc.so.6 version GLIBC_2.14 not found”报错问题

解决"libc.so.6: version `GLIBC_2.14' not found"问题