2017-12-05 21:30:52

by Richard Weinberger

[permalink] [raw]
Subject: Re: [PATCH] scripts/faddr2line: extend usage on generic arch

On Tue, Nov 21, 2017 at 10:29 AM, Liu, Changcheng
<[email protected]> wrote:
> fadd2line script should use the binary tool
> used for the target system.
>
> Signed-off-by: Liu Changcheng <[email protected]>
>
> diff --git a/scripts/faddr2line b/scripts/faddr2line
> index 1f5ce95..39e07d8 100755
> --- a/scripts/faddr2line
> +++ b/scripts/faddr2line
> @@ -44,9 +44,16 @@
> set -o errexit
> set -o nounset
>
> +READELF="${CROSS_COMPILE}readelf"
> +ADDR2LINE="${CROSS_COMPILE}addr2line"
> +SIZE="${CROSS_COMPILE}size"
> +NM="${CROSS_COMPILE}nm"

How is this supposed to work when not cross compiling?
When CROSS_COMPILE is not set this script will terminate because of
the "set -o nounset" bash setting...

--
Thanks,
//richard


2017-12-06 01:37:02

by Liu, Changcheng

[permalink] [raw]
Subject: Re: [PATCH] scripts/faddr2line: extend usage on generic arch

On 22:30 Tue 05 Dec, Richard Weinberger wrote:
> On Tue, Nov 21, 2017 at 10:29 AM, Liu, Changcheng
> <[email protected]> wrote:
> > fadd2line script should use the binary tool
> > used for the target system.
> >
> > Signed-off-by: Liu Changcheng <[email protected]>
> >
> > diff --git a/scripts/faddr2line b/scripts/faddr2line
> > index 1f5ce95..39e07d8 100755
> > --- a/scripts/faddr2line
> > +++ b/scripts/faddr2line
> > @@ -44,9 +44,16 @@
> > set -o errexit
> > set -o nounset
> >
> > +READELF="${CROSS_COMPILE}readelf"
> > +ADDR2LINE="${CROSS_COMPILE}addr2line"
> > +SIZE="${CROSS_COMPILE}size"
> > +NM="${CROSS_COMPILE}nm"
>
> How is this supposed to work when not cross compiling?
> When CROSS_COMPILE is not set this script will terminate because of
> the "set -o nounset" bash setting...

[Changcheng]:@Richard. Thx for your check. I've sent the fix patch to
resolve the unbound variable error.

>
> --
> Thanks,
> //richard