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

linkers: darwin: do not use -bundle for shared_modules #14340

Merged
merged 1 commit into from
Mar 24, 2025

Conversation

bonzini
Copy link
Collaborator

@bonzini bonzini commented Mar 7, 2025

Both dynamic libraries and bundles these days can be dynamically loaded using the dl APIs (e.g. dlopen, dlclose). It is not possible to include bundles on a linker command line as if they were shared libraries, but that's pretty much the only difference.

However, bundles fail the Apple verification for iOS:

2025-02-10 13:54:09.095 ERROR: Validation failed (409) The binary is invalid.
The executable 'Runner.app/Frameworks/numpy._core._operand_flag_tests.framework/numpy._core._operand_flag_tests'
has type 'BUNDLE' that is not valid. Only 'EXECUTE' is permitted.
2025-02-10 13:54:09.096 ERROR: Validation failed (409) Missing load commands.
The executable at 'Runner.app/Frameworks/numpy._core._operand_flag_tests.framework'
does not have the necessary load commands. Try rebuilding the app with the latest
Xcode version. If you are using third party development tools, contact the provider.

So switch to -dynamiclib for shared modules as well.

Fixes: #14240

Both dynamic libraries and bundles these days can be dynamically loaded
using the dl APIs (e.g. dlopen, dlclose). It is not possible to include
bundles on a linker command line as if they were shared libraries,
but that's pretty much the only difference.

However, bundles fail the Apple verification for iOS:

2025-02-10 13:54:09.095 ERROR: Validation failed (409) The binary is invalid.
  The executable 'Runner.app/Frameworks/numpy._core._operand_flag_tests.framework/numpy._core._operand_flag_tests'
  has type 'BUNDLE' that is not valid. Only 'EXECUTE' is permitted.
2025-02-10 13:54:09.096 ERROR: Validation failed (409) Missing load commands.
  The executable at 'Runner.app/Frameworks/numpy._core._operand_flag_tests.framework'
  does not have the necessary load commands. Try rebuilding the app with the latest
  Xcode version. If you are using third party development tools, contact the provider.

So switch to -dynamiclib for shared modules as well.

Fixes: mesonbuild#14240
@bonzini bonzini added OS:macos Issues specific to Apple Operating Systems like MacOS and iOS dynamic linkers Dynamic linkers (ld, link, lld-link, etc) labels Mar 7, 2025
@bonzini bonzini marked this pull request as ready for review March 7, 2025 10:09
@bonzini bonzini requested a review from jpakkane as a code owner March 7, 2025 10:09
@bruchar1 bruchar1 added this to the 1.7.1 milestone Mar 7, 2025
@thesamesam thesamesam self-requested a review March 24, 2025 03:45
@eli-schwartz eli-schwartz merged commit cfb5a48 into mesonbuild:master Mar 24, 2025
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dynamic linkers Dynamic linkers (ld, link, lld-link, etc) OS:macos Issues specific to Apple Operating Systems like MacOS and iOS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Meson produces "bundle" library for iOS which does not pass App Store validation
4 participants