From 5f245f3bfbe61b2182964dafb94907e38284b806 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Tue, 30 Apr 2024 09:57:12 -0700 Subject: Add crt1-2.0.o for glibc 2.0 compatibility tests Starting from glibc 2.1, crt1.o contains _IO_stdin_used which is checked by _IO_check_libio to provide binary compatibility for glibc 2.0. Add crt1-2.0.o for tests against glibc 2.0. Define tests-2.0 for glibc 2.0 compatibility tests. Add and update glibc 2.0 compatibility tests for stderr, matherr and pthread_kill. Reviewed-by: Carlos O'Donell --- Makeconfig | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'Makeconfig') diff --git a/Makeconfig b/Makeconfig index e583765712..61ff1d0d9b 100644 --- a/Makeconfig +++ b/Makeconfig @@ -360,6 +360,8 @@ whole-archive = -Wl,--whole-archive # Installed name of the startup code. # The ELF convention is that the startfile is called crt1.o start-installed-name = crt1.o +# Similar to crt1.o, but without _IO_stdin_used. +start-name-2.0 = crt1-2.0.o # On systems that do not need a special startfile for statically linked # binaries, simply set it to the normal name. ifndef static-start-installed-name @@ -537,6 +539,25 @@ else # build-static endif # build-shared endif # +link +# Command for linking test programs with crt1.o from glibc 2.0. ++link-2.0-before-inputs = -nostdlib -nostartfiles $(no-pie-ldflag) \ + $(sysdep-LDFLAGS) $(LDFLAGS) $(LDFLAGS-$(@F)) \ + $(relro-LDFLAGS) $(hashstyle-LDFLAGS) \ + $(firstword $(CRT-$(@F)) $(csu-objpfx)$(start-name-2.0)) \ + $(+preinit) $(+prector) ++link-2.0-before-libc = -o $@ $(+link-2.0-before-inputs) \ + $(filter-out $(addprefix $(csu-objpfx),start.o \ + $(start-name-2.0))\ + $(+preinit) $(link-extra-libs) \ + $(common-objpfx)libc% $(+postinit),$^) \ + $(link-extra-libs) ++link-after-libc = $(+postctor) $(+postinit) +define +link-2.0-tests +$(CC) $(+link-2.0-before-libc) $(rtld-tests-LDFLAGS) $(link-libc-tests) \ + $(+link-after-libc) +$(call after-link,$@) +endef + # The pretty printer test programs need to be compiled without optimizations # so they won't confuse gdb. We could use either the 'GCC optimize' pragma # or the 'optimize' function attribute to achieve this; however, at least on -- cgit v1.2.3