blob: 6afd37aafcbe1f5f4bd17aad73b8543b61b03bcf [file] [log] [blame]
Patrick Williams213cb262021-08-07 19:21:33 -05001From 4b612f902c596838ab260194f840a466f8291618 Mon Sep 17 00:00:00 2001
Andrew Geissler82c905d2020-04-13 13:39:40 -05002From: Ross Burton <ross.burton@intel.com>
3Date: Mon, 6 Mar 2017 23:33:27 -0800
Andrew Geisslerd1e89492021-02-12 15:35:20 -06004Subject: [PATCH] sync with OE libtool changes
Andrew Geissler82c905d2020-04-13 13:39:40 -05005
6Apply these patches from our libtool patches as not only are redundant RPATHs a
7waste of space but they can cause incorrect linking when native packages are
8restored from sstate.
9
10fix-rpath.patch:
11We don't want to add RPATHS which match default linker
12search paths, they're a waste of space. This patch
13filters libtools list and removes the ones we don't need.
14
15norm-rpath.patch:
16Libtool may be passed link paths of the form "/usr/lib/../lib", which
17fool its detection code into thinking it should be included as an
18RPATH in the generated binary. Normalize before comparision.
19
20Upstream-Status: Inappropriate
21
22Signed-off-by: Ross Burton <ross.burton@intel.com>
23Signed-off-by: Khem Raj <raj.khem@gmail.com>
24---
25 ltmain.sh | 34 ++++++++++++++++++++++++++++------
26 1 file changed, 28 insertions(+), 6 deletions(-)
27
28diff --git a/ltmain.sh b/ltmain.sh
Andrew Geissler635e0e42020-08-21 15:58:33 -050029index 11ee684cccf..3b19ac15328 100644
Andrew Geissler82c905d2020-04-13 13:39:40 -050030--- a/ltmain.sh
31+++ b/ltmain.sh
32@@ -8053,8 +8053,16 @@ EOF
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.
40+ func_normal_abspath "$libdir"
41+ libdir_norm=$func_normal_abspath_result
42+ case " $sys_lib_dlsearch_path " in
43+ *" $libdir_norm "*) ;;
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
51@@ -8790,8 +8798,16 @@ EOF
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.
59+ func_normal_abspath "$libdir"
60+ libdir_norm=$func_normal_abspath_result
61+ case " $sys_lib_dlsearch_path " in
62+ *" $libdir_norm "*) ;;
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
70@@ -8841,8 +8857,14 @@ EOF
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