[OE-core] [PATCH] perl-ptest.inc: fix tar call to prevent objcopy failure

Renato Caldas rm.santos.caldas at gmail.com
Tue May 31 11:35:45 UTC 2016


Hi Enrico,

Sorry for the late reply, I missed this e-mail... Your suggestions are
very valid, although not strictly needed to fix this particular bug.

My suggestion is that you submit a new patch with those improvements
on top of the quick fix I made. I suggest you also add quotes to the
--exclude options per tar's man page.

You might also want to simplify the commit message a bit. I'm fairly
new to yocto (and my view may be wrong), but this is how I would do
it:
- change the component name from "perl-ptest.inc:" to "perl:"
- use the commit title to describe the change you made, not exactly
what bug it fixed. Example: "fix tar call according to its man page"
(or something like that)
- describe the change in simpler terms. Taking what you wrote, I would
rewrite it like this:

"The existing tar call on do_install_ptest() did not match the man
page, but worked with older tar versions. The new 1.29 version of tar
has stricter argument handling, and future versions may be even
stricter. Failure to use it according to its manual may result in
arguments being silently ignored and breaking the build."


So while changing the position of the "*" fixed it for tar 1.29, your
proposed changes are important to future-proof the perl recipe for
newer tar versions. As such, please do submit a new patch.

Cheers,
  Renato

2016-05-30 14:04 GMT+01:00 Enrico Jorns <ejo at pengutronix.de>:
> With tar version 1.29, the tar call used to copy the ptest files will
> not work anymore. While the call did not match the man page (but worked)
> before, anyway, the latest update of tar seems to have a more strict argument
> handling.
>
> With the current version of the tar call, the copying of files still
> works with latest tar version, but the excludes will not be handled
> properly anymore.
> This results in having binaries compiled with host GCC in the package.
> When doing the strip_and_split files in do_package() with the target
> objcopy, bitbake will fail with this error:
>
>   ERROR: objcopy failed with exit code 256 (cmd was [...])
>   [...]
>   File format not recognized
>
> Thus, the current argument issues and required changes are:
>
>  * Options must be placed _before_ the pathnames.
>
>  * --exclude must be followd by a '=' in order to work properly
>
>  * 'f' options is for providing an archive file, which is unnecessary in
>    this case
>
> Note that this could also be a candidate for backporting.
>
> Signed-off-by: Enrico Jorns <ejo at pengutronix.de>
> ---
>
>
> I just wanted to send my patch when I saw you had already send it. Will send
> this one instead as I added some more changes that might be useful. Maybe we
> can squash this into yours if its found to be useful, too.
>
> Best regards, Enrico
>
>
>  meta/recipes-devtools/perl/perl-ptest.inc | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/meta/recipes-devtools/perl/perl-ptest.inc b/meta/recipes-devtools/perl/perl-ptest.inc
> index 948ea7c..5f0989f 100644
> --- a/meta/recipes-devtools/perl/perl-ptest.inc
> +++ b/meta/recipes-devtools/perl/perl-ptest.inc
> @@ -7,8 +7,8 @@ do_install_ptest () {
>         mkdir -p ${D}${PTEST_PATH}
>         sed -e "s:\/opt:\/usr:" -i Porting/add-package.pl
>         sed -e "s:\/local\/gnu\/:\/:" -i hints/cxux.sh
> -       tar -cf - * --exclude \*.o --exclude libperl.so --exclude Makefile --exclude makefile --exclude hostperl \
> -               --exclude miniperl --exclude generate_uudmap --exclude patches | ( cd ${D}${PTEST_PATH} && tar -xf - )
> +       tar -c --exclude=\*.o --exclude=libperl.so --exclude=Makefile --exclude=makefile --exclude=hostperl \
> +               --exclude=miniperl --exclude=generate_uudmap --exclude=patches * | ( cd ${D}${PTEST_PATH} && tar -x )
>
>         sed -i -e "s,${D},,g" \
>                -e "s,--sysroot=${STAGING_DIR_HOST},,g" \
> --
> 2.8.1
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core at lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core



More information about the Openembedded-core mailing list