Skip to content

Commit

Permalink
macos: Do not emit -undefined,error for Sonoma compatibility
Browse files Browse the repository at this point in the history
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: #12450
  • Loading branch information
anarazel authored and jpakkane committed Dec 6, 2023
1 parent 39ecfc2 commit 7148b4f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion mesonbuild/linkers/linkers.py
Original file line number Diff line number Diff line change
Expand Up @@ -792,7 +792,15 @@ def sanitizer_args(self, value: str) -> T.List[str]:
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')
Expand Down

0 comments on commit 7148b4f

Please sign in to comment.