[PATCH 7/7] libio: Disable stack protector for tst-fopen-compat with clang
H.J. Lu
hjl.tools@gmail.com
Tue Dec 31 21:10:24 GMT 2024
On Wed, Jan 1, 2025 at 2:27 AM Adhemerval Zanella
<adhemerval.zanella@linaro.org> wrote:
>
> For aarch64, even with -fno-pie clang 18.1.3 seems to generate
> non valid relocations:
Please open a Clang issue and add a reference to it.
>
> tst-fopen-compat.o(.text+0xc): unresolvable R_AARCH64_ADR_PREL_PG_HI21 relocation against symbol `__stack_chk_guard@@GLIBC_2.17'
>
> Disable stack protection in this case.
> ---
> libio/Makefile | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/libio/Makefile b/libio/Makefile
> index 3b5adff74d..98f626a4c8 100644
> --- a/libio/Makefile
> +++ b/libio/Makefile
> @@ -313,6 +313,9 @@ tst-fopen-compat-ARGS = tst-fopen-compat.c
> # Disable PIE to trigger copy relocation.
> CFLAGS-tst-fopen-compat.c += -fno-pie
> tst-fopen-compat-no-pie = yes
> +ifeq ($(have-test-clang),yes)
> +CFLAGS-tst-fopen-compat.c += $(no-stack-protector)
> +endif
> endif
>
> shared-only-routines = oldiofopen oldiofdopen oldiofclose oldfileops \
> --
> 2.43.0
>
--
H.J.
More information about the Libc-alpha
mailing list