Is there a way to find out the compiler options that were used when the Linux library was compiled on Linux?

I need to know how the library was compiled, i.e. what compiler options were used? In particular, whether it was compiled with optimizations or not, and a few other options.

Is there a way to extract this information on linux platform, x86_64?


source to share

2 answers

I do not find it possible to automatically detect compiler options; at least not in a portable way.

Instead, you can modify the build scripts (like your Makefile) to automatically add the definition along with the optimization argument (-D flag).



If the library comes from the Linux distribution you are using, you can look at the source of the package, for example. for Debian based systems: apt-get source PACKAGENAME

to get build options.



All Articles