[uclibc-ng-devel] Fix path to file libtest31.so

Message ID 20180730180428.30846-1-Nikita.Sobolev@synopsys.com
State New
Headers show
Series
  • [uclibc-ng-devel] Fix path to file libtest31.so
Related show

Commit Message

Nikita Sobolev July 30, 2018, 6:04 p.m.
From: Nikita Sobolev <sobolev@synopsys.com>

Test failed with error 'Could not open libtest31.so: File not found'.
dlopen function is trying to find libtest31.so in the same directory
where the test is run. But libtest31.so is lockated in testlib
directory. So fix changes the path to library.

Signed-off-by: Nikita Sobolev <Nikita.Sobolev@synopsys.com>
---
 test/dlopen/tst-origin.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Waldemar Brodkorb Aug. 16, 2018, 7:45 p.m. | #1
Hi Nikita,
Nikita Sobolev wrote,

> From: Nikita Sobolev <sobolev@synopsys.com>
> 
> Test failed with error 'Could not open libtest31.so: File not found'.
> dlopen function is trying to find libtest31.so in the same directory
> where the test is run. But libtest31.so is lockated in testlib
> directory. So fix changes the path to library.

But the test is not failing for ARM and other architectures, see:
https://downloads.uclibc-ng.org/reports/1.0.30/REPORT.armv6.libc.uClibc-ng-1.0.30

I think it might be an issue with ARC binutils and $ORIGIN handling.

best regards
 Waldemar

Patch

diff --git a/test/dlopen/tst-origin.c b/test/dlopen/tst-origin.c
index 60fcd3f..e456f1e 100644
--- a/test/dlopen/tst-origin.c
+++ b/test/dlopen/tst-origin.c
@@ -12,13 +12,13 @@  int main(int argc, char **argv) {
 	int __attribute__((unused))(*mydltest)(const char *s);
 	char *error;
 
-	h1 = dlopen ("libtest31.so", RTLD_LAZY);
+	h1 = dlopen ("testlib/libtest31.so", RTLD_LAZY);
 	if (!h1) {
 		fprintf(stderr, "Could not open libtest31.so: %s\n", dlerror());
 		exit(1);
 	}
 
-	h2 = dlopen ("libtest31.so", RTLD_NOLOAD);
+	h2 = dlopen ("testlib/libtest31.so", RTLD_NOLOAD);
 	if (!h2) {
 		fprintf(stderr, "Could not open libtest31.so(RTLD_NOLOAD): %s\n", dlerror());
 		exit(1);