As promised, I have included the legacy linking option into fpcupdeluxe 2.4.0bp.
The compiler patch :
https://github.com/LongDirtyAnimAlf/fpcupdeluxe/blob/master/patches/patchfpc/glibc_compat_3_2_2.patchThe version file:
https://github.com/LongDirtyAnimAlf/fpcupdeluxe/blob/master/patches/patchfpc/glibc.incFpcupdeluxe will do (on Linux):
Get the FPC 3.2.2 sources.
Patch them with the compiler patch. Add the version file.
Build all FPC. All FPC binaries will function as usual.
Rebuild the RTL and Packages with the legacy-switch enabled + -defined FPC_USE_LIBC and install them in a legacy units directory.
Get Lazarus trunk/main.
Patch Lazarus a little bit to work with libc under Linux.
Build the whole of Lazarus under legacy conditions.
If all ok, Lazarus will now produce legacy binaries.
In fact, Lazarus itself is legacy.
To summarize.
All glibc-call are versioned to the lowest version possible.
No syscall are used anymore. All done through libc.
A new compiler switch is added : -XLC.
The linker adds some libraries as needed to allow legacy Linux systems to resolve the libc functions used.
Special for Windows users.
The legacy linking will also work when cross-compiling.
Fpcupdeluxe 2.4.0bp will download libs from Fedora38. Legacy linking should allow you to get a binary that works also on very old systems.
https://github.com/LongDirtyAnimAlf/fpcupdeluxe/releases/tag/v2.4.0bpPlease test if interested. With FPC 3.2.2 and Lazarus trunk/main.
Thanks