aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2025-03-07 08:49:26 +0100
committerEli Schwartz <eschwartz93@gmail.com>2025-03-24 19:19:53 -0400
commitcfb5a48e075ad0da9341b35b24872634784fccf8 (patch)
tree2ee92ddae21e51c9851b2281c47fa330fb7913a1
parent4c52a68517521b2f79780b58927030b02c7a53b4 (diff)
downloadmeson-cfb5a48e075ad0da9341b35b24872634784fccf8.zip
meson-cfb5a48e075ad0da9341b35b24872634784fccf8.tar.gz
meson-cfb5a48e075ad0da9341b35b24872634784fccf8.tar.bz2
linkers: darwin: do not use -bundle for shared_modules
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
-rw-r--r--docs/markdown/Builtin-options.md3
-rw-r--r--mesonbuild/linkers/linkers.py2
2 files changed, 2 insertions, 3 deletions
diff --git a/docs/markdown/Builtin-options.md b/docs/markdown/Builtin-options.md
index e1686f8..56e3088 100644
--- a/docs/markdown/Builtin-options.md
+++ b/docs/markdown/Builtin-options.md
@@ -272,8 +272,7 @@ with `b_asneeded`, so that option will be silently disabled.
[[shared_module]]s will not have
bitcode embedded because `-Wl,-bitcode_bundle` is incompatible with
-both `-bundle` and `-Wl,-undefined,dynamic_lookup` which are necessary
-for shared modules to work.
+`-Wl,-undefined,dynamic_lookup` which is necessary for shared modules to work.
## Compiler options
diff --git a/mesonbuild/linkers/linkers.py b/mesonbuild/linkers/linkers.py
index ba64211..45eb6e8 100644
--- a/mesonbuild/linkers/linkers.py
+++ b/mesonbuild/linkers/linkers.py
@@ -806,7 +806,7 @@ class AppleDynamicLinker(PosixDynamicLinkerMixin, DynamicLinker):
return self._apply_prefix('-undefined,dynamic_lookup')
def get_std_shared_module_args(self, target: 'BuildTarget') -> T.List[str]:
- return ['-bundle'] + self._apply_prefix('-undefined,dynamic_lookup')
+ return ['-dynamiclib'] + self._apply_prefix('-undefined,dynamic_lookup')
def get_pie_args(self) -> T.List[str]:
return []