How can I see what version of the compiler created an object file?

This information can be found by opening the object file in a text editor. There you will see information about the version and build date, for example:

HighTec clang version 8.0.0 (77f9c0006e0a18055f91e89b26b536207035b609) based on LLVM 16.0.5 built on 2023-09-29

This information can be omitted by the compiler option -Qn. This option will omit metadata containing the compiler name and version.