diff mbox series

[7/7] libio: Disable stack protector for tst-fopen-compat with clang

Message ID 20241231182649.1811734-8-adhemerval.zanella@linaro.org
State New
Headers show
Series More fixes for building tests with clang | expand

Commit Message

Adhemerval Zanella Netto Dec. 31, 2024, 6:26 p.m. UTC
For aarch64, even with -fno-pie clang 18.1.3 seems to generate
non valid relocations:

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(+)

Comments

H.J. Lu Dec. 31, 2024, 9:10 p.m. UTC | #1
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
>
diff mbox series

Patch

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	\