I have a few cross-compilers on my linux desktop. Some use glibc and some use uclibc (and in future there could be other libc
s too).
Currently, I can go into their sysroot directories and search for libc.so
and try to find which file name it points to (for eg. libc.so
-> libuClibc-1.0.12.so
) and I fetch their names. But this won't last long if naming changes or if cross-compiler itself changes.
Is there a better/reliable programmatic way of detecting the name and version of the libc
being used by a target cross compiler? Or are there any introspection tools available to get details about the target ceros
Note: There are a few similar questions here which normally point to #include <features.h>
file or similar. That works fine if the generated code can also run on the host. But not suitable for cross-compile environments.
So has anyone been able to detect much more reliably?
EDIT: On the off chance someone comes here looking for detecting musl libc specifically, I've answered another question on SO that is related to this question.