summaryrefslogtreecommitdiff
path: root/mesonbuild
diff options
context:
space:
mode:
authorPiotr BrzeziƄski <piotr@centricular.com>2024-06-28 14:06:25 +0200
committerEli Schwartz <eschwartz93@gmail.com>2024-06-29 23:40:59 -0400
commitdc1b4be6be321e39d21604ab4287c9ce972be4da (patch)
tree9a557b71af4f3acada522572b5efe8b0668629d3 /mesonbuild
parent7b43a2e19613f3702935872b21b1020f7d8c6a9b (diff)
downloadmeson-dc1b4be6be321e39d21604ab4287c9ce972be4da.tar.gz
linkers: Fix AppleDynamicLinker not returning any rpaths to remove
Fixes regression from commit 78e9009ff9d36925e04f329f9082841002ddd848. The above commit relied on rpath_dirs_to_remove being present and correctly filled, which was never the case for the AppleDynamicLinker. The result was that all the build-dir-only RPATHs were being carried over to the installed files. This commit implements returning the list of RPATHs to remove in AppleDynamicLinker, doing pretty much the same thing as what's in the GnuLikeDynamicLinkerMixin. Thanks to that, depfixer now correctly removes build-time Meson-created RPATHs, as it used to before 1.4.1.
Diffstat (limited to 'mesonbuild')
-rw-r--r--mesonbuild/linkers/linkers.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/mesonbuild/linkers/linkers.py b/mesonbuild/linkers/linkers.py
index f5e808082..c3750ccc3 100644
--- a/mesonbuild/linkers/linkers.py
+++ b/mesonbuild/linkers/linkers.py
@@ -819,17 +819,19 @@ class AppleDynamicLinker(PosixDynamicLinkerMixin, DynamicLinker):
if not rpath_paths and not install_rpath and not build_rpath:
return ([], set())
args: T.List[str] = []
+ rpath_dirs_to_remove: T.Set[bytes] = set()
# @loader_path is the equivalent of $ORIGIN on macOS
# https://stackoverflow.com/q/26280738
origin_placeholder = '@loader_path'
processed_rpaths = prepare_rpaths(rpath_paths, build_dir, from_dir)
all_paths = mesonlib.OrderedSet([os.path.join(origin_placeholder, p) for p in processed_rpaths])
if build_rpath != '':
- all_paths.add(build_rpath)
+ all_paths.update(build_rpath.split(':'))
for rp in all_paths:
+ rpath_dirs_to_remove.add(rp.encode('utf8'))
args.extend(self._apply_prefix('-rpath,' + rp))
- return (args, set())
+ return (args, rpath_dirs_to_remove)
def get_thinlto_cache_args(self, path: str) -> T.List[str]:
return ["-Wl,-cache_path_lto," + path]