public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Florian Weimer <fweimer@redhat.com>
To: Gabi Falk <gabifalk@gmx.com>
Cc: "H.J. Lu" <hjl.tools@gmail.com>,
	 libc-alpha@sourceware.org,  "Dmitry V. Levin" <ldv@altlinux.org>,
	 Sam James <sam@gentoo.org>
Subject: Re: [PATCH v2] i686: Fix multiple definitions of __memmove_chk and __memset_chk
Date: Sun, 28 Apr 2024 21:27:47 +0200	[thread overview]
Message-ID: <87mspdz3rg.fsf@oldenburg.str.redhat.com> (raw)
In-Reply-To: <20240427164229.1778534-1-gabifalk@gmx.com> (Gabi Falk's message of "Sat, 27 Apr 2024 16:42:27 +0000")

* Gabi Falk:

> Commit c73c96a4a1af1326df7f96eec58209e1e04066d8 updated memcpy.S and
> mempcpy.S, but omitted memmove.S and memset.S.  As a result, the
> static library built contains two definitions for each of the
> __memmove_chk and __memset_chk symbols.
>
> /usr/lib/gcc/i686-pc-linux-gnu/14/../../../../i686-pc-linux-gnu/bin/ld: /usr/lib/gcc/i686-pc-linux-gnu/14/../../../../lib/libc.a(memset-ia32.o): in function `__memset_chk':
> /var/tmp/portage/sys-libs/glibc-2.39-r3/work/glibc-2.39/string/../sysdeps/i386/i686/memset.S:32: multiple definition of `__memset_chk'; /usr/lib/gcc/i686-pc-linux-gnu/14/../../../../lib/libc.a(memset_chk.o):/var/tmp/portage/sys-libs/glibc-2.39-r3/work/glibc-2.39/debug/../sysdeps/i386/i686/multiarch/memset_chk.c:24: first defined here

> diff --git a/Makefile b/Makefile
> index 7052b46df8..2e351c0321 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)
> +

I do like the new test, but it still fails on i586-linux-gnu (as defined
by scripts/build-many-glibs.py):

/home/bmg/install/compilers/x86_64-linux-gnu/lib/gcc/x86_64-glibc-linux-gnu/13.2.1/../../../../x86_64-glibc-linux-gnu/bin/ld: /home/bmg/build/glibcs/i586-linux-gnu/glibc/libc.a(memcpy_chk.o): in function `__memcpy_chk':
/home/bmg/src/glibc/debug/../sysdeps/i386/memcpy_chk.S:29: multiple definition of `__memcpy_chk'; /home/bmg/build/glibcs/i586-linux-gnu/glibc/libc.a(memcpy.o):/home/bmg/src/glibc/string/../sysdeps/i386/i586/memcpy.S:31: first defined here
/home/bmg/install/compilers/x86_64-linux-gnu/lib/gcc/x86_64-glibc-linux-gnu/13.2.1/../../../../x86_64-glibc-linux-gnu/bin/ld: /home/bmg/build/glibcs/i586-linux-gnu/glibc/libc.a(mempcpy_chk.o): in function `__mempcpy_chk':
/home/bmg/src/glibc/debug/../sysdeps/i386/mempcpy_chk.S:28: multiple definition of `__mempcpy_chk'; /home/bmg/build/glibcs/i586-linux-gnu/glibc/libc.a(mempcpy.o):/home/bmg/src/glibc/string/../sysdeps/i386/i586/memcpy.S:31: first defined here

Florian


  parent reply	other threads:[~2024-04-28 19:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-26 10:50 [PATCH] " Gabi Falk
2024-04-26 14:17 ` H.J. Lu
2024-04-27 16:42   ` [PATCH v2] " Gabi Falk
2024-04-28 14:18     ` H.J. Lu
2024-04-28 19:27     ` Florian Weimer [this message]
2024-04-29 23:29       ` Dmitry V. Levin

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=87mspdz3rg.fsf@oldenburg.str.redhat.com \
    --to=fweimer@redhat.com \
    --cc=gabifalk@gmx.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).