[PATCH] ld.so: command argument "--preload"

Florian Weimer fweimer@redhat.com
Thu Nov 8 10:54:00 GMT 2018


* David Newall:

> On 8/11/18 12:36 am, Florian Weimer wrote:
>> preloadtest.out has this:
>>
>> $(objpfx)preloadtest.out: $(preloadtest-preloads:%=$(objpfx)%.so)
>> preloadtest-ENV = \
>>    LD_PRELOAD=$(subst $(empty) ,:,$(strip $(preloadtest-preloads:=.so)))
>>
>> So I think you should add $(preloadtest-preloads:%=$(objpfx)%.so) as
>> well.
>
> Oh, I see, yes, you are right.  Interesting that preloadtest.out does
> not depend on preloadtest.
>
> This is a disincentive to use of $^ in the recipe. It should be like this?
>
> tst-rtld-preload-OBJS = $(subst $(empty) ,:,$(strip $(preloadtest-preloads:=.so)))
> $(objpfx)tst-rtld-preload.out: tst-rtld-preload.sh $(objpfx)ld.so \
>                                $(objpfx)preloadtest \
>                                $(preloadtest-preloads:%=$(objpfx)%.so)
>         $(SHELL) $< $(objpfx)ld.so $(objpfx)preloadtest \
>                     '$(test-wrapper)' '$(test-wrapper-env)' '$(run_program_env)' \
>                     '$(rpath-link)' '$(tst-rtld-preload-OBJS)' > $@; \
>         $(evaluate-test)
>
> (or be explicit instead of $<)

Yes, you will have to use $<.  I do not have a strong preference ($< vs
tst-rtld-preload.sh).  The test runs in the source tree, so both are
okay.

Thanks,
Florian



More information about the Libc-alpha mailing list