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

Adhemerval Zanella adhemerval.zanella@linaro.org
Tue Dec 31 18:26:13 GMT 2024


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

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



More information about the Libc-alpha mailing list