[glibc] thp: Link THP PDE tests with $(LOAD-THP-ADDRESS-LDFLAGS)

"H.J. Lu via Glibc-cvs" <[email protected]> Wed, 15 Jul 2026 11:20:36 +0000 (GMT)
Newsgroups gmane.comp.lib.glibc.cvs
Message-ID <[email protected]>
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=81ae8211135d380d9938ed81c80ba5644a7a03c7

commit 81ae8211135d380d9938ed81c80ba5644a7a03c7
Author: H.J. Lu <[email protected]>
Date:   Sat Jul 4 13:32:10 2026 +0800

    thp: Link THP PDE tests with $(LOAD-THP-ADDRESS-LDFLAGS)
    
    LOAD-THP-ADDRESS-LDFLAGS was added to work around:
    
    https://sourceware.org/bugzilla/show_bug.cgi?id=34184
    
    which is needed for THP PDE tests.  Add $(LOAD-THP-ADDRESS-LDFLAGS) to
    LDFLAGS-tst-thp-1 and LDFLAGS-tst-thp-1-no-s-code if PIE isn't built
    by default so that they are linked with $(LOAD-THP-ADDRESS-LDFLAGS).
    This fixes BZ #34314.
    
    Signed-off-by: H.J. Lu <[email protected]>

Diff:
---
 sysdeps/unix/sysv/linux/Makefile | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
index 56b160e253..14a56d5cc3 100644
--- a/sysdeps/unix/sysv/linux/Makefile
+++ b/sysdeps/unix/sysv/linux/Makefile
@@ -770,6 +770,9 @@ test-xfail-tst-thp-1-no-s-code-static = yes
 endif
 
 LDFLAGS-tst-thp-1 = -Wl,-z,separate-code $(THP-PAGE-SIZE-LDFLAGS)
+ifneq (yes,$(build-pie-default))
+LDFLAGS-tst-thp-1 += $(LOAD-THP-ADDRESS-LDFLAGS)
+endif
 LDFLAGS-tst-thp-1-pde = -Wl,-z,separate-code $(THP-PAGE-SIZE-LDFLAGS) \
 			$(LOAD-THP-ADDRESS-LDFLAGS)
 LDFLAGS-tst-thp-1-static = -Wl,-z,separate-code $(THP-PAGE-SIZE-LDFLAGS)
@@ -778,6 +781,9 @@ LDFLAGS-tst-thp-1-static += $(LOAD-THP-ADDRESS-LDFLAGS)
 endif
 LDFLAGS-tst-thp-1-no-s-code = -Wl,-z,noseparate-code \
 			      $(THP-PAGE-SIZE-LDFLAGS)
+ifneq (yes,$(build-pie-default))
+LDFLAGS-tst-thp-1-no-s-code += $(LOAD-THP-ADDRESS-LDFLAGS)
+endif
 LDFLAGS-tst-thp-1-no-s-code-pde = -Wl,-z,noseparate-code \
 				  $(THP-PAGE-SIZE-LDFLAGS) \
 				  $(LOAD-THP-ADDRESS-LDFLAGS)