aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2020-08-23 14:58:12 +0300
committerJussi Pakkanen <jpakkane@gmail.com>2020-08-30 18:58:11 +0300
commit7d0393342ac4c94488b9629c4d0f110fe28b2221 (patch)
tree94c3b1a8681a7f4d8be2a3694b9a83d9a85e9ff4
parent1900720353bd76fa972423f413a206d0a7a42d69 (diff)
downloadmeson-7d0393342ac4c94488b9629c4d0f110fe28b2221.zip
meson-7d0393342ac4c94488b9629c4d0f110fe28b2221.tar.gz
meson-7d0393342ac4c94488b9629c4d0f110fe28b2221.tar.bz2
Dedup final install rpath.
-rw-r--r--mesonbuild/scripts/depfixer.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/mesonbuild/scripts/depfixer.py b/mesonbuild/scripts/depfixer.py
index 4176b9a..f927693 100644
--- a/mesonbuild/scripts/depfixer.py
+++ b/mesonbuild/scripts/depfixer.py
@@ -307,17 +307,20 @@ class Elf(DataSizes):
self.bf.seek(rp_off)
old_rpath = self.read_str()
- new_rpaths = []
+ # Some rpath entries may come from multiple sources.
+ # Only add each one once.
+ new_rpaths = OrderedSet()
if new_rpath:
- new_rpaths.append(new_rpath)
+ new_rpaths.add(new_rpath)
if old_rpath:
# Filter out build-only rpath entries
# added by get_link_dep_subdirs() or
# specified by user with build_rpath.
- for dir in old_rpath.split(b':'):
- if not (dir in rpath_dirs_to_remove or
- dir == (b'X' * len(dir))):
- new_rpaths.append(dir)
+ for rpath_dir in old_rpath.split(b':'):
+ if not (rpath_dir in rpath_dirs_to_remove or
+ rpath_dir == (b'X' * len(rpath_dir))):
+ if rpath_dir:
+ new_rpaths.add(rpath_dir)
# Prepend user-specified new entries while preserving the ones that came from pkgconfig etc.
new_rpath = b':'.join(new_rpaths)