One way to avoid this is to use a copy of the Pi 2W Zero's rootfs on your Ubuntu 22.04 PC, chroot into it and then compile. This has the advantage of doing it on a faster PC than the Pi itself though there is a perfomance penalty for the on-the-fly emulation for executing the aarch64 in the Pi rootfs binaries. You need to have qemu-user-static and binfmt installed on yoiur Ubuntu 22.04 for this to work.
Another way might be to not chroot but add the Pi rootfs copy's path to CFLAGS like '--sysroot=<path to Pi rootfs' so it will search for libraries, header files etc there and then cross-compile. But I have never tried it this way.
A third way is to upgrade your Ubuntu to a version that does have a newer (but not too new) GLIBC.
Another way might be to not chroot but add the Pi rootfs copy's path to CFLAGS like '--sysroot=<path to Pi rootfs' so it will search for libraries, header files etc there and then cross-compile. But I have never tried it this way.
A third way is to upgrade your Ubuntu to a version that does have a newer (but not too new) GLIBC.
Statistics: Posted by jj_0 — Mon Aug 04, 2025 8:02 pm