]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Add a test to check for duplicate definitions in the static library
authorGabi Falk <gabifalk@gmx.com>
Tue, 30 Apr 2024 20:05:04 +0000 (20:05 +0000)
committerSam James <sam@gentoo.org>
Thu, 2 May 2024 10:51:23 +0000 (11:51 +0100)
This change follows two previous fixes addressing multiple definitions
of __memcpy_chk and __mempcpy_chk functions on i586, and __memmove_chk
and __memset_chk functions on i686.  The test is intended to prevent
such issues from occurring in the future.

Signed-off-by: Gabi Falk <gabifalk@gmx.com>
Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Dmitry V. Levin <ldv@altlinux.org>
Makefile

index b5ef98fb041eccfe402611d6dbc2e26f0ea5764b..adf47491240b85ef2193823072b6ce5e500ccc5f 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -577,6 +577,13 @@ $(objpfx)lint-makefiles.out: scripts/lint-makefiles.sh
        $(SHELL) $< "$(PYTHON)" `pwd` > $@ ; \
        $(evaluate-test)
 
+# Link libc.a as a whole to verify that it does not contain multiple
+# definitions of any symbols.
+tests-special += $(objpfx)link-static-libc.out
+$(objpfx)link-static-libc.out:
+       $(LINK.o) $(whole-archive) -r $(objpfx)libc.a -o /dev/null > $@ 2>&1; \
+       $(evaluate-test)
+
 # Print test summary for tests in $1 .sum file;
 # $2 is optional test identifier.
 # Fail if there are unexpected failures in the test results.