summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndres Freund <andres@anarazel.de>2023-12-01 16:52:19 -0800
committerJussi Pakkanen <jpakkane@gmail.com>2023-12-06 23:20:09 +0200
commit7148b4f207bd7a09d9191abe7ffee8d7996c4634 (patch)
tree064ead23c010899e56ec8a42b6f692132942b0f6
parent39ecfc2d542ae7e248119b5dcb6f0a01493e2ae6 (diff)
downloadmeson-7148b4f207bd7a09d9191abe7ffee8d7996c4634.tar.gz
macos: Do not emit -undefined,error for Sonoma compatibility
Emitting -undefined,error was correct,, but starting with Xcode 15 / Sonoma, doing so triggers "ld: warning: -undefined error is deprecated". Given that "-undefined error" is documented to be the linker's default behaviour, this warning seems ill advised. However, it does create a lot of noise. As "-undefined error" is the default behaviour, the least bad way to deal with this seems to be to just not emit anything. Of course that only works as long as nothing else injects -undefined dynamic_lookup, or such. Complain to Apple. Fixes: https://github.com/mesonbuild/meson/issues/12450
-rw-r--r--mesonbuild/linkers/linkers.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/mesonbuild/linkers/linkers.py b/mesonbuild/linkers/linkers.py
index dbb5e57aa..ec8edba11 100644
--- a/mesonbuild/linkers/linkers.py
+++ b/mesonbuild/linkers/linkers.py
@@ -792,7 +792,15 @@ class AppleDynamicLinker(PosixDynamicLinkerMixin, DynamicLinker):
return ['-fsanitize=' + value]
def no_undefined_args(self) -> T.List[str]:
- return self._apply_prefix('-undefined,error')
+ # We used to emit -undefined,error, but starting with Xcode 15 /
+ # Sonoma, doing so triggers "ld: warning: -undefined error is
+ # deprecated". Given that "-undefined error" is documented to be the
+ # linker's default behaviour, this warning seems ill advised. However,
+ # it does create a lot of noise. As "-undefined error" is the default
+ # behaviour, the least bad way to deal with this seems to be to just
+ # not emit anything here. Of course that only works as long as nothing
+ # else injects -undefined dynamic_lookup, or such. Complain to Apple.
+ return []
def headerpad_args(self) -> T.List[str]:
return self._apply_prefix('-headerpad_max_install_names')