On 2019年05月29日 18:13, richard.pur...@linuxfoundation.org wrote:
On Wed, 2019-05-29 at 16:55 +0800, mingli...@windriver.com wrote:
From: Mingli Yu <mingli...@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...@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


--
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core

Reply via email to