corsix / polyfill-glibc

Patch Linux executables for compatibility with older glibc
Other
171 stars 4 forks source link

Missing _dl_find_object@GLIBC_2.35 (in C++ library with static libstdc++) #11

Open kkofler opened 5 days ago

kkofler commented 5 days ago

Apparently, libstdc++ now requires _dl_find_object, which was added in glibc 2.35. The .so I tried to run polyfill-glibc is statically linked with libstdc++ (because, as you know, libstdc++ is also only one-way-compatible). As a result, it has a dependency on _dl_find_object@GLIBC_2.35, so polyfill-glibc cannot make it work with --target-glibc=2.34 or less.

This: https://git.adelielinux.org/adelie/gcompat/-/issues/364 has links to a few implementations of the function.

kkofler commented 5 days ago

This is the actual glibc implementation: https://sourceware.org/git/?p=glibc.git;a=blob;f=elf/dl-find_object.c;h=449302eda35ce96fec45f6e871baf8ca8b74c12c;hb=HEAD

kkofler commented 4 days ago

Here is another one: https://github.com/Qwinci/hzlibc/blob/ac2c8153c185af066df7fa3c026e36a367c44e30/src/rtld/rtld.cpp#L250 (but as most of them, it relies on internal datastructures of that libc).