public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Gabi Falk <gabifalk@gmx.com>
To: libc-alpha@sourceware.org, "H.J. Lu" <hjl.tools@gmail.com>,
	Florian Weimer <fweimer@redhat.com>,
	"Dmitry V. Levin" <ldv@altlinux.org>, Sam James <sam@gentoo.org>
Cc: Gabi Falk <gabifalk@gmx.com>
Subject: [PATCH 3/3] Add a test to check for duplicate definitions in the static library
Date: Tue, 30 Apr 2024 20:05:04 +0000	[thread overview]
Message-ID: <20240430200506.2717717-4-gabifalk@gmx.com> (raw)
In-Reply-To: <20240430200506.2717717-1-gabifalk@gmx.com>

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>
---
 Makefile | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/Makefile b/Makefile
index b5ef98fb04..adf4749124 100644
--- 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.
--
gabi


  parent reply	other threads:[~2024-04-30 20:05 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-30 20:05 [PATCH 0/3] i586/i686: Fix multiple definitions in libc.a Gabi Falk
2024-04-30 20:05 ` [PATCH 1/3] i586: Fix multiple definitions of __memcpy_chk and __mempcpy_chk Gabi Falk
2024-04-30 20:11   ` H.J. Lu
2024-04-30 20:05 ` [PATCH 2/3] i686: Fix multiple definitions of __memmove_chk and __memset_chk Gabi Falk
2024-04-30 20:12   ` H.J. Lu
2024-04-30 20:05 ` Gabi Falk [this message]
2024-04-30 20:12   ` [PATCH 3/3] Add a test to check for duplicate definitions in the static library H.J. Lu
2024-05-01  0:01 ` [PATCH 0/3] i586/i686: Fix multiple definitions in libc.a Dmitry V. Levin
2024-05-02 10:52 ` Sam James

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240430200506.2717717-4-gabifalk@gmx.com \
    --to=gabifalk@gmx.com \
    --cc=fweimer@redhat.com \
    --cc=hjl.tools@gmail.com \
    --cc=ldv@altlinux.org \
    --cc=libc-alpha@sourceware.org \
    --cc=sam@gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).