* [PATCH 0/2] RPATH fixes: libtool & binutils
@ 2012-08-23 17:32 Andy Ross
2012-08-23 17:32 ` [PATCH 1/2] libtool: update rpath normalization to use builtin Andy Ross
2012-08-24 18:40 ` [PATCH 0/2] RPATH fixes: libtool & binutils Saul Wold
0 siblings, 2 replies; 4+ messages in thread
From: Andy Ross @ 2012-08-23 17:32 UTC (permalink / raw)
To: openembedded-core
Current RPATH work:
Patch 1 just updates the libtool work to use the built-in
normalization function instead of sed, as requested.
Patch 2 is to binutils ld, to fix the underlying host pollution issue:
the -rpath argument was not sysroot aware, so setting
"/usr/lib/../lib" as an RPATH would add the host /usr/lib to the link
time search path instead of the sysroot directory.
Note that the previous warning fix to insane.bbclass is still
producing unmasked warnings in a few cases (the rpm utilities are one
that I know), mostly in programs instead of libraries. These will
need to be audited independently. It's possible that they are liking
with -rpath directly and not using libtool, or that a needed
normalization in libtool is still missing. But with the current
patches these warnings are benign now, they can't break the build.
Andy
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/2] libtool: update rpath normalization to use builtin
2012-08-23 17:32 [PATCH 0/2] RPATH fixes: libtool & binutils Andy Ross
@ 2012-08-23 17:32 ` Andy Ross
2012-08-23 17:32 ` [PATCH 2/2] ld: -rpath must search under sysroot Andy Ross
2012-08-24 18:40 ` [PATCH 0/2] RPATH fixes: libtool & binutils Saul Wold
1 sibling, 1 reply; 4+ messages in thread
From: Andy Ross @ 2012-08-23 17:32 UTC (permalink / raw)
To: openembedded-core
Use the built-in normalization function instead of the sed hack.
Signed-off-by: Andy Ross <andy.ross@windriver.com>
---
meta/recipes-devtools/libtool/libtool-2.4.2.inc | 2 +-
.../libtool/libtool/norm-rpath.patch | 22 ++++++++--------------
2 files changed, 9 insertions(+), 15 deletions(-)
diff --git a/meta/recipes-devtools/libtool/libtool-2.4.2.inc b/meta/recipes-devtools/libtool/libtool-2.4.2.inc
index 691427e..95e12a2 100644
--- a/meta/recipes-devtools/libtool/libtool-2.4.2.inc
+++ b/meta/recipes-devtools/libtool/libtool-2.4.2.inc
@@ -8,7 +8,7 @@ LICENSE = "GPLv2 & LGPLv2.1"
LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe \
file://libltdl/COPYING.LIB;md5=e3eda01d9815f8d24aae2dbd89b68b06"
-INC_PR = "r4"
+INC_PR = "r5"
SRC_URI = "${GNU_MIRROR}/libtool/libtool-${PV}.tar.gz \
file://trailingslash.patch \
diff --git a/meta/recipes-devtools/libtool/libtool/norm-rpath.patch b/meta/recipes-devtools/libtool/libtool/norm-rpath.patch
index 03a7667..dce1576 100644
--- a/meta/recipes-devtools/libtool/libtool/norm-rpath.patch
+++ b/meta/recipes-devtools/libtool/libtool/norm-rpath.patch
@@ -7,33 +7,27 @@ RPATH in the generated binary. Normalize before comparision.
Signed-off-by: Andy Ross <andy.ross@windriver.com>
Upstream-Status: Pending
-diff -ru a/libltdl/config/ltmain.m4sh b/libltdl/config/ltmain.m4sh
+diff -ur a/libltdl/config/ltmain.m4sh b/libltdl/config/ltmain.m4sh
--- a/libltdl/config/ltmain.m4sh 2012-08-16 13:58:55.058900363 -0700
-+++ b/libltdl/config/ltmain.m4sh 2012-08-16 16:34:54.616627821 -0700
-@@ -7288,8 +7288,13 @@
++++ b/libltdl/config/ltmain.m4sh 2012-08-22 11:01:34.191345989 -0700
+@@ -7288,8 +7288,10 @@
else
# We only want to hardcode in an rpath if it isn't in the
# default dlsearch path.
-+ libdir_norm=`echo $libdir \
-+ | sed 's/\/\+\.\(\/\+\|$\)/\//g' \
-+ | sed 's/[^\/]\+\/\+\.\.\(\/\+\|$\)//g' \
-+ | sed 's/\/\+/\//g' \
-+ | sed 's/\(.\)\/$/\1/g'`
++ func_normal_abspath "$libdir"
++ libdir_norm=$func_normal_abspath_result
case " $sys_lib_dlsearch_path " in
- *" $libdir "*) ;;
+ *" $libdir_norm "*) ;;
*) eval flag=\"$hardcode_libdir_flag_spec\"
func_append dep_rpath " $flag"
;;
-@@ -8027,8 +8032,13 @@
+@@ -8027,8 +8029,10 @@
else
# We only want to hardcode in an rpath if it isn't in the
# default dlsearch path.
-+ libdir_norm=`echo $libdir \
-+ | sed 's/\/\+\.\(\/\+\|$\)/\//g' \
-+ | sed 's/[^\/]\+\/\+\.\.\(\/\+\|$\)//g' \
-+ | sed 's/\/\+/\//g' \
-+ | sed 's/\(.\)\/$/\1/g'`
++ func_normal_abspath "$libdir"
++ libdir_norm=$func_normal_abspath_result
case " $sys_lib_dlsearch_path " in
- *" $libdir "*) ;;
+ *" $libdir_norm "*) ;;
--
1.7.11.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] ld: -rpath must search under sysroot
2012-08-23 17:32 ` [PATCH 1/2] libtool: update rpath normalization to use builtin Andy Ross
@ 2012-08-23 17:32 ` Andy Ross
0 siblings, 0 replies; 4+ messages in thread
From: Andy Ross @ 2012-08-23 17:32 UTC (permalink / raw)
To: openembedded-core
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>
---
meta/recipes-devtools/binutils/binutils-2.22.inc | 3 +-
.../binutils/binutils/rpath-sysroot.patch | 38 ++++++++++++++++++++++
2 files changed, 40 insertions(+), 1 deletion(-)
create mode 100644 meta/recipes-devtools/binutils/binutils/rpath-sysroot.patch
diff --git a/meta/recipes-devtools/binutils/binutils-2.22.inc b/meta/recipes-devtools/binutils/binutils-2.22.inc
index 17950a2..821cc55 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 0000000..955699e
--- /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
+
--
1.7.11.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 0/2] RPATH fixes: libtool & binutils
2012-08-23 17:32 [PATCH 0/2] RPATH fixes: libtool & binutils Andy Ross
2012-08-23 17:32 ` [PATCH 1/2] libtool: update rpath normalization to use builtin Andy Ross
@ 2012-08-24 18:40 ` Saul Wold
1 sibling, 0 replies; 4+ messages in thread
From: Saul Wold @ 2012-08-24 18:40 UTC (permalink / raw)
To: Andy Ross; +Cc: openembedded-core
On 08/23/2012 10:32 AM, Andy Ross wrote:
> Current RPATH work:
>
> Patch 1 just updates the libtool work to use the built-in
> normalization function instead of sed, as requested.
>
> Patch 2 is to binutils ld, to fix the underlying host pollution issue:
> the -rpath argument was not sysroot aware, so setting
> "/usr/lib/../lib" as an RPATH would add the host /usr/lib to the link
> time search path instead of the sysroot directory.
>
> Note that the previous warning fix to insane.bbclass is still
> producing unmasked warnings in a few cases (the rpm utilities are one
> that I know), mostly in programs instead of libraries. These will
> need to be audited independently. It's possible that they are liking
> with -rpath directly and not using libtool, or that a needed
> normalization in libtool is still missing. But with the current
> patches these warnings are benign now, they can't break the build.
>
> Andy
>
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
>
Merged this patch set into OE-Core
Thanks
Sau!
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-08-24 18:54 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-23 17:32 [PATCH 0/2] RPATH fixes: libtool & binutils Andy Ross
2012-08-23 17:32 ` [PATCH 1/2] libtool: update rpath normalization to use builtin Andy Ross
2012-08-23 17:32 ` [PATCH 2/2] ld: -rpath must search under sysroot Andy Ross
2012-08-24 18:40 ` [PATCH 0/2] RPATH fixes: libtool & binutils Saul Wold
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox