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

Adhemerval Zanella Netto <[email protected]>
Newsgroups gmane.comp.lib.glibc.alpha
Organization Linaro
Message-ID <[email protected]>

On 04/07/26 18:41, H.J. Lu wrote:
> 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.
> 
> 
> From 9eb3c69bac0fdfb4e71b2594d0488774e212c5e3 Mon Sep 17 00:00:00 2001
> From: "H.J. Lu" <[email protected]>
> Date: Sat, 4 Jul 2026 13:32:10 +0800
> Subject: [PATCH] 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]>

LGTM, thanks.  For $(build-pie-default)==no tst-thp-1 and tst-thp-1-pde
are essentially the same so maybe only build one in this scenario.

Reviewed-by: Adhemerval Zanella  <[email protected]>

> ---
>  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 1efeac5213..0f8fc24b1f 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)
> -- 
> 2.54.0
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.