Re: [OE-core] [PATCH v2] nettle: fix ptest failure

2019-04-15 Thread Adrian Bunk
On Mon, Apr 15, 2019 at 09:06:12AM +0100, richard.pur...@linuxfoundation.org 
wrote:
> On Mon, 2019-04-15 at 16:09 +0800, Yu, Mingli wrote:
> > 
> > On 2019年04月15日 15:59, richard.pur...@linuxfoundation.org wrote:
> > > On Mon, 2019-04-15 at 15:40 +0800, mingli...@windriver.com wrote:
> > > >  a/testsuite/dlopen-test.c  2016-10-01 00:28:38.0
> > > > -0700
> > > > -+++ b/testsuite/dlopen-test.c  2017-10-13 11:08:57.227572860
> > > > -0700
> > > > -@@ -9,7 +9,7 @@
> > > > +diff --git a/testsuite/dlopen-test.c b/testsuite/dlopen-test.c
> > > > +index 99d3535..92de9f8 100644
> > > > +--- a/testsuite/dlopen-test.c
> > > >  b/testsuite/dlopen-test.c
> > > > +@@ -9,7 +9,9 @@ int
> > > >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);
> > > > ++  if (!handle)
> > > > ++ handle = dlopen ("/usr/lib64/libnettle.so", RTLD_NOW);
> > > >  int (*get_version)(void);
> > > >  if (!handle)
> > > >{
> > > 
> > > What happens on a 32 bit system?
> > > 
> > > You can't hardcode a specific libdir like that!
> > 
> > I just rework the patch dlopen-test.patch which Juro Bystricky
> > generated 
> > before, the previous patch only check /usr/lib/libnettle.so and I 
> > updated it also to check /usr/lib64/libnettle.so if no 
> > /usr/lib/libnettle.so exist.
> >   -  void *handle = dlopen ("../libnettle.so", RTLD_NOW);
> >   +  void *handle = dlopen ("/usr/lib/libnettle.so", RTLD_NOW);
> > ++  if (!handle)
> > ++ handle = dlopen ("/usr/lib64/libnettle.so", RTLD_NOW);
> 
> What happens on x32? n32? or if I set libdir to lib32?

dlopen("libnettle.so", RTLD_NOW) should work,
this uses the normal library search path.

But is it actually worth permanently carrying a patch here?
run-ptest already skips one test for unrelated reasons,
and skipping another one would also be an option.

> Cheers,
> 
> Richard

cu
Adrian

-- 

   "Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
   "Only a promise," Lao Er said.
   Pearl S. Buck - Dragon Seed

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


Re: [OE-core] [PATCH v2] nettle: fix ptest failure

2019-04-15 Thread Yu, Mingli



On 2019年04月15日 16:06, richard.pur...@linuxfoundation.org wrote:

On Mon, 2019-04-15 at 16:09 +0800, Yu, Mingli wrote:


On 2019年04月15日 15:59, richard.pur...@linuxfoundation.org wrote:

On Mon, 2019-04-15 at 15:40 +0800, mingli...@windriver.com wrote:

 a/testsuite/dlopen-test.c  2016-10-01 00:28:38.0
-0700
-+++ b/testsuite/dlopen-test.c  2017-10-13 11:08:57.227572860
-0700
-@@ -9,7 +9,7 @@
+diff --git a/testsuite/dlopen-test.c b/testsuite/dlopen-test.c
+index 99d3535..92de9f8 100644
+--- a/testsuite/dlopen-test.c
 b/testsuite/dlopen-test.c
+@@ -9,7 +9,9 @@ int
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);
++  if (!handle)
++ handle = dlopen ("/usr/lib64/libnettle.so", RTLD_NOW);
  int (*get_version)(void);
  if (!handle)
{


What happens on a 32 bit system?

You can't hardcode a specific libdir like that!


I just rework the patch dlopen-test.patch which Juro Bystricky
generated
before, the previous patch only check /usr/lib/libnettle.so and I
updated it also to check /usr/lib64/libnettle.so if no
/usr/lib/libnettle.so exist.
   -  void *handle = dlopen ("../libnettle.so", RTLD_NOW);
   +  void *handle = dlopen ("/usr/lib/libnettle.so", RTLD_NOW);
++  if (!handle)
++ handle = dlopen ("/usr/lib64/libnettle.so", RTLD_NOW);


What happens on x32? n32? or if I set libdir to lib32?


Got it! V3 is coming.



Cheers,

Richard





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


Re: [OE-core] [PATCH v2] nettle: fix ptest failure

2019-04-15 Thread richard . purdie
On Mon, 2019-04-15 at 16:09 +0800, Yu, Mingli wrote:
> 
> On 2019年04月15日 15:59, richard.pur...@linuxfoundation.org wrote:
> > On Mon, 2019-04-15 at 15:40 +0800, mingli...@windriver.com wrote:
> > >  a/testsuite/dlopen-test.c2016-10-01 00:28:38.0
> > > -0700
> > > -+++ b/testsuite/dlopen-test.c2017-10-13 11:08:57.227572860
> > > -0700
> > > -@@ -9,7 +9,7 @@
> > > +diff --git a/testsuite/dlopen-test.c b/testsuite/dlopen-test.c
> > > +index 99d3535..92de9f8 100644
> > > +--- a/testsuite/dlopen-test.c
> > >  b/testsuite/dlopen-test.c
> > > +@@ -9,7 +9,9 @@ int
> > >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);
> > > ++  if (!handle)
> > > ++ handle = dlopen ("/usr/lib64/libnettle.so", RTLD_NOW);
> > >  int (*get_version)(void);
> > >  if (!handle)
> > >{
> > 
> > What happens on a 32 bit system?
> > 
> > You can't hardcode a specific libdir like that!
> 
> I just rework the patch dlopen-test.patch which Juro Bystricky
> generated 
> before, the previous patch only check /usr/lib/libnettle.so and I 
> updated it also to check /usr/lib64/libnettle.so if no 
> /usr/lib/libnettle.so exist.
>   -  void *handle = dlopen ("../libnettle.so", RTLD_NOW);
>   +  void *handle = dlopen ("/usr/lib/libnettle.so", RTLD_NOW);
> ++  if (!handle)
> ++ handle = dlopen ("/usr/lib64/libnettle.so", RTLD_NOW);

What happens on x32? n32? or if I set libdir to lib32?

Cheers,

Richard



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


Re: [OE-core] [PATCH v2] nettle: fix ptest failure

2019-04-15 Thread Yu, Mingli



On 2019年04月15日 15:59, richard.pur...@linuxfoundation.org wrote:

On Mon, 2019-04-15 at 15:40 +0800, mingli...@windriver.com wrote:

 a/testsuite/dlopen-test.c  2016-10-01 00:28:38.0
-0700
-+++ b/testsuite/dlopen-test.c  2017-10-13 11:08:57.227572860
-0700
-@@ -9,7 +9,7 @@
+diff --git a/testsuite/dlopen-test.c b/testsuite/dlopen-test.c
+index 99d3535..92de9f8 100644
+--- a/testsuite/dlopen-test.c
 b/testsuite/dlopen-test.c
+@@ -9,7 +9,9 @@ int
   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);
++  if (!handle)
++ handle = dlopen ("/usr/lib64/libnettle.so", RTLD_NOW);
 int (*get_version)(void);
 if (!handle)
   {


What happens on a 32 bit system?

You can't hardcode a specific libdir like that!


I just rework the patch dlopen-test.patch which Juro Bystricky generated 
before, the previous patch only check /usr/lib/libnettle.so and I 
updated it also to check /usr/lib64/libnettle.so if no 
/usr/lib/libnettle.so exist.

 -  void *handle = dlopen ("../libnettle.so", RTLD_NOW);
 +  void *handle = dlopen ("/usr/lib/libnettle.so", RTLD_NOW);
++  if (!handle)
++ handle = dlopen ("/usr/lib64/libnettle.so", RTLD_NOW);


Thanks,



Cheers,

Richard



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


Re: [OE-core] [PATCH v2] nettle: fix ptest failure

2019-04-15 Thread richard . purdie
On Mon, 2019-04-15 at 15:40 +0800, mingli...@windriver.com wrote:
>  a/testsuite/dlopen-test.c2016-10-01 00:28:38.0
> -0700
> -+++ b/testsuite/dlopen-test.c2017-10-13 11:08:57.227572860
> -0700
> -@@ -9,7 +9,7 @@
> +diff --git a/testsuite/dlopen-test.c b/testsuite/dlopen-test.c
> +index 99d3535..92de9f8 100644
> +--- a/testsuite/dlopen-test.c
>  b/testsuite/dlopen-test.c
> +@@ -9,7 +9,9 @@ int
>   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);
> ++  if (!handle)
> ++ handle = dlopen ("/usr/lib64/libnettle.so", RTLD_NOW);
> int (*get_version)(void);
> if (!handle)
>   {

What happens on a 32 bit system?

You can't hardcode a specific libdir like that!

Cheers,

Richard

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


[OE-core] [PATCH v2] nettle: fix ptest failure

2019-04-15 Thread mingli.yu
From: Mingli Yu 

Rework dlopen-test.patch to fix below
dlopen-test failure:
 # cd /usr/lib64/nettle/ptest
 # ./run-ptest
 dlopen failed: /usr/lib/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 
---
 .../nettle/nettle-3.4.1/dlopen-test.patch  | 23 +++---
 meta/recipes-support/nettle/nettle_3.4.1.bb|  3 +++
 2 files changed, 23 insertions(+), 3 deletions(-)

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
index c4f0b7e..9b075d8 100644
--- a/meta/recipes-support/nettle/nettle-3.4.1/dlopen-test.patch
+++ b/meta/recipes-support/nettle/nettle-3.4.1/dlopen-test.patch
@@ -1,20 +1,37 @@
+From d8140904f51ec8025833e5e7eee732a4a50ed0cf Mon Sep 17 00:00:00 2001
+From: Mingli Yu 
+Date: Mon, 15 Apr 2019 11:16:54 +0800
+Subject: [PATCH] dlopen-test.c: use absolute path
+
 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 
+Signed-off-by: Mingli Yu 
+---
+ testsuite/dlopen-test.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
 
 a/testsuite/dlopen-test.c  2016-10-01 00:28:38.0 -0700
-+++ b/testsuite/dlopen-test.c  2017-10-13 11:08:57.227572860 -0700
-@@ -9,7 +9,7 @@
+diff --git a/testsuite/dlopen-test.c b/testsuite/dlopen-test.c
+index 99d3535..92de9f8 100644
+--- a/testsuite/dlopen-test.c
 b/testsuite/dlopen-test.c
+@@ -9,7 +9,9 @@ int
  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);
++  if (!handle)
++ handle = dlopen ("/usr/lib64/libnettle.so", RTLD_NOW);
int (*get_version)(void);
if (!handle)
  {
+-- 
+2.7.4
+
diff --git a/meta/recipes-support/nettle/nettle_3.4.1.bb 
b/meta/recipes-support/nettle/nettle_3.4.1.bb
index dd49c30..131676d 100644
--- a/meta/recipes-support/nettle/nettle_3.4.1.bb
+++ b/meta/recipes-support/nettle/nettle_3.4.1.bb
@@ -49,4 +49,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

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