"xcodebuild install" produces invalid binaries when IPHONEOS_DEPLOYMENT_TARGET is set and not building for iOS

Originator:MichalKaluzny
Number:rdar://35665815 Date Originated:22-Nov-2017 11:27 AM
Status:Open Resolved:
Product:Developer Tools Product Version:9.2 Beta 2
Classification:Other Bug Reproducible:Always
 
Summary:
When archiving a project with IPHONEOS_DEPLOYMENT_TARGET variable set, the resulting binary will always have LC_VERSION_MIN_IPHONEOS load cmd no matter of what SDKROOT is set to. 

Steps to Reproduce:
Run ./build.sh script from the attached project. It will build the project two times, once for iOS (using -sdk iphoneos) and once for watchOS (using -sdk watchos). Then using otool it will print out any of the occurences of “LC_VERSION_MIN_” in the resulting binaries.

Expected Results:
iOS library deployment target:
      cmd LC_VERSION_MIN_IPHONEOS
      cmd LC_VERSION_MIN_IPHONEOS
watchOS library deployment target:
      cmd LC_VERSION_MIN_WATCHOS

Actual Results:
iOS library deployment target:
      cmd LC_VERSION_MIN_IPHONEOS
      cmd LC_VERSION_MIN_IPHONEOS
watchOS library deployment target:
      cmd LC_VERSION_MIN_IPHONEOS

Version:
9.2 Beta 2

Notes:
This only seems to affect the “install” action, when building (even with the same configuration) the resulting binary has proper load commands.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!