unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: "H.J. Lu" <hjl.tools@gmail.com>
To: Gabi Falk <gabifalk@gmx.com>
Cc: libc-alpha@sourceware.org, Sam James <sam@gentoo.org>
Subject: Re: [PATCH] i686: Fix multiple definitions of __memmove_chk and __memset_chk
Date: Fri, 26 Apr 2024 07:17:59 -0700	[thread overview]
Message-ID: <CAMe9rOpkKVLYLEuD9XuTuezQoPBM-91su_uqWst3GQMBd=kLmQ@mail.gmail.com> (raw)
In-Reply-To: <20240426105001.699765-1-gabifalk@gmx.com>

On Fri, Apr 26, 2024 at 3:52 AM Gabi Falk <gabifalk@gmx.com> wrote:
>
> Commit c73c96a4a1af1326df7f96eec58209e1e04066d8 updated memcpy.S and
> mempcpy.S, but omitted memmove.S` and memset.S.  As a result, the
> static library built with enabled multiarch (the default) 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

Please include at least one testcase to verify the fix.

Thanks.

> Reported-by: Sam James <sam@gentoo.org>
> Fixes: c73c96a4a1 ("i686: Fix build with --disable-multiarch")
> Signed-off-by: Gabi Falk <gabifalk@gmx.com>
> ---
>  sysdeps/i386/i686/memmove.S | 2 +-
>  sysdeps/i386/i686/memset.S  | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/sysdeps/i386/i686/memmove.S b/sysdeps/i386/i686/memmove.S
> index f230359ad6..effd958120 100644
> --- a/sysdeps/i386/i686/memmove.S
> +++ b/sysdeps/i386/i686/memmove.S
> @@ -29,7 +29,7 @@
>  #define SRC    DEST+4
>  #define LEN    SRC+4
>
> -#if defined PIC && IS_IN (libc)
> +#if defined SHARED && IS_IN (libc)
>  ENTRY_CHK (__memmove_chk)
>         movl    12(%esp), %eax
>         cmpl    %eax, 16(%esp)
> diff --git a/sysdeps/i386/i686/memset.S b/sysdeps/i386/i686/memset.S
> index f02f5a6df7..ab06771ea0 100644
> --- a/sysdeps/i386/i686/memset.S
> +++ b/sysdeps/i386/i686/memset.S
> @@ -27,7 +27,7 @@
>  #define LEN    CHR+4
>
>          .text
> -#if defined PIC && IS_IN (libc)
> +#if defined SHARED && IS_IN (libc)
>  ENTRY_CHK (__memset_chk)
>         movl    12(%esp), %eax
>         cmpl    %eax, 16(%esp)
> --
> gabi
>


-- 
H.J.

  reply	other threads:[~2024-04-26 14:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-26 10:50 [PATCH] i686: Fix multiple definitions of __memmove_chk and __memset_chk Gabi Falk
2024-04-26 14:17 ` H.J. Lu [this message]
2024-04-27 16:42   ` [PATCH v2] " Gabi Falk
2024-04-28 14:18     ` H.J. Lu
2024-04-28 19:27     ` Florian Weimer
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

  List information: https://www.gnu.org/software/libc/involved.html

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

  git send-email \
    --in-reply-to='CAMe9rOpkKVLYLEuD9XuTuezQoPBM-91su_uqWst3GQMBd=kLmQ@mail.gmail.com' \
    --to=hjl.tools@gmail.com \
    --cc=gabifalk@gmx.com \
    --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).