Choosing the correct compiler version

kdevel kdevel at vogtner.de
Wed Jul 20 09:47:52 UTC 2022


On Tuesday, 19 July 2022 at 23:19:28 UTC, jfondren wrote:

Thanks for your thorough presentation.

> [...]
> Another option is to get newer glibc onto this system (not 
> installing it, just making it available for dmd. use 
> LD_LIBRARY_PATH).

On older systems the dynamic loader (ld.so) may not execute the 
binary under the new glibc with the error message "ELF file OS 
ABI invalid". This is due to the addition of two features to the 
toolchain (`STB_GNU_UNIQUE`, `STT_GNU_IFUNC`) eleven years ago 
[0] an application programmer usually does not have to deal with.

In this case one needs to start dmd using the loader which 
accompanies the new glibc. In order to avoid that I use patchelf 
to set `INTERP` and `RUNPATH` on all binaries in linux/bin64 
accordingly.

> [...]
> Speaking of toolchains, it might be possible to use a modern 
> server with a modern dmd with an ancient glibc: 
> https://www.lordaro.co.uk/posts/2018-08-26-compiling-glibc.html

Since glibc is not forward compatible [1] I wonder why the dmd 
tools are not routinely linked against a long established glibc 
version.

[0] 
<https://sourceware.org/legacy-ml/binutils/2011-04/msg00107.html>
[1] 
<https://stackoverflow.com/questions/11107263/how-compatible-are-different-versions-of-glibc>



More information about the Digitalmars-d-learn mailing list