diff options
author | Andy Ross <andy.ross@windriver.com> | 2012-08-17 08:53:11 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-08-22 14:22:55 +0100 |
commit | 25e926e5f6bbfb31d784e1f6a86bd77d4a3f7622 (patch) | |
tree | 70b40116ff0340107475e4aa1dc10a8453ad2be4 /meta/recipes-devtools | |
parent | c7cfe7759e4816d870595e901496ae53e0452726 (diff) | |
download | poky-25e926e5f6bbfb31d784e1f6a86bd77d4a3f7622.tar.gz |
libtool: normalize link paths before considering for RPATH
Libtool may be passed link paths of the form "/usr/lib/../lib", which fool
its detection code into thinking it should be included as an RPATH in
the generated binary. Normalize before comparision.
(From OE-Core rev: e3b0925f4c861393e436deb6b1912f9f1f325d1e)
Signed-off-by: Andy Ross <andy.ross@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools')
-rw-r--r-- | meta/recipes-devtools/libtool/libtool-2.4.2.inc | 1 | ||||
-rw-r--r-- | meta/recipes-devtools/libtool/libtool/norm-rpath.patch | 42 |
2 files changed, 43 insertions, 0 deletions
diff --git a/meta/recipes-devtools/libtool/libtool-2.4.2.inc b/meta/recipes-devtools/libtool/libtool-2.4.2.inc index 5b9557ee49..691427e09d 100644 --- a/meta/recipes-devtools/libtool/libtool-2.4.2.inc +++ b/meta/recipes-devtools/libtool/libtool-2.4.2.inc | |||
@@ -19,6 +19,7 @@ SRC_URI = "${GNU_MIRROR}/libtool/libtool-${PV}.tar.gz \ | |||
19 | file://avoid_absolute_paths_for_general_utils.patch \ | 19 | file://avoid_absolute_paths_for_general_utils.patch \ |
20 | file://fix-rpath.patch \ | 20 | file://fix-rpath.patch \ |
21 | file://respect-fstack-protector.patch \ | 21 | file://respect-fstack-protector.patch \ |
22 | file://norm-rpath.patch \ | ||
22 | " | 23 | " |
23 | 24 | ||
24 | SRC_URI[md5sum] = "d2f3b7d4627e69e13514a40e72a24d50" | 25 | SRC_URI[md5sum] = "d2f3b7d4627e69e13514a40e72a24d50" |
diff --git a/meta/recipes-devtools/libtool/libtool/norm-rpath.patch b/meta/recipes-devtools/libtool/libtool/norm-rpath.patch new file mode 100644 index 0000000000..03a7667708 --- /dev/null +++ b/meta/recipes-devtools/libtool/libtool/norm-rpath.patch | |||
@@ -0,0 +1,42 @@ | |||
1 | libtool: normalize link paths before considering for RPATH | ||
2 | |||
3 | Libtool may be passed link paths of the form "/usr/lib/../lib", which | ||
4 | fool its detection code into thinking it should be included as an | ||
5 | RPATH in the generated binary. Normalize before comparision. | ||
6 | |||
7 | Signed-off-by: Andy Ross <andy.ross@windriver.com> | ||
8 | Upstream-Status: Pending | ||
9 | |||
10 | diff -ru a/libltdl/config/ltmain.m4sh b/libltdl/config/ltmain.m4sh | ||
11 | --- a/libltdl/config/ltmain.m4sh 2012-08-16 13:58:55.058900363 -0700 | ||
12 | +++ b/libltdl/config/ltmain.m4sh 2012-08-16 16:34:54.616627821 -0700 | ||
13 | @@ -7288,8 +7288,13 @@ | ||
14 | else | ||
15 | # We only want to hardcode in an rpath if it isn't in the | ||
16 | # default dlsearch path. | ||
17 | + libdir_norm=`echo $libdir \ | ||
18 | + | sed 's/\/\+\.\(\/\+\|$\)/\//g' \ | ||
19 | + | sed 's/[^\/]\+\/\+\.\.\(\/\+\|$\)//g' \ | ||
20 | + | sed 's/\/\+/\//g' \ | ||
21 | + | sed 's/\(.\)\/$/\1/g'` | ||
22 | case " $sys_lib_dlsearch_path " in | ||
23 | - *" $libdir "*) ;; | ||
24 | + *" $libdir_norm "*) ;; | ||
25 | *) eval flag=\"$hardcode_libdir_flag_spec\" | ||
26 | func_append dep_rpath " $flag" | ||
27 | ;; | ||
28 | @@ -8027,8 +8032,13 @@ | ||
29 | else | ||
30 | # We only want to hardcode in an rpath if it isn't in the | ||
31 | # default dlsearch path. | ||
32 | + libdir_norm=`echo $libdir \ | ||
33 | + | sed 's/\/\+\.\(\/\+\|$\)/\//g' \ | ||
34 | + | sed 's/[^\/]\+\/\+\.\.\(\/\+\|$\)//g' \ | ||
35 | + | sed 's/\/\+/\//g' \ | ||
36 | + | sed 's/\(.\)\/$/\1/g'` | ||
37 | case " $sys_lib_dlsearch_path " in | ||
38 | - *" $libdir "*) ;; | ||
39 | + *" $libdir_norm "*) ;; | ||
40 | *) eval flag=\"$hardcode_libdir_flag_spec\" | ||
41 | rpath+=" $flag" | ||
42 | ;; | ||