From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yw1-x112f.google.com (mail-yw1-x112f.google.com [IPv6:2607:f8b0:4864:20::112f]) by sourceware.org (Postfix) with ESMTPS id 2BBDF3858C60 for ; Fri, 26 Apr 2024 14:18:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2BBDF3858C60 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 2BBDF3858C60 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::112f ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1714141117; cv=none; b=jr6hCYvUzylHBpkdfSKU530XD4a94cdhQU5bM3QkJKCftEpnCUEwHYjLQeFo3YscJ3tAkbV1pbLDcZijxzQ7hticccr87ILc2/IL9AkqDSwUAYFjSWlu6bfQHHi5QpUWYzg6T6ZmqNbpJY74mEfwPX9aWnnFyufliISC1JebX7g= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1714141117; c=relaxed/simple; bh=L1oUFkmOEteUYuB5IFK4Ni8h6mdcYDt7Bx1pvC758d4=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=l785IWPHAvfzMIC0istOxyZIgJlUZn6tiK+ULQoX7Jnoz6eYCe2tKAnkugkb4nBy/an5iVxXdTW/ptDHCgdJUlqoZ1W8CieK/CCoWhgNIUEu9rxB2LNiJ2R/awPSieEj/rG7d5Llppcs7s8kJRuWfvxGisYljTaWMANmA0z7MNQ= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-yw1-x112f.google.com with SMTP id 00721157ae682-61b3be24dd9so18323017b3.0 for ; Fri, 26 Apr 2024 07:18:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714141115; x=1714745915; darn=sourceware.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=yQF+NJOU6a8vDrePccTuQjkzi/vapWGxLdJww8nMtuc=; b=VEZr5jXuwnEk7w0vYI8yc9TXfF3RcblSthZ0dcOZ05+GlyeF7p9C5YUU3Tt3C3syUy QfIcTpPrujF6VMC03Lb40j+hQEN+2LPsBB9gc1CqG9J1jh5cmkpiWGMu9SZ1i7uQaBeu Py8EYFi79ts9DBUropA/b53VBEkpihNMSr6WQMf6zO3AY94BMy5WdrVFlRHw+wLXmoDr yjBPS6tyeG428ArzttNPQvgr4sylZb3RsNZLMwWT7i59QY/ESLRzzBCNiBqMtipre7Xm V691heX+AVDeF9V6hqJrOHb0DizKHunetzxNmXQRLK4xlZEVfWHCSJtev9YYmtOUQgUl vWiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714141115; x=1714745915; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=yQF+NJOU6a8vDrePccTuQjkzi/vapWGxLdJww8nMtuc=; b=khZJQaYop2734uoYvxbWEGAGS+uIZp9EFXcy9S0+DKRF0gtoT+rNln7pgGALWrVJAw RHeNwxfyhHl3B9Mv5i8gG7lJrHJvA0H+TLLCUd2ZskDrqQ2xTh/A8dcDciBhA3C2YdA4 OwlqgQ3dESDjZKpSaPGaWjRhZGH3JeX8KLcV0R6pKQRFQEYS+sdnZ2wCkaEf118dNKQS BJZXhSJas3eifvHvaunQu2nlW4GAO2jDSrURLU2ZLr3/l3eDEkxvA2LhZmAwwP35GzMZ EMCz8QVW5MYFNuPOSGwPo1B/PFELs8LH2+zxfJSSnG3j5LhQHqV1kUjnrnI+44y/jMsh 1gqw== X-Gm-Message-State: AOJu0YyE19IqZfBzdb5o4ZnHeyFxJPKE9V2AveDE3sNntcl3j87VKJ2v A4ZF2+/3ortbK2E8M8g0mmLT+lmo/FxCISltw00m6Xs13rC+aO4VVFDiKgtTEflkbrD6nn0YYWn itbHqtz1QDcOrSm/U83iI7qds6uTCew== X-Google-Smtp-Source: AGHT+IH5H7a+3EHmI7/9skhWCZNNMqmTQ0HIkueKAdz/GB932OuQPSKmwwWKc52NS9VYc6hoZNBVfmxAv4wff2WsMYI= X-Received: by 2002:a81:6e56:0:b0:615:73f:d52d with SMTP id j83-20020a816e56000000b00615073fd52dmr4677041ywc.17.1714141115467; Fri, 26 Apr 2024 07:18:35 -0700 (PDT) MIME-Version: 1.0 References: <20240426105001.699765-1-gabifalk@gmx.com> In-Reply-To: <20240426105001.699765-1-gabifalk@gmx.com> From: "H.J. Lu" Date: Fri, 26 Apr 2024 07:17:59 -0700 Message-ID: Subject: Re: [PATCH] i686: Fix multiple definitions of __memmove_chk and __memset_chk To: Gabi Falk Cc: libc-alpha@sourceware.org, Sam James Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-3019.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Fri, Apr 26, 2024 at 3:52=E2=80=AFAM Gabi Falk 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/multiarc= h/memset_chk.c:24: first defined here Please include at least one testcase to verify the fix. Thanks. > Reported-by: Sam James > Fixes: c73c96a4a1 ("i686: Fix build with --disable-multiarch") > Signed-off-by: Gabi Falk > --- > 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 > --=20 H.J.