[OE-core] [PATCH v3] nettle: fix ptest failure
mingli.yu at windriver.com
mingli.yu at windriver.com
Mon Apr 15 09:05:22 UTC 2019
From: Mingli Yu <Mingli.Yu at windriver.com>
Remove dlopen-test.patch which originally used
to fix the test dlopen-test, but actually it
didn't resolve the issue as expected as it hardcodes
the file /usr/lib/libnettle.so.
Update dynamically with the real ${libdir}/libnettle.so
to fix the below dlopen-test failure:
# cd /usr/lib64/nettle/ptest
# ./run-ptest
dlopen failed: ../libnettle.so: cannot open shared object file: No such file or directory
./run-ptest: line 8: 7607 Aborted "./$f"
FAIL: dlopen-test
As the test dlopen-test depends on libnettle.so
which belongs to nettle-dev package, so add it
to rdepends of nettle-ptest.
Signed-off-by: Mingli Yu <Mingli.Yu at windriver.com>
---
.../nettle/nettle-3.4.1/dlopen-test.patch | 20 --------------------
meta/recipes-support/nettle/nettle_3.4.1.bb | 9 +++++----
2 files changed, 5 insertions(+), 24 deletions(-)
delete mode 100644 meta/recipes-support/nettle/nettle-3.4.1/dlopen-test.patch
diff --git a/meta/recipes-support/nettle/nettle-3.4.1/dlopen-test.patch b/meta/recipes-support/nettle/nettle-3.4.1/dlopen-test.patch
deleted file mode 100644
index c4f0b7e..0000000
--- a/meta/recipes-support/nettle/nettle-3.4.1/dlopen-test.patch
+++ /dev/null
@@ -1,20 +0,0 @@
-Replace relative path of libnettle.so with absolute path so the test
-program can find it.
-Relative paths are not suitable, as the folder strucure for ptest
-is different from the one expected by the nettle testsuite.
-
-Upstream-Status: Inappropriate [embedded specific]
-
-Signed-off-by: Juro Bystricky <juro.bystricky at intel.com>
-
---- a/testsuite/dlopen-test.c 2016-10-01 00:28:38.000000000 -0700
-+++ b/testsuite/dlopen-test.c 2017-10-13 11:08:57.227572860 -0700
-@@ -9,7 +9,7 @@
- main (int argc UNUSED, char **argv UNUSED)
- {
- #if HAVE_LIBDL
-- void *handle = dlopen ("../libnettle.so", RTLD_NOW);
-+ void *handle = dlopen ("/usr/lib/libnettle.so", RTLD_NOW);
- int (*get_version)(void);
- if (!handle)
- {
diff --git a/meta/recipes-support/nettle/nettle_3.4.1.bb b/meta/recipes-support/nettle/nettle_3.4.1.bb
index dd49c30..d6bdd2a 100644
--- a/meta/recipes-support/nettle/nettle_3.4.1.bb
+++ b/meta/recipes-support/nettle/nettle_3.4.1.bb
@@ -16,10 +16,6 @@ SRC_URI = "${GNU_MIRROR}/${BPN}/${BP}.tar.gz \
file://check-header-files-of-openssl-only-if-enable_.patch \
"
-SRC_URI_append_class-target = "\
- file://dlopen-test.patch \
- "
-
SRC_URI[md5sum] = "9bdebb0e2f638d3b9d91f7fc264b70c1"
SRC_URI[sha256sum] = "f941cf1535cd5d1819be5ccae5babef01f6db611f9b5a777bae9c7604b8a92ad"
@@ -33,6 +29,8 @@ EXTRA_OECONF = "--disable-openssl"
CFLAGS_append = " -std=c99"
do_compile_ptest() {
+ # fix dlopen-test failure as cannot locate libnettle.so
+ sed -i 's;dlopen ("../libnettle.so", RTLD_NOW);dlopen ("${libdir}/libnettle.so", RTLD_NOW);g' ${S}/testsuite/dlopen-test.c
oe_runmake buildtest
}
@@ -49,4 +47,7 @@ do_install_ptest() {
install ${B}/testsuite/*-test ${D}${PTEST_PATH}/testsuite/
}
+RDEPENDS_${PN}-ptest += "${PN}-dev"
+INSANE_SKIP_${PN}-ptest += "dev-deps"
+
BBCLASSEXTEND = "native nativesdk"
--
2.7.4
More information about the Openembedded-core
mailing list