diff options
author | Andy Ross <andy.ross@windriver.com> | 2012-08-23 17:32:31 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-08-24 17:25:14 +0100 |
commit | 8592e828261fb4a48b8156e11b5859d38aeb403f (patch) | |
tree | d6c600c9df64213a496ba2690fa53e8b5006ddfd /meta/recipes-devtools | |
parent | fed844ed2f558d5da68b0b1fd707bc201b9e5821 (diff) | |
download | poky-8592e828261fb4a48b8156e11b5859d38aeb403f.tar.gz |
ld: -rpath must search under sysroot
The -rpath argument would search the host filesystem for libraries,
even when a sysroot was defined. For cross toolchains with targets
compatible with the host architecture this can find incorrect
libraries. Leave -rpath-link unmodified, as build systems in the wild
are already using this to point to host directories.
[YOCTO #2965]
(From OE-Core rev: bccea580f1abb762d231f785a4e60c9cd368dcdf)
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/binutils/binutils-2.22.inc | 3 | ||||
-rw-r--r-- | meta/recipes-devtools/binutils/binutils/rpath-sysroot.patch | 38 |
2 files changed, 40 insertions, 1 deletions
diff --git a/meta/recipes-devtools/binutils/binutils-2.22.inc b/meta/recipes-devtools/binutils/binutils-2.22.inc index 17950a22d4..821cc555d0 100644 --- a/meta/recipes-devtools/binutils/binutils-2.22.inc +++ b/meta/recipes-devtools/binutils/binutils-2.22.inc | |||
@@ -1,4 +1,4 @@ | |||
1 | PR = "r14" | 1 | PR = "r15" |
2 | 2 | ||
3 | LIC_FILES_CHKSUM="\ | 3 | LIC_FILES_CHKSUM="\ |
4 | file://src-release;endline=17;md5=4830a9ef968f3b18dd5e9f2c00db2d35\ | 4 | file://src-release;endline=17;md5=4830a9ef968f3b18dd5e9f2c00db2d35\ |
@@ -31,6 +31,7 @@ SRC_URI = "\ | |||
31 | file://binutils-armv5e.patch \ | 31 | file://binutils-armv5e.patch \ |
32 | file://mips64-default-ld-emulation.patch \ | 32 | file://mips64-default-ld-emulation.patch \ |
33 | file://0001-PR-ld-13470.patch \ | 33 | file://0001-PR-ld-13470.patch \ |
34 | file://rpath-sysroot.patch \ | ||
34 | " | 35 | " |
35 | 36 | ||
36 | SRC_URI[md5sum] = "ee0f10756c84979622b992a4a61ea3f5" | 37 | SRC_URI[md5sum] = "ee0f10756c84979622b992a4a61ea3f5" |
diff --git a/meta/recipes-devtools/binutils/binutils/rpath-sysroot.patch b/meta/recipes-devtools/binutils/binutils/rpath-sysroot.patch new file mode 100644 index 0000000000..955699ed7b --- /dev/null +++ b/meta/recipes-devtools/binutils/binutils/rpath-sysroot.patch | |||
@@ -0,0 +1,38 @@ | |||
1 | ld: -rpath must search under sysroot | ||
2 | |||
3 | The -rpath argument would search the host filesystem for libraries, | ||
4 | even when a sysroot was defined. For cross toolchains with targets | ||
5 | compatible with the host architecture this can find incorrect | ||
6 | libraries. Leave -rpath-link unmodified, as build systems in the wild | ||
7 | are already using this to point to host directories. | ||
8 | |||
9 | Signed-off-by: Andy Ross <andy.ross@windriver.com> | ||
10 | Upstream-Status: submitted (binutils@sourceware.org 2012-08-22) | ||
11 | --- | ||
12 | ld/emultempl/elf32.em | 10 +++++++--- | ||
13 | 1 file changed, 7 insertions(+), 3 deletions(-) | ||
14 | |||
15 | diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em | ||
16 | index de51050..35e0e7e 100644 | ||
17 | --- a/ld/emultempl/elf32.em | ||
18 | +++ b/ld/emultempl/elf32.em | ||
19 | @@ -1263,9 +1263,13 @@ fragment <<EOF | ||
20 | EOF | ||
21 | if [ "x${USE_LIBPATH}" = xyes ] ; then | ||
22 | fragment <<EOF | ||
23 | - if (gld${EMULATION_NAME}_search_needed (command_line.rpath, | ||
24 | - &n, force)) | ||
25 | - break; | ||
26 | + if (command_line.rpath) { | ||
27 | + char *tmprp = gld${EMULATION_NAME}_add_sysroot (command_line.rpath); | ||
28 | + found = gld${EMULATION_NAME}_search_needed (tmprp, &n, force); | ||
29 | + free(tmprp); | ||
30 | + if (found) | ||
31 | + break; | ||
32 | + } | ||
33 | EOF | ||
34 | fi | ||
35 | if [ "x${NATIVE}" = xyes ] ; then | ||
36 | -- | ||
37 | 1.7.11.2 | ||
38 | |||