Skip to content

Commit ff91d5c

Browse files
bonzinifreakboy3742
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 <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent fde7200 commit ff91d5c

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

mesonbuild/linkers/linkers.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -760,10 +760,17 @@ def get_asneeded_args(self) -> T.List[str]:
760760
return self._apply_prefix('-dead_strip_dylibs')
761761

762762
def get_allow_undefined_args(self) -> T.List[str]:
763-
return self._apply_prefix('-undefined,dynamic_lookup')
763+
# iOS doesn't allow undefined symbols when linking
764+
if self.system == 'ios':
765+
return []
766+
else:
767+
return self._apply_prefix('-undefined,dynamic_lookup')
764768

765-
def get_std_shared_module_args(self, options: 'KeyedOptionDictType') -> T.List[str]:
766-
return ['-bundle'] + self._apply_prefix('-undefined,dynamic_lookup')
769+
def get_std_shared_module_args(self, target: 'BuildTarget') -> T.List[str]:
770+
if self.system == 'ios':
771+
return ['-dynamiclib']
772+
else:
773+
return ['-bundle'] + self.get_allow_undefined_args()
767774

768775
def get_pie_args(self) -> T.List[str]:
769776
return []

0 commit comments

Comments
 (0)