Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please set a value for LC_VERSION_MIN_MACOSX so that the compiled Mac binaries have it in their Mach-O headers #21

Closed
chriskilding opened this issue Sep 5, 2016 · 1 comment

Comments

@chriskilding
Copy link

chriskilding commented Sep 5, 2016

Hello there

Please could you set a value for LC_VERSION_MIN_MACOSX, such that this load command is embedded into the Mach-O headers of the compiled .o files.

This is to ensure that they pass the stricter code validation in Xcode 7 for certain distribution targets e.g. Mac App Store - currently the Xcode build breaks for my app under these conditions.

You might be able to do this by passing the mmacosx-version-min=[some value] argument to clang, possibly by adding it in extconf.rb.

Note that this translates into 2 values, and they can either be different (you'd have to look up how to set that) or the same:

  • Base SDK - this must be as close to the current OS X release SDK as possible, as Apple vigorously deprecates support for old ones.
  • Deployment target - this is the more interesting value of the two. It can be set to the earliest OS X release that your code will run on. But you might want to draw the line at an OS X release which has not yet been EOL'd by Apple.

Steps to reproduce:

  1. Include compiled unf_ext .o files in an Xcode project in some way, e.g. indirectly in the resources folder, or directly by linking against them.
  2. Build and then validate the archive for certain distribution targets e.g. Mac App Store.
  3. Note that the compiled .o files appear in the 'binaries and entitlements' list in the Validate dialog - this is because Xcode is analysing them as if they were part of your project's actual code.
  4. The validation step of the build then breaks. The error is that it cannot find an LC_VERSION_MIN_MACOSX load command in the Mach-O headers of the .o files.
@chriskilding chriskilding changed the title Please set a value for LC_VERSION_MIN_MACOSX so that the compiled binaries have it in their Mach-O headers Please set a value for LC_VERSION_MIN_MACOSX so that the compiled Mac binaries have it in their Mach-O headers Sep 5, 2016
@chriskilding
Copy link
Author

Actually scratch the above - when the gem is compiled on a newer OS X / SDK, it does get the correct LC_VERSION_MIN flags by default. I thought it might have been necessary to set them with mmacosx-version-min but this is not the case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant