Patchwork eglibc: don't list the same path twice in RTLDLIST

login
register
mail settings
Submitter Bogdan Marinescu
Date Jan. 30, 2013, 4:26 p.m.
Message ID <1359563200-28139-1-git-send-email-bogdan.a.marinescu@intel.com>
Download mbox | patch
Permalink /patch/43721/
State Accepted
Commit 947e95b67c0d3285b1e043ea81a0b9d217d56d2e
Headers show

Comments

Bogdan Marinescu - Jan. 30, 2013, 4:26 p.m.
Before modifying RTLDLIST in ldd, make sure that it doesn't already
contain the right path, thus avoiding duplicate entries in RTLDLIST.

[YOCTO #2655]

Signed-off-by: Bogdan Marinescu <bogdan.a.marinescu@intel.com>
---
 meta/recipes-core/eglibc/eglibc_2.17.bb |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
Khem Raj - Jan. 30, 2013, 7:54 p.m.
Looks ok to me.

On Wed, Jan 30, 2013 at 8:26 AM, Bogdan Marinescu
<bogdan.a.marinescu@intel.com> wrote:
> Before modifying RTLDLIST in ldd, make sure that it doesn't already
> contain the right path, thus avoiding duplicate entries in RTLDLIST.
>
> [YOCTO #2655]
>
> Signed-off-by: Bogdan Marinescu <bogdan.a.marinescu@intel.com>
> ---
>  meta/recipes-core/eglibc/eglibc_2.17.bb |    9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/meta/recipes-core/eglibc/eglibc_2.17.bb b/meta/recipes-core/eglibc/eglibc_2.17.bb
> index c1cae4f..7bdb267 100644
> --- a/meta/recipes-core/eglibc/eglibc_2.17.bb
> +++ b/meta/recipes-core/eglibc/eglibc_2.17.bb
> @@ -1,6 +1,6 @@
>  require eglibc.inc
>
> -PR = "r1"
> +PR = "r2"
>
>  DEPENDS += "gperf-native kconfig-frontends-native"
>
> @@ -143,8 +143,11 @@ do_compile () {
>         echo "Adjust ldd script"
>         if [ -n "${RTLDLIST}" ]
>         then
> -               sed -i ${B}/elf/ldd -e 's#^\(RTLDLIST=\)"\(.*\)"$#\1\2#'
> -               sed -i ${B}/elf/ldd -e 's#^\(RTLDLIST=\)\(.*\)$#\1"${RTLDLIST} \2"#'
> +               prevrtld=`cat ${B}/elf/ldd | grep "^RTLDLIST=" | sed 's#^RTLDLIST=\(.*\)$#\1#'`
> +               if [ "${prevrtld}" != "${RTLDLIST}" ]
> +               then
> +                       sed -i ${B}/elf/ldd -e "s#^RTLDLIST=.*\$#RTLDLIST=\"${prevrtld} ${RTLDLIST}\"#"
> +               fi
>         fi
>
>  }
> --
> 1.7.10.4
>
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core

Patch

diff --git a/meta/recipes-core/eglibc/eglibc_2.17.bb b/meta/recipes-core/eglibc/eglibc_2.17.bb
index c1cae4f..7bdb267 100644
--- a/meta/recipes-core/eglibc/eglibc_2.17.bb
+++ b/meta/recipes-core/eglibc/eglibc_2.17.bb
@@ -1,6 +1,6 @@ 
 require eglibc.inc
 
-PR = "r1"
+PR = "r2"
 
 DEPENDS += "gperf-native kconfig-frontends-native"
 
@@ -143,8 +143,11 @@  do_compile () {
 	echo "Adjust ldd script"
 	if [ -n "${RTLDLIST}" ]
 	then
-		sed -i ${B}/elf/ldd -e 's#^\(RTLDLIST=\)"\(.*\)"$#\1\2#'
-		sed -i ${B}/elf/ldd -e 's#^\(RTLDLIST=\)\(.*\)$#\1"${RTLDLIST} \2"#'
+		prevrtld=`cat ${B}/elf/ldd | grep "^RTLDLIST=" | sed 's#^RTLDLIST=\(.*\)$#\1#'`
+		if [ "${prevrtld}" != "${RTLDLIST}" ]
+		then
+			sed -i ${B}/elf/ldd -e "s#^RTLDLIST=.*\$#RTLDLIST=\"${prevrtld} ${RTLDLIST}\"#"
+		fi
 	fi
 
 }