unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Fix test isolation for elf/tst-ifunc-fault-lazy, elf/tst-ifunc-fault-bindnow
@ 2019-12-19 14:35 Florian Weimer
  2019-12-19 14:47 ` Andreas Schwab
  0 siblings, 1 reply; 4+ messages in thread
From: Florian Weimer @ 2019-12-19 14:35 UTC (permalink / raw
  To: libc-alpha

Previously, ld.so was invoked only with the elf subdirectory on the
library search path.  Since the soname link for libc.so only exists in
the top-level build directory, this leaked the system libc into the
test.

-----
 elf/Makefile | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/elf/Makefile b/elf/Makefile
index 72a5aa88b1..2c52e8ae19 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -1374,11 +1374,13 @@ $(objpfx)ifuncmain5picstatic: $(addprefix $(objpfx),ifuncdep5pic.o)
 
 LDFLAGS-tst-ifunc-fault-lazy = -Wl,-z,lazy
 LDFLAGS-tst-ifunc-fault-bindnow = -Wl,-z,now
+tst-ifunc-fault-script-ldso = \
+  $(objpfx)ld.so --library-path $(common-objpfx):$(objpfx)
 define tst-ifunc-fault-script
-( $(objpfx)ld.so --verify --library-path  $(objpfx) $^ \
-  && LD_TRACE_LOADED_OBJECTS=1 $(objpfx)ld.so --library-path $(objpfx) $^ \
+( $(tst-ifunc-fault-script-ldso) --verify $^ \
+  && LD_TRACE_LOADED_OBJECTS=1 $(tst-ifunc-fault-script-ldso) $^ \
   && LD_TRACE_LOADED_OBJECTS=1 LD_DEBUG=unused \
-    $(objpfx)ld.so --library-path  $(objpfx) $^ \
+    $(tst-ifunc-fault-script-ldso) $^ \
 ) > $@; $(evaluate-test)
 endef
 $(objpfx)tst-ifunc-fault-lazy.out: $(objpfx)tst-ifunc-fault-lazy $(objpfx)ld.so


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] Fix test isolation for elf/tst-ifunc-fault-lazy, elf/tst-ifunc-fault-bindnow
  2019-12-19 14:35 [PATCH] Fix test isolation for elf/tst-ifunc-fault-lazy, elf/tst-ifunc-fault-bindnow Florian Weimer
@ 2019-12-19 14:47 ` Andreas Schwab
  2019-12-19 15:08   ` Florian Weimer
  0 siblings, 1 reply; 4+ messages in thread
From: Andreas Schwab @ 2019-12-19 14:47 UTC (permalink / raw
  To: Florian Weimer; +Cc: libc-alpha

On Dez 19 2019, Florian Weimer wrote:

> diff --git a/elf/Makefile b/elf/Makefile
> index 72a5aa88b1..2c52e8ae19 100644
> --- a/elf/Makefile
> +++ b/elf/Makefile
> @@ -1374,11 +1374,13 @@ $(objpfx)ifuncmain5picstatic: $(addprefix $(objpfx),ifuncdep5pic.o)
>  
>  LDFLAGS-tst-ifunc-fault-lazy = -Wl,-z,lazy
>  LDFLAGS-tst-ifunc-fault-bindnow = -Wl,-z,now
> +tst-ifunc-fault-script-ldso = \
> +  $(objpfx)ld.so --library-path $(common-objpfx):$(objpfx)

How about using rtld-prefix?

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Fix test isolation for elf/tst-ifunc-fault-lazy, elf/tst-ifunc-fault-bindnow
  2019-12-19 14:47 ` Andreas Schwab
@ 2019-12-19 15:08   ` Florian Weimer
  2019-12-19 15:20     ` Andreas Schwab
  0 siblings, 1 reply; 4+ messages in thread
From: Florian Weimer @ 2019-12-19 15:08 UTC (permalink / raw
  To: Andreas Schwab; +Cc: libc-alpha

* Andreas Schwab:

> On Dez 19 2019, Florian Weimer wrote:
>
>> diff --git a/elf/Makefile b/elf/Makefile
>> index 72a5aa88b1..2c52e8ae19 100644
>> --- a/elf/Makefile
>> +++ b/elf/Makefile
>> @@ -1374,11 +1374,13 @@ $(objpfx)ifuncmain5picstatic: $(addprefix $(objpfx),ifuncdep5pic.o)
>>  
>>  LDFLAGS-tst-ifunc-fault-lazy = -Wl,-z,lazy
>>  LDFLAGS-tst-ifunc-fault-bindnow = -Wl,-z,now
>> +tst-ifunc-fault-script-ldso = \
>> +  $(objpfx)ld.so --library-path $(common-objpfx):$(objpfx)
>
> How about using rtld-prefix?

Thanks, it seems to work, even --enable-hardcoded-path-in-tets.

Florian

8<------------------------------------------------------------------8<
Previously, ld.so was invoked only with the elf subdirectory on the
library search path.  Since the soname link for libc.so only exists in
the top-level build directory, this leaked the system libc into the
test.

---
 elf/Makefile | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/elf/Makefile b/elf/Makefile
index 72a5aa88b1..f861126b2f 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -1375,10 +1375,9 @@ $(objpfx)ifuncmain5picstatic: $(addprefix $(objpfx),ifuncdep5pic.o)
 LDFLAGS-tst-ifunc-fault-lazy = -Wl,-z,lazy
 LDFLAGS-tst-ifunc-fault-bindnow = -Wl,-z,now
 define tst-ifunc-fault-script
-( $(objpfx)ld.so --verify --library-path  $(objpfx) $^ \
-  && LD_TRACE_LOADED_OBJECTS=1 $(objpfx)ld.so --library-path $(objpfx) $^ \
-  && LD_TRACE_LOADED_OBJECTS=1 LD_DEBUG=unused \
-    $(objpfx)ld.so --library-path  $(objpfx) $^ \
+( $(rtld-prefix) --verify $^ \
+  && LD_TRACE_LOADED_OBJECTS=1 $(rtld-prefix) $^ \
+  && LD_TRACE_LOADED_OBJECTS=1 LD_DEBUG=unused $(rtld-prefix) $^ \
 ) > $@; $(evaluate-test)
 endef
 $(objpfx)tst-ifunc-fault-lazy.out: $(objpfx)tst-ifunc-fault-lazy $(objpfx)ld.so


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] Fix test isolation for elf/tst-ifunc-fault-lazy, elf/tst-ifunc-fault-bindnow
  2019-12-19 15:08   ` Florian Weimer
@ 2019-12-19 15:20     ` Andreas Schwab
  0 siblings, 0 replies; 4+ messages in thread
From: Andreas Schwab @ 2019-12-19 15:20 UTC (permalink / raw
  To: Florian Weimer; +Cc: libc-alpha

On Dez 19 2019, Florian Weimer wrote:

> Previously, ld.so was invoked only with the elf subdirectory on the
> library search path.  Since the soname link for libc.so only exists in
> the top-level build directory, this leaked the system libc into the
> test.

Ok.

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-12-19 15:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-12-19 14:35 [PATCH] Fix test isolation for elf/tst-ifunc-fault-lazy, elf/tst-ifunc-fault-bindnow Florian Weimer
2019-12-19 14:47 ` Andreas Schwab
2019-12-19 15:08   ` Florian Weimer
2019-12-19 15:20     ` Andreas Schwab

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).