[oe] [meta-oe][PATCH 3/4] ltrace: 7.2 -> 7.3

Khem Raj raj.khem at gmail.com
Fri Aug 21 15:58:06 UTC 2015


On Fri, Aug 21, 2015 at 1:37 AM,  <kai.kang at windriver.com> wrote:
> From: Kai Kang <kai.kang at windriver.com>
>
> Upgrade ltrace from 7.2 to 7.3.
>
> * update SRC_URI and SRCREV
> * drop backport patch 0001-In-Linux-backend-initialize-linkmap-struct.patch
> * fix error when compile with gcc 5.2
>
> Signed-off-by: Kai Kang <kai.kang at windriver.com>
> ---
>  ...n-Linux-backend-initialize-linkmap-struct.patch | 31 ------------------
>  ...-ltrace-fix-gcc-5-logical-not-parentheses.patch | 37 ++++++++++++++++++++++
>  meta-oe/recipes-devtools/ltrace/ltrace_git.bb      |  8 ++---
>  3 files changed, 41 insertions(+), 35 deletions(-)
>  delete mode 100644 meta-oe/recipes-devtools/ltrace/ltrace/0001-In-Linux-backend-initialize-linkmap-struct.patch
>  create mode 100644 meta-oe/recipes-devtools/ltrace/ltrace/0001-ltrace-fix-gcc-5-logical-not-parentheses.patch
>
> diff --git a/meta-oe/recipes-devtools/ltrace/ltrace/0001-In-Linux-backend-initialize-linkmap-struct.patch b/meta-oe/recipes-devtools/ltrace/ltrace/0001-In-Linux-backend-initialize-linkmap-struct.patch
> deleted file mode 100644
> index 13609c1..0000000
> --- a/meta-oe/recipes-devtools/ltrace/ltrace/0001-In-Linux-backend-initialize-linkmap-struct.patch
> +++ /dev/null
> @@ -1,31 +0,0 @@
> -From efd12cfb10ccd2c612838c0e22069554ce60637c Mon Sep 17 00:00:00 2001
> -From: Petr Machata <pmachata at redhat.com>
> -Date: Wed, 2 Jan 2013 16:01:43 +0100
> -Subject: [PATCH] In Linux backend, initialize linkmap struct
> -
> -GCC 4.7.2 -m32 -Os gives the following (spurious) warning:
> -proc.c: In function 'crawl_linkmap':
> -proc.c:544:25: error: 'rlm.l_addr' may be used uninitialized in this
> -
> -Upstream-Status: Backport
> -Signed-off-by: Martin Jansa <Martin.Jansa at gmail.com>
> ----
> - sysdeps/linux-gnu/proc.c | 2 +-
> - 1 file changed, 1 insertion(+), 1 deletion(-)
> -
> -diff --git a/sysdeps/linux-gnu/proc.c b/sysdeps/linux-gnu/proc.c
> -index 6e01d28..d69c985 100644
> ---- a/sysdeps/linux-gnu/proc.c
> -+++ b/sysdeps/linux-gnu/proc.c
> -@@ -484,7 +484,7 @@ crawl_linkmap(struct process *proc, struct lt_r_debug_64 *dbg)
> -       arch_addr_t addr = (arch_addr_t)(uintptr_t)dbg->r_map;
> -
> -       while (addr != 0) {
> --              struct lt_link_map_64 rlm;
> -+              struct lt_link_map_64 rlm = {};
> -               if (lm_fetcher(proc)(proc, addr, &rlm) < 0) {
> -                       debug(2, "Unable to read link map");
> -                       return;
> ---
> -2.3.5
> -
> diff --git a/meta-oe/recipes-devtools/ltrace/ltrace/0001-ltrace-fix-gcc-5-logical-not-parentheses.patch b/meta-oe/recipes-devtools/ltrace/ltrace/0001-ltrace-fix-gcc-5-logical-not-parentheses.patch
> new file mode 100644
> index 0000000..ecfba0d
> --- /dev/null
> +++ b/meta-oe/recipes-devtools/ltrace/ltrace/0001-ltrace-fix-gcc-5-logical-not-parentheses.patch
> @@ -0,0 +1,37 @@
> +From 92bf386a18c9b49a9c44612b8ff7277c898de6cc Mon Sep 17 00:00:00 2001
> +From: Kai Kang <kai.kang at windriver.com>
> +Date: Fri, 21 Aug 2015 16:07:52 +0800
> +Subject: [PATCH] ltrace: fix gcc 5 logical not parentheses
> +
> +Upstream-Status: Pending
> +
> +Build ltrace with gcc 5.2, it fails with:
> +
> +error: logical not is only applied to the left hand side of comparison
> +[-Werror=logical-not-parentheses]
> +   if (!need_data(data, offset, SIZE / 8) < 0)  \
> +                                             ^
> +
> +Fix it.
> +
> +Signed-off-by: Kai Kang <kai.kang at windriver.com>
> +---
> + ltrace-elf.c | 2 +-
> + 1 file changed, 1 insertion(+), 1 deletion(-)
> +
> +diff --git a/ltrace-elf.c b/ltrace-elf.c
> +index c571d2a..fe66f25 100644
> +--- a/ltrace-elf.c
> ++++ b/ltrace-elf.c
> +@@ -218,7 +218,7 @@ need_data(Elf_Data *data, GElf_Xword offset, GElf_Xword size)
> +       int                                                             \
> +       NAME(Elf_Data *data, GElf_Xword offset, uint##SIZE##_t *retp)   \
> +       {                                                               \
> +-              if (!need_data(data, offset, SIZE / 8) < 0)             \
> ++              if (need_data(data, offset, SIZE / 8) >= 0)             \

While this might shut up the compiler, the fix seems end up with
incorrect behavior to me. if you look at the function need_data()
it returns 0 on success and < 0 on failure and you want to return -1
when the function fails not when it passes, as this patch now would be
doing.
so a simple fix it to test if (need_data(data, offset, SIZE / 8) < 0)

> +                       return -1;                                      \
> +                                                                       \
> +               if (data->d_buf == NULL) /* NODATA section */ {         \
> +--
> +1.9.1
> +
> diff --git a/meta-oe/recipes-devtools/ltrace/ltrace_git.bb b/meta-oe/recipes-devtools/ltrace/ltrace_git.bb
> index f9f1684..d8d037e 100644
> --- a/meta-oe/recipes-devtools/ltrace/ltrace_git.bb
> +++ b/meta-oe/recipes-devtools/ltrace/ltrace_git.bb
> @@ -10,15 +10,15 @@ LICENSE = "GPLv2"
>  LIC_FILES_CHKSUM = "file://COPYING;md5=eb723b61539feef013de476e68b5c50a"
>
>  PE = "1"
> -PV = "7.2+git${SRCPV}"
> -SRCREV = "f44b28421979cec88d6d6a778fc27a8cd514f508"
> +PV = "7.3+git${SRCPV}"
> +SRCREV = "37ecc41b58be3dbdd79592a76e331b5b371e4f81"
>
>  DEPENDS = "elfutils"
>  RDEPENDS_${PN} = "elfutils"
> -SRC_URI = "git://anonscm.debian.org/collab-maint/ltrace.git \
> +SRC_URI = "git://anonscm.debian.org/collab-maint/ltrace.git;branch=ltrace-0.7 \
>             file://ltrace-0.7.2-unused-typedef.patch \
>             file://configure-allow-to-disable-selinux-support.patch \
> -           file://0001-In-Linux-backend-initialize-linkmap-struct.patch \
> +           file://0001-ltrace-fix-gcc-5-logical-not-parentheses.patch \
>            "
>  S = "${WORKDIR}/git"
>
> --
> 1.9.1
>
> --
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel at lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-devel



More information about the Openembedded-devel mailing list