Openembedded Core Discussions
 help / color / mirror / Atom feed
From: "Yu, Mingli" <mingli.yu@windriver.com>
To: <richard.purdie@linuxfoundation.org>,
	<openembedded-core@lists.openembedded.org>
Subject: Re: [PATCH v3] elfutils: fix ptest failures
Date: Thu, 30 May 2019 14:03:39 +0800	[thread overview]
Message-ID: <5CEF723B.2060709@windriver.com> (raw)
In-Reply-To: <ba81c9ea11db351bde7fec1c40c2f57495c3fdec.camel@linuxfoundation.org>



On 2019年05月29日 18:13, richard.purdie@linuxfoundation.org wrote:
> On Wed, 2019-05-29 at 16:55 +0800, mingli.yu@windriver.com wrote:
>> From: Mingli Yu <Mingli.Yu@windriver.com>
>>
>> * Add missing -ptest package dependency (needs
>>    ${PN}-dev)
>>
>> * Add missing files which needed by ptest test
>>    to fix the ptest failures such as:
>>    | sh: ../src/elflint: No such file or directory
>>    | FAIL: asm-tst4
>>
>> * Rework 0001-skip-the-test-when-gcc-not-deployed.patch
>>    to skip the tests which depend on gcc
>>
>> * Define INHIBIT_PACKAGE_STRIP_FILES for elfutils to
>>    avoid stripping some generated binaries otherwise
>>    some of the tests such as test-nlist, run-strip-reloc.sh,
>>    run-strip-strmerge.sh and so on will fail
>>
>> Before:
>> --------------------------------------------
>> Recipe   | Passed    | Failed   | Skipped
>> --------------------------------------------
>> elfutils | 176       | 23       | 4
>> --------------------------------------------
>>
>> After:
>> --------------------------------------------
>> Recipe   | Passed    | Failed   | Skipped
>> --------------------------------------------
>> elfutils | 199       | 0       | 4
>> --------------------------------------------
>>
>> Signed-off-by: Mingli Yu <Mingli.Yu@windriver.com>
>> ---
>>   meta/recipes-devtools/elfutils/elfutils_0.176.bb   | 34 ++++++++++++++++++-
>>   .../0001-skip-the-test-when-gcc-not-deployed.patch | 38 +++++++++++++++++++---
>>   2 files changed, 66 insertions(+), 6 deletions(-)
>>
>> diff --git a/meta/recipes-devtools/elfutils/elfutils_0.176.bb b/meta/recipes-devtools/elfutils/elfutils_0.176.bb
>> index 157551e..93d0c78 100644
>> --- a/meta/recipes-devtools/elfutils/elfutils_0.176.bb
>> +++ b/meta/recipes-devtools/elfutils/elfutils_0.176.bb
>> @@ -44,7 +44,7 @@ inherit autotools gettext ptest
>>
>>   EXTRA_OECONF = "--program-prefix=eu- --without-lzma"
>>   EXTRA_OECONF_append_class-native = " --without-bzlib"
>> -RDEPENDS_${PN}-ptest = "libasm libelf bash make coreutils ${PN}-binutils ${PN}"
>> +RDEPENDS_${PN}-ptest = "libasm libelf bash make coreutils ${PN}-binutils ${PN} ${PN}-dev"
>>
>>   EXTRA_OECONF_append_class-target += "--disable-tests-rpath"
>>
>> @@ -61,6 +61,16 @@ do_compile_ptest() {
>>
>>   do_install_ptest() {
>>   	if [ ${PTEST_ENABLED} = "1" ]; then
>> +		# copy the files which needed by the cases
>> +		TEST_FILES="strip strip.o addr2line elfcmp objdump readelf size.o nm.o nm elflint"
>> +		install -d -m 755                       ${D}${PTEST_PATH}/src
>> +		install -d -m 755                       ${D}${PTEST_PATH}/libelf
>> +		install -d -m 755                       ${D}${PTEST_PATH}/libdw
>> +		for test_file in ${TEST_FILES}; do
>> +			cp -r ${B}/src/${test_file} ${D}${PTEST_PATH}/src
>> +		done
>> +		ln -s ${libdir}/libelf.so ${D}${PTEST_PATH}/libelf/libelf.so
>> +		ln -s ${libdir}/libdw.so ${D}${PTEST_PATH}/libdw/libdw.so
>>   		cp -r ${S}/tests/                       ${D}${PTEST_PATH}
>>   		cp -r ${B}/tests/*                      ${D}${PTEST_PATH}/tests
>>   		cp -r ${B}/config.h                     ${D}${PTEST_PATH}
>> @@ -109,3 +119,25 @@ FILES_libdw  = "${libdir}/libdw-${PV}.so ${libdir}/libdw.so.* ${libdir}/elfutils
>>
>>   # The package contains symlinks that trip up insane
>>   INSANE_SKIP_${MLPREFIX}libdw = "dev-so"
>> +INSANE_SKIP_${PN}-ptest += "dev-deps"
>> +
>> +# avoid stripping some generated binaries otherwise some of the tests such as test-nlist,
>> +# run-strip-reloc.sh, run-strip-strmerge.sh and so on will fail
>> +INHIBIT_PACKAGE_STRIP_FILES = "\
>> +    ${PKGD}${PTEST_PATH}/tests/test-nlist \
>> +    ${PKGD}${PTEST_PATH}/tests/elfstrmerge \
>> +    ${PKGD}${PTEST_PATH}/tests/backtrace-child \
>> +    ${PKGD}${PTEST_PATH}/tests/backtrace-data \
>> +    ${PKGD}${PTEST_PATH}/tests/deleted \
>> +    ${PKGD}${PTEST_PATH}/src/strip \
>> +    ${PKGD}${PTEST_PATH}/src/addr2line \
>> +    ${PKGD}${PTEST_PATH}/src/elfcmp \
>> +    ${PKGD}${PTEST_PATH}/src/objdump \
>> +    ${PKGD}${PTEST_PATH}/src/readelf \
>> +    ${PKGD}${PTEST_PATH}/src/nm \
>> +    ${PKGD}${PTEST_PATH}/src/elflint \
>> +    ${PKGD}${libdir}/libelf-${PV}.so \
>> +    ${PKGD}${libdir}/libdw-${PV}.so \
>
> This looks better, except for the two libdir lines above. This will
> inflate main image sizes just to make tests work :(.

>
> We're going to need to fine another way to handle this as I'd imagine
> the size increase is substancial.
>
> It may be worth asking upstream whether they'd accept the tests using
> the debug link mechanism we use to find extra symbol information?

Without the two libdir lines, most cases will fail. And even upstream 
changes to the debug link mechanism, we still need to make -ptest 
rdepends on -dbg. But I'm not sure upstream can make some move.

BTW, How about use the below solution? if so, all tests pass and we 
don't need -ptest rdepends on -dev and -dbg anyway. Will send out V4.

+ cp ${D}${libdir}/libelf-${PV}.so ${D}${PTEST_PATH}/libelf/libelf.so
+ cp ${D}${libdir}/libdw-${PV}.so ${D}${PTEST_PATH}/libdw/libdw.so

Thanks,

>
> Cheers,
>
> Richard
>
>


  reply	other threads:[~2019-05-30  5:58 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-22  9:11 [PATCH] elfutils: fix ptest failures mingli.yu
2019-05-25 20:16 ` richard.purdie
2019-05-28  9:31   ` Yu, Mingli
2019-05-28  9:40   ` [PATCH v2] " mingli.yu
2019-05-28 10:01     ` richard.purdie
2019-05-29  2:59       ` Yu, Mingli
2019-05-29  8:55       ` [PATCH v3] " mingli.yu
2019-05-29 10:13         ` richard.purdie
2019-05-30  6:03           ` Yu, Mingli [this message]
2019-05-30  6:11           ` [PATCH v4] " mingli.yu
2019-05-30 20:49             ` richard.purdie
2019-05-30 22:16               ` Richard Purdie
2019-05-31  6:40               ` Yu, Mingli
2019-05-31  8:48                 ` richard.purdie
2019-05-31  9:44                   ` [PATCH v5] " mingli.yu
2019-05-29 18:40         ` [PATCH v3] " richard.purdie
2019-05-30  6:04           ` Yu, Mingli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5CEF723B.2060709@windriver.com \
    --to=mingli.yu@windriver.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=richard.purdie@linuxfoundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox