Determine minimum OSX version a binary was compiled for

后端 未结 1 1880
忘掉有多难
忘掉有多难 2020-12-05 04:57

When using Clang\'s or GCC\'s Darwin backends to create executables for OSX, the flag -mmacosx-version-min=version can be used to set the earliest version of OS

相关标签:
1条回答
  • 2020-12-05 05:19

    Use otool -l /path/to/binary and inspect the LC_VERSION_MIN_MACOSX load command; specifically, the version field.

    For example, a binary compiled with the 10.8 SDK with deployment target (-mmacosx-version-min) 10.8 should have an LC_VERSION_MIN_MACOSX like this:

    Load command 9
          cmd LC_VERSION_MIN_MACOSX
      cmdsize 16
      version 10.8
          sdk 10.8
    

    whereas a binary compiled with the 10.8 SDK with deployment target 10.7 should have an LC_VERSION_MIN_MACOSX load command like this:

    Load command 9
          cmd LC_VERSION_MIN_MACOSX
      cmdsize 16
      version 10.7
          sdk 10.8
    
    0 讨论(0)
提交回复
热议问题