raspberry pi /lib/arm-linux-gnueabihf/libc.so.6 的 gcc 交叉编译:找不到版本“GLIBC_2.34”

gcc cross compiling for raspberry pi /lib/arm-linux-gnueabihf/libc.so.6: version `GLIBC_2.34' not found

在 Ubuntu 22.04 LTS 上,我正在为 raspberry pi 进行交叉编译。当我 运行 在 pi 上构建任何可执行文件时,我收到此链接错误:

/lib/arm-linux-gnueabihf/libc.so.6: version `GLIBC_2.34' not found

我在使用 gcc-9、gcc-10、gcc-11 和 gcc-12 进行交叉编译时遇到此错误。

圆周率是运行宁'Raspbian GNU/Linux 11 (bullseye)'。解决此问题的最佳方法是什么? Raspbian 的不同版本是否可以解决此问题,或者我是否需要安装更新版本的 glibc?

我已通过为 raspberry pi 靶心 here.

找到正确的 pre-built cross-compiler 解决了这个问题