diff options
author | Eli Schwartz <eschwartz93@gmail.com> | 2024-06-26 20:38:56 -0400 |
---|---|---|
committer | Eli Schwartz <eschwartz93@gmail.com> | 2024-06-26 21:35:09 -0400 |
commit | 7b43a2e19613f3702935872b21b1020f7d8c6a9b (patch) | |
tree | d963f6ab5bf6125bc45acae1f2b1d72a31054dd4 | |
parent | ef83d943d96c5d73c09bd6e2abbfdbb15ae73029 (diff) | |
download | meson-7b43a2e19613f3702935872b21b1020f7d8c6a9b.zip meson-7b43a2e19613f3702935872b21b1020f7d8c6a9b.tar.gz meson-7b43a2e19613f3702935872b21b1020f7d8c6a9b.tar.bz2 |
depfixer: fix darwin regression when install rpaths are used
Fixes regression in commit 78e9009ff9d36925e04f329f9082841002ddd848.
new_rpath is only set when install_rpath appears in meson.build.
Before this commit, we treated new_rpath as a single string to pass to
-add_rpath. This worked as long as new_rpath had a single rpath in it,
though for ELF we explicitly supported multiple rpaths separated with
":" (as binutils ld is quite happy with that too).
install_name_tool does not support paths with colons in it:
```
21:12 <awilfox> Load command 19 cmd LC_RPATH cmdsize 40 path /bar:/baz:/eli:/ldap (offset 12)
21:12 <awilfox> Load command 20 cmd LC_RPATH cmdsize 24 path /foo (offset 12)
21:14 <awilfox> so the result is: do not use colons
```
After commit 78e9009ff9d36925e04f329f9082841002ddd848, we simply ended
up with one load command for LC_RPATH per char in new_rpath, which was
wrong in every possible case.
What we actually need to do is pass every distinct rpath as a separate
`-add_rpath` argument, so we split it on the colons instead. We do the
same splitting to ensure proper diff'ability for ELF anyways...
Fixes #13355
-rw-r--r-- | mesonbuild/scripts/depfixer.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mesonbuild/scripts/depfixer.py b/mesonbuild/scripts/depfixer.py index 71599f7..f0166bd 100644 --- a/mesonbuild/scripts/depfixer.py +++ b/mesonbuild/scripts/depfixer.py @@ -406,7 +406,7 @@ def fix_darwin(fname: str, rpath_dirs_to_remove: T.Set[bytes], new_rpath: str, f return new_rpaths: OrderedSet[str] = OrderedSet() if new_rpath: - new_rpaths.update(new_rpath) + new_rpaths.update(new_rpath.split(':')) # filter out build-only rpath entries, like in # fix_rpathtype_entry remove_rpaths = [x.decode('utf8') for x in rpath_dirs_to_remove] |