Removed
Link Here
|
1 |
https://github.com/mesonbuild/meson/pull/4324 |
2 |
|
3 |
From 068f0b3bc7becab6762ada45ecdd5dc601ee2473 Mon Sep 17 00:00:00 2001 |
4 |
From: Ting-Wei Lan <lantw@src.gnome.org> |
5 |
Date: Thu, 4 Oct 2018 23:03:30 +0800 |
6 |
Subject: [PATCH] backends: Use raw_link_args to check for the need of RPATH |
7 |
|
8 |
Function rpaths_for_bundled_shared_libraries assumes it needs RPATH when |
9 |
linking arguments of an external dependency has exactly one argument and |
10 |
the only argument is an absolute path to a library file. This was mostly |
11 |
fine because almost all .pc files use a -L -l pair instead of the full |
12 |
path of the library, which means pkg-config dependencies almost always |
13 |
have at least two arguments. However, there are patches landed in the |
14 |
meson 0.47 cycle which convert -L -l pair returned by pkg-config to the |
15 |
absolute path of library. If the output of pkg-config includes exactly |
16 |
one -L argument and one -l argument, it will be converted to exactly one |
17 |
absolute path by meson and rpaths_for_bundled_shared_libraries will |
18 |
assume it needs RPATH. Since meson passes both -rpath and -rpath-link to |
19 |
the linker and -rpath-link has precedence over LD_LIBRARY_PATH, it |
20 |
changes the search order of dependent libraries in an unexpected way and |
21 |
it causes a lot of linking troubles in JHBuild environments on FreeBSD. |
22 |
|
23 |
To make the method behave like the old way of using -L -l pairs and |
24 |
avoid library path order problems, we use raw_link_args instead of |
25 |
link_args here. raw_link_args stores the unmodified output of pkg-config |
26 |
and it is much less likely to accidentally match the rule currently used |
27 |
by the method. |
28 |
|
29 |
Works around https://github.com/mesonbuild/meson/issues/4270. |
30 |
--- mesonbuild/backend/backends.py.orig 2018-09-22 13:22:03 UTC |
31 |
+++ mesonbuild/backend/backends.py |
32 |
@@ -371,7 +371,7 @@ class Backend: |
33 |
for dep in target.external_deps: |
34 |
if not isinstance(dep, (dependencies.ExternalLibrary, dependencies.PkgConfigDependency)): |
35 |
continue |
36 |
- la = dep.link_args |
37 |
+ la = dep.get_link_args(raw=True) |
38 |
if len(la) != 1 or not os.path.isabs(la[0]): |
39 |
continue |
40 |
# The only link argument is an absolute path to a library file. |