Including an older glibc in stdenv

Do you have this in a public repo by any chance? It’s the evening my time but I’ll come back to this tomorrow.

Hi Harris,

The repo is here: GitHub - DruidNx/geonix-gdal-compile-test: Trying to compile gdal with non-standard libc

It was basically generated using the Geospatial Nix today configurator, with your suggested changes overlaid.

Thanks a lot!

I’ve just looked at my code. If I build a binary using a custom stdenv, I can check which glibc it uses via ldd --version ./result/bin/my_binary. So:

$ ldd --version result/bin/my_binary                                                                                                                                                                                  
ldd (GNU libc) 2.38
Copyright (C) 2023 Free Software Foundation, Inc.

(where glibc 2.38 was the one I specified).
However, this doesn’t mean that all of the dependencies of that binary use the same glibc:

ldd result/bin/my_binary | grep glibc                                                                                                                                                                               
	libdl.so.2 => /nix/store/d4452z0kdlib9g36j926n91936jhra9i-glibc-2.28/lib/libdl.so.2 (0x00007f943e82c000)
	libpthread.so.0 => /nix/store/d4452z0kdlib9g36j926n91936jhra9i-glibc-2.28/lib/libpthread.so.0 (0x00007f943e2ab000)
	librt.so.1 => /nix/store/d4452z0kdlib9g36j926n91936jhra9i-glibc-2.28/lib/librt.so.1 (0x00007f943e2a1000)

That outcome (that the binary plus all dependencies would be built using the specified stdenv) was the one that I initially wanted, but it is much harder to achieve - I spent about a week on it before giving up.

Hi Harry, thanks a lot for trying. I didn’t know the binary itself had a different glibc version. I will try to just hardcode the stdenv in the dependencies.