aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2020-06-10 08:22:46 +0530
committerNirbheek Chauhan <nirbheek.chauhan@gmail.com>2020-06-11 07:10:43 +0000
commit47c477711b61f7b60551129f039fba67f7d3483e (patch)
tree3e18f8ae3a075fe0b7582efcfca3b2d0d2bc0445 /mesonbuild
parent5b8a63650478a96799e2c8929f66849d1e68a38a (diff)
downloadmeson-47c477711b61f7b60551129f039fba67f7d3483e.zip
meson-47c477711b61f7b60551129f039fba67f7d3483e.tar.gz
meson-47c477711b61f7b60551129f039fba67f7d3483e.tar.bz2
apple: -headerpad args are ignored when bitcode is enabled
Causes spammy warnings from the linker: ld: warning: -headerpad_max_install_names is ignored when used with -bitcode_bundle (Xcode setting ENABLE_BITCODE=YES)
Diffstat (limited to 'mesonbuild')
-rw-r--r--mesonbuild/compilers/compilers.py8
-rw-r--r--mesonbuild/linkers.py12
2 files changed, 13 insertions, 7 deletions
diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py
index f427262..c80ffb0 100644
--- a/mesonbuild/compilers/compilers.py
+++ b/mesonbuild/compilers/compilers.py
@@ -377,9 +377,10 @@ def get_base_link_args(options, linker, is_shared_module):
# -Wl,-dead_strip_dylibs is incompatible with bitcode
args.extend(linker.get_asneeded_args())
- # Apple's ld (the only one that supports bitcode) does not like any
- # -undefined arguments at all, so don't pass these when using bitcode
+ # Apple's ld (the only one that supports bitcode) does not like -undefined
+ # arguments or -headerpad_max_install_names when bitcode is enabled
if not bitcode:
+ args.extend(linker.headerpad_args())
if (not is_shared_module and
option_enabled(linker.base_options, options, 'b_lundef')):
args.extend(linker.no_undefined_link_args())
@@ -1203,6 +1204,9 @@ class Compiler:
def get_asneeded_args(self) -> T.List[str]:
return self.linker.get_asneeded_args()
+ def headerpad_args(self) -> T.List[str]:
+ return self.linker.headerpad_args()
+
def bitcode_args(self) -> T.List[str]:
return self.linker.bitcode_args()
diff --git a/mesonbuild/linkers.py b/mesonbuild/linkers.py
index 25a8c9c..bb3229d 100644
--- a/mesonbuild/linkers.py
+++ b/mesonbuild/linkers.py
@@ -440,6 +440,10 @@ class DynamicLinker(LinkerEnvVarsMixin, metaclass=abc.ABCMeta):
"""Arguments to make all warnings errors."""
return []
+ def headerpad_args(self) -> T.List[str]:
+ # Only used by the Apple linker
+ return []
+
def bitcode_args(self) -> T.List[str]:
raise mesonlib.MesonException('This linker does not support bitcode bundles')
@@ -659,8 +663,8 @@ class AppleDynamicLinker(PosixDynamicLinkerMixin, DynamicLinker):
def no_undefined_args(self) -> T.List[str]:
return self._apply_prefix('-undefined,error')
- def get_always_args(self) -> T.List[str]:
- return self._apply_prefix('-headerpad_max_install_names') + super().get_always_args()
+ def headerpad_args(self) -> T.List[str]:
+ return self._apply_prefix('-headerpad_max_install_names')
def bitcode_args(self) -> T.List[str]:
return self._apply_prefix('-bitcode_bundle')
@@ -688,9 +692,7 @@ class AppleDynamicLinker(PosixDynamicLinkerMixin, DynamicLinker):
install_rpath: str) -> T.Tuple[T.List[str], T.Set[bytes]]:
if not rpath_paths and not install_rpath and not build_rpath:
return ([], set())
- # Ensure that there is enough space for install_name_tool in-place
- # editing of large RPATHs
- args = self._apply_prefix('-headerpad_max_install_names')
+ args = []
# @loader_path is the equivalent of $ORIGIN on macOS
# https://stackoverflow.com/q/26280738
origin_placeholder = '@loader_path'