]>
Commit | Line | Data |
---|---|---|
1e241970 | 1 | From befc176c209bbb4c32b57c2068e813c88b1ab6b1 Mon Sep 17 00:00:00 2001 |
e9f839d5 KR |
2 | From: Ross Burton <ross.burton@intel.com> |
3 | Date: Mon, 6 Mar 2017 23:33:27 -0800 | |
897afa95 | 4 | Subject: [PATCH] sync with OE libtool changes |
e9f839d5 | 5 | |
6b201081 RB |
6 | Apply these patches from our libtool patches as not only are redundant RPATHs a |
7 | waste of space but they can cause incorrect linking when native packages are | |
8 | restored from sstate. | |
9 | ||
10 | fix-rpath.patch: | |
11 | We don't want to add RPATHS which match default linker | |
12 | search paths, they're a waste of space. This patch | |
13 | filters libtools list and removes the ones we don't need. | |
14 | ||
15 | norm-rpath.patch: | |
16 | Libtool may be passed link paths of the form "/usr/lib/../lib", which | |
17 | fool its detection code into thinking it should be included as an | |
18 | RPATH in the generated binary. Normalize before comparision. | |
19 | ||
20 | Upstream-Status: Inappropriate | |
e9f839d5 | 21 | |
6b201081 | 22 | Signed-off-by: Ross Burton <ross.burton@intel.com> |
e9f839d5 KR |
23 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
24 | --- | |
25 | ltmain.sh | 34 ++++++++++++++++++++++++++++------ | |
26 | 1 file changed, 28 insertions(+), 6 deletions(-) | |
6b201081 RB |
27 | |
28 | diff --git a/ltmain.sh b/ltmain.sh | |
795af50e | 29 | index f59eb4aa631..ce97db42ce7 100644 |
6b201081 RB |
30 | --- a/ltmain.sh |
31 | +++ b/ltmain.sh | |
e9f839d5 | 32 | @@ -8053,8 +8053,16 @@ EOF |
6b201081 RB |
33 | esac |
34 | fi | |
35 | else | |
36 | - eval flag=\"$hardcode_libdir_flag_spec\" | |
37 | - func_append dep_rpath " $flag" | |
38 | + # We only want to hardcode in an rpath if it isn't in the | |
39 | + # default dlsearch path. | |
e9f839d5 KR |
40 | + func_normal_abspath "$libdir" |
41 | + libdir_norm=$func_normal_abspath_result | |
6b201081 | 42 | + case " $sys_lib_dlsearch_path " in |
e9f839d5 | 43 | + *" $libdir_norm "*) ;; |
6b201081 RB |
44 | + *) eval flag=\"$hardcode_libdir_flag_spec\" |
45 | + func_append dep_rpath " $flag" | |
46 | + ;; | |
47 | + esac | |
48 | fi | |
49 | elif test -n "$runpath_var"; then | |
50 | case "$perm_rpath " in | |
e9f839d5 | 51 | @@ -8790,8 +8798,16 @@ EOF |
6b201081 RB |
52 | esac |
53 | fi | |
54 | else | |
55 | - eval flag=\"$hardcode_libdir_flag_spec\" | |
56 | - func_append rpath " $flag" | |
57 | + # We only want to hardcode in an rpath if it isn't in the | |
58 | + # default dlsearch path. | |
e9f839d5 KR |
59 | + func_normal_abspath "$libdir" |
60 | + libdir_norm=$func_normal_abspath_result | |
6b201081 | 61 | + case " $sys_lib_dlsearch_path " in |
e9f839d5 | 62 | + *" $libdir_norm "*) ;; |
6b201081 RB |
63 | + *) eval flag=\"$hardcode_libdir_flag_spec\" |
64 | + rpath+=" $flag" | |
65 | + ;; | |
66 | + esac | |
67 | fi | |
68 | elif test -n "$runpath_var"; then | |
69 | case "$perm_rpath " in | |
e9f839d5 | 70 | @@ -8841,8 +8857,14 @@ EOF |
6b201081 RB |
71 | esac |
72 | fi | |
73 | else | |
74 | - eval flag=\"$hardcode_libdir_flag_spec\" | |
75 | - func_append rpath " $flag" | |
76 | + # We only want to hardcode in an rpath if it isn't in the | |
77 | + # default dlsearch path. | |
78 | + case " $sys_lib_dlsearch_path " in | |
79 | + *" $libdir "*) ;; | |
80 | + *) eval flag=\"$hardcode_libdir_flag_spec\" | |
81 | + func_append rpath " $flag" | |
82 | + ;; | |
83 | + esac | |
84 | fi | |
85 | elif test -n "$runpath_var"; then | |
86 | case "$finalize_perm_rpath " in |