Skip to content

Commit 7a43b6e

Browse files
bonzinifreakboy3742
authored andcommitted
linkers: apple: fix shared module args
iOS should not use -undefined,dynamic_lookup; whereas macOS should revert from -dynamiclib to -bundle, as was the case before commit cfb5a48 ("linkers: darwin: do not use -bundle for shared_modules", 2025-03-24), because Postgres wants to use -bundle_loader and that is only possible together with -bundle. Co-authored-by: Russell Keith-Magee <russell@keith-magee.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
1 parent cece1a7 commit 7a43b6e

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

mesonbuild/linkers/linkers.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -811,10 +811,17 @@ def get_asneeded_args(self) -> T.List[str]:
811811
return self._apply_prefix('-dead_strip_dylibs')
812812

813813
def get_allow_undefined_args(self) -> T.List[str]:
814-
return self._apply_prefix('-undefined,dynamic_lookup')
814+
# iOS doesn't allow undefined symbols when linking
815+
if self.system == 'ios':
816+
return []
817+
else:
818+
return self._apply_prefix('-undefined,dynamic_lookup')
815819

816820
def get_std_shared_module_args(self, target: 'BuildTarget') -> T.List[str]:
817-
return ['-dynamiclib'] + self._apply_prefix('-undefined,dynamic_lookup')
821+
if self.system == 'ios':
822+
return ['-dynamiclib']
823+
else:
824+
return ['-bundle'] + self.get_allow_undefined_args()
818825

819826
def get_pie_args(self) -> T.List[str]:
820827
return []

0 commit comments

Comments
 (0)