diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2021-11-15 17:44:34 +0530 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek.chauhan@gmail.com> | 2021-12-22 12:12:11 +0530 |
commit | 06b1132f82eaaf805021b4b088701d9754e2af38 (patch) | |
tree | f0d27ceae0864a09cba5ac5a8295d3c0345b6459 /mesonbuild/mesonlib/universal.py | |
parent | 95a4c6a62a925fc888e7c07ae3d9937c87e1c759 (diff) | |
download | meson-06b1132f82eaaf805021b4b088701d9754e2af38.zip meson-06b1132f82eaaf805021b4b088701d9754e2af38.tar.gz meson-06b1132f82eaaf805021b4b088701d9754e2af38.tar.bz2 |
Set RPATH for all non-system libs with absolute paths
If a pkg-config dependency has multiple libraries in it, which is the
most common case when it has a Requires: directive, or when it has
multiple -l args in Libs: (rare), then we don't add -Wl,-rpath
directives to it when linking.
The existing test wasn't catching it because it was linking to
a pkgconfig file with a single library in it. Update the test to
demonstrate this.
This function was originally added for shared libraries in the source
directory, which explains the name:
https://github.com/mesonbuild/meson/pull/2397
However, since now it is also used for linking to *all* non-system
shared libraries that we link to with absolute paths:
https://github.com/mesonbuild/meson/pull/3092
But that PR is incomplete / wrong, because only adding RPATHs for
dependencies that specify a single library, which is simply
inconsistent. Things will work for some dependencies and not work for
others, with no logical reason for it.
We should add RPATHs for *all* libraries. There are no special length
limits for RPATHs that I can find.
For ELF, DT_RPATH or DT_RUNPATH are used, which are just stored in
a string table (DT_STRTAB). The maximum length is only a problem when
editing pre-existing tags.
For Mach-O, each RPATH is stored in a separate LC_RPATH entry so there
are no length issues there either.
Fixes https://github.com/mesonbuild/meson/issues/9543
Fixes https://github.com/mesonbuild/meson/issues/4372
Diffstat (limited to 'mesonbuild/mesonlib/universal.py')
0 files changed, 0 insertions, 0 deletions