aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2025-03-18 16:10:05 -0300
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2025-03-18 16:10:05 -0300
commit5291d9f1e274dd869bc0b3d044fd4cbae486893d (patch)
treed29bb83438e1984c7a84222b8a7a71903bfe11e3
parentcf56eb28fa277d9dbb301654682ca89f71c30a48 (diff)
downloadglibc-5291d9f1e274dd869bc0b3d044fd4cbae486893d.zip
glibc-5291d9f1e274dd869bc0b3d044fd4cbae486893d.tar.gz
glibc-5291d9f1e274dd869bc0b3d044fd4cbae486893d.tar.bz2
elf: Fix tst-origin make rules
The tst-origin build can fail with: /usr/bin/ld: [...]libc.so: undefined reference to `__tunable_is_initialized@GLIBC_PRIVATE' Since the custom link invocation links against system glibc instead of the built one. The only requirement is to avoid liborigin.so linked with a full path, which is the default for --enable-hardcoded-path-in-tests. There is no need to use a custom rule. Checked on x86_64-linux-gnu.
-rw-r--r--elf/Makefile13
1 files changed, 3 insertions, 10 deletions
diff --git a/elf/Makefile b/elf/Makefile
index 5a50c7d..3d60000 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -456,6 +456,7 @@ tests += \
tst-noload \
tst-non-directory-path \
tst-null-argv \
+ tst-origin \
tst-p_align1 \
tst-p_align2 \
tst-p_align3 \
@@ -1195,7 +1196,6 @@ extra-test-objs += $(addsuffix .os,$(strip $(modules-names)))
# filtmod1.so, tst-big-note-lib.so, tst-ro-dynamic-mod.so have special
# rules.
modules-names-nobuild += \
- liborigin-mod \
filtmod1 \
tst-audit24bmod1 \
tst-audit24bmod2 \
@@ -3451,15 +3451,8 @@ $(objpfx)tst-dlopen-constructor-null-mod2.so: \
CFLAGS-tst-origin.c += $(no-stack-protector)
CFLAGS-liborigin-mod.c += $(no-stack-protector)
-$(objpfx)tst-origin: $(objpfx)tst-origin.o $(objpfx)liborigin-mod.so
- $(LINK.o) -o $@ -B$(csu-objpfx) $(LDFLAGS.so) $< \
- -Wl,-rpath,\$$ORIGIN \
- -L$(subst :, -L,$(rpath-link)) -Wl,--no-as-needed -lorigin-mod
-$(objpfx)liborigin-mod.so: $(objpfx)liborigin-mod.os
- $(LINK.o) -shared -o $@ -B$(csu-objpfx) $(LDFLAGS.so) \
- $(LDFLAGS-soname-fname) \
- $<
-$(objpfx)tst-origin.out: tst-origin.sh $(objpfx)tst-origin
+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
$(SHELL) \
$< \
'$(common-objpfx)' \