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:22:47 +0100 |
commit | bccea580f1abb762d231f785a4e60c9cd368dcdf (patch) | |
tree | c0b272ccf1c1c226329c5d6b3b85b24fe2c7e18f /meta/recipes-devtools/binutils | |
parent | dd56ca611671233b8eec78aaa7e24b232654bc92 (diff) | |
download | openembedded-core-bccea580f1abb762d231f785a4e60c9cd368dcdf.tar.gz openembedded-core-bccea580f1abb762d231f785a4e60c9cd368dcdf.tar.bz2 openembedded-core-bccea580f1abb762d231f785a4e60c9cd368dcdf.zip |
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]
Signed-off-by: Andy Ross <andy.ross@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/binutils')
-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 @@ -PR = "r14" +PR = "r15" LIC_FILES_CHKSUM="\ file://src-release;endline=17;md5=4830a9ef968f3b18dd5e9f2c00db2d35\ @@ -31,6 +31,7 @@ SRC_URI = "\ file://binutils-armv5e.patch \ file://mips64-default-ld-emulation.patch \ file://0001-PR-ld-13470.patch \ + file://rpath-sysroot.patch \ " 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 @@ +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. + +Signed-off-by: Andy Ross <andy.ross@windriver.com> +Upstream-Status: submitted (binutils@sourceware.org 2012-08-22) +--- + ld/emultempl/elf32.em | 10 +++++++--- + 1 file changed, 7 insertions(+), 3 deletions(-) + +diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em +index de51050..35e0e7e 100644 +--- a/ld/emultempl/elf32.em ++++ b/ld/emultempl/elf32.em +@@ -1263,9 +1263,13 @@ fragment <<EOF + EOF + if [ "x${USE_LIBPATH}" = xyes ] ; then + fragment <<EOF +- if (gld${EMULATION_NAME}_search_needed (command_line.rpath, +- &n, force)) +- break; ++ if (command_line.rpath) { ++ char *tmprp = gld${EMULATION_NAME}_add_sysroot (command_line.rpath); ++ found = gld${EMULATION_NAME}_search_needed (tmprp, &n, force); ++ free(tmprp); ++ if (found) ++ break; ++ } + EOF + fi + if [ "x${NATIVE}" = xyes ] ; then +-- +1.7.11.2 + |