]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
elf: Minimize library dependencies of tst-nolink-libc.c
authorFlorian Weimer <fweimer@redhat.com>
Wed, 8 Jan 2025 15:55:31 +0000 (16:55 +0100)
committerFlorian Weimer <fweimer@redhat.com>
Wed, 8 Jan 2025 15:55:31 +0000 (16:55 +0100)
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

index 8f11c04d7e38cc46d18f6c942e73ce3c6aabdcc7..048878d602b48a76c7d95454b7e76f7b63c7d3b3 100644 (file)
@@ -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