LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   How do I build on Debian 12, but also use the binaries on distros that use older GLIBC symbols? (https://www.linuxquestions.org/questions/debian-26/how-do-i-build-on-debian-12-but-also-use-the-binaries-on-distros-that-use-older-glibc-symbols-4175733211/)

sarwaswa 01-26-2024 09:58 AM

How do I build on Debian 12, but also use the binaries on distros that use older GLIBC symbols?
 
Hello.

Our team is trying to port our build environment to Debian 12 from Debian 11.

While building on Debian 12, I find that many shared object files generated contain newer GLIBC symbols.
For our products to run on older Linux distros that we support, we can’t have GLIBC symbols newer than 2.28 present. In order to achieve this, we have rebuilt GCC-12.3 sources and pinned back multiple functions to their corresponding older GLIBC symbol versions. But for certain symbols this approach hasn’t worked, and we are looking for some guidance on how we can achieve the same.

These newer symbols are not available on distros that uses older GLIBC more specifically, the __libc_single_threaded and several new symbols from <sys/stat.h> @GLIBC_2.33 and @GLIBC_2.34 are entirely new on Debian 12 and do not have a preceding version. The executables generated in turn, have another newer symbol ​__libc_start​_main @GLIBC_2.34.

We wish to use the same shared libraries and executables built on Debian 12 on distros that use older GLIBC machines as well. However, we face errors stating that these newer GLIBC symbols aren't found on my system. Consequently, we cannot run these binaries on those machines.

Certain restrictions our team have are, firstly, we cannot build these binaries on the older distros. Furthermore, we cannot necessarily use a container environment either inside those machines either. We're specifically looking for ways in which we can actually make the shared libraries and executables backwards compatible, so that despite being built on a newer Debian version, they can run them on the older versions as well without encountering these GLIBC issues.

We did have a look at several resources on the internet and it seems like certain symbols have been introduced primarily to counter this very objective. But are there ways to be able to bypass this?

pan64 01-31-2024 01:22 AM

I don't really understand, usually libc is backward compatible, but there can be cases or exceptions.
Anyway, you can download the source of those old libs and build them on your host and use them if you wish.


All times are GMT -5. The time now is 09:41 PM.