From 39183f47d8bc9eda711c9797b18d69d7a02af91c Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Wed, 8 Jan 2025 16:55:31 +0100 Subject: [PATCH] elf: Minimize library dependencies of tst-nolink-libc.c On 32-bit Arm, -fasynchronous-unwind-tables creates a reference to the symbol __aeabi_unwind_cpp_pr0. Compile the tests without this flag even if it is passed as part of CC, to avoid linker failures. --- elf/Makefile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/elf/Makefile b/elf/Makefile index 8f11c04d7e..048878d602 100644 --- a/elf/Makefile +++ b/elf/Makefile @@ -3377,8 +3377,10 @@ endif # a port adds them to the tests variables. Neither test variant is # linked against libc.so, but tst-nolink-libc-1 is linked against # ld.so. The test is always run directly, not under the dynamic -# linker. -CFLAGS-tst-nolink-libc.c += $(no-stack-protector) +# linker. It is necessary to minimize run-time dependencies, by +# disabling stack protection and unwinding. +CFLAGS-tst-nolink-libc.c += $(no-stack-protector) \ + -fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables $(objpfx)tst-nolink-libc-1: $(objpfx)tst-nolink-libc.o $(objpfx)ld.so $(LINK.o) -nostdlib -nostartfiles -o $@ $< \ -Wl,--dynamic-linker=$(objpfx)ld.so,--no-as-needed $(objpfx)ld.so -- 2.47.2