How to identify the xcode version and compiler version used to build an artifact like object file or binary built on mac?

旧巷老猫 提交于 2020-02-23 05:35:09

问题


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.

来源:https://stackoverflow.com/questions/59676912/how-to-identify-the-xcode-version-and-compiler-version-used-to-build-an-artifact

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!