From 2f8e8c9cb72c0f479bd4f9249ef681fe4f36d280 Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Fri, 21 Mar 2025 21:40:28 +0100 Subject: [PATCH] elf: Use +nolink-deps to add make-only dependency for tst-origin The tst-origin test must link against liborigin-mod.so. Correct build order depends on a makefile rule dependency on $(objpfx)liborigin-mod.so. Use +nolink-deps to remvoe this dependency from the linker command line. Reviewed-by: Adhemerval Zanella --- elf/Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/elf/Makefile b/elf/Makefile index 5566d39dac..1282a5bffb 100644 --- a/elf/Makefile +++ b/elf/Makefile @@ -3452,8 +3452,11 @@ $(objpfx)tst-dlopen-constructor-null-mod2.so: \ CFLAGS-tst-origin.c += $(no-stack-protector) CFLAGS-liborigin-mod.c += $(no-stack-protector) +# Link tst-origin with liborigin-mod.so, but without a full path. LDFLAGS-tst-origin += -Wl,-rpath,\$$ORIGIN -L$(subst :, -L,$(rpath-link)) -lorigin-mod -$(objpfx)tst-origin.out: tst-origin.sh $(objpfx)liborigin-mod.so $(objpfx)tst-origin +$(objpfx)tst-origin: +nolink-deps += $(objpfx)liborigin-mod.so +$(objpfx)tst-origin: $(objpfx)liborigin-mod.so +$(objpfx)tst-origin.out: tst-origin.sh $(objpfx)tst-origin $(SHELL) \ $< \ '$(common-objpfx)' \