If we write a hello world.cpp and build using g++ in linux, doing an objdump or a strings can expose the compiler used in linux.
Is there a way to know which compiler generated a static library?
I am not able to use the same in mac. For instance, the following artifact compiled using clang++,
#include <iostream.h>
int main() {
std::cout<<"Hello world";
return 0;
}
running objdump -s -j .comment a.out gives this:
a.out: file format Mach-O 64-bit x86-64
How to we identify the compiler version from a mac artifact? How does the same work on windows?
Running a strings -a does not show any reference to "clang-" string.
-g
(debugging information) option includes useful information like the compiler version; omitting it means there is no useful metadata. – Indefatigable