From nobody Sat Mar 12 16:35:16 2022 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 594191A0EA90; Sat, 12 Mar 2022 16:35:28 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4KG7hJ1thHz4bhy; Sat, 12 Mar 2022 16:35:28 +0000 (UTC) (envelope-from kevans@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1647102928; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=18OLDn0OWlLbTUpsyBwAG3smAVXGnAcX0CCjZ26IHsk=; b=rmSavcoL7R8bvnlZtLh6uVSUZc0W1F8us827ixh1PyI73OBsBTHgzjFh5sToOgQ9WEDkeE 85KYWuuSptT1z24PMyKkNc6nTYxL0wBjD8jG4XgibGeqs4+Z2+qP+E1vuwVWJsJ7q2V3PP C9HI+lFQAgCINTzuIAlN37Gdf1o1V+39yvfVXmhXY1J09R9zU5xt/1MNdnVjFPtHVzaybL F9K4hw5/FsmNBXBbYZAxrpzRPr7QpvqrrVMxSba69Qz9PhM9WPZf91anUTWCXL48ZUe5ky nbWJqSqkkSt9mPMFcoqm44PPeI+cHIRjBJ1ICIC9+jqlv3z+g0eJ0fxXK2GJnQ== Received: from mail-qk1-f175.google.com (mail-qk1-f175.google.com [209.85.222.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 1C33AAC00; Sat, 12 Mar 2022 16:35:28 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qk1-f175.google.com with SMTP id v13so8952386qkv.3; Sat, 12 Mar 2022 08:35:28 -0800 (PST) X-Gm-Message-State: AOAM532YxWRrnIVBNadfWLZ0WzwNXBg7afOwMNqq//XVokenPA4blKE/ kq+pxAyBhhCwrWvKUwdDm5FAeCuuXqkYmphn+6U= X-Google-Smtp-Source: ABdhPJwWXbuWhxtshV8kpZYvMmQSuAzWXM74XfiNhx9/gBoq9EoI6/kfye/Wk2QsJUY3K39lzi/Qgi9IXZjNYb8AcN8= X-Received: by 2002:a05:620a:4142:b0:67b:21fe:918b with SMTP id k2-20020a05620a414200b0067b21fe918bmr10016757qko.708.1647102927669; Sat, 12 Mar 2022 08:35:27 -0800 (PST) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 References: <202203121459.22CExLoW093599@gitrepo.freebsd.org> In-Reply-To: <202203121459.22CExLoW093599@gitrepo.freebsd.org> From: Kyle Evans Date: Sat, 12 Mar 2022 10:35:16 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: git: 5fc3cc2713ef - main - amd64: make bcmp in libc just call memcmp To: Mateusz Guzik Cc: src-committers , "" , dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1647102928; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=18OLDn0OWlLbTUpsyBwAG3smAVXGnAcX0CCjZ26IHsk=; b=iOLWr3wpvopcV9nw32br1gIPr4THjk0SI7Xt8TYI0WKBw53WeD+d1XOIsG3P9trbipf6l6 9scHYfsOz4k8mc5RMrRBi2BNQToj5uX1undi9/X8qdoWtt+/HMgGcggm3FZL/3ABY9CAKL rkD967IBEZdFLAVPecS2iHicYPjHWNyuP8Vf4RMxgJsSfoT9fZfAnDCfTNQ4aRatluVEv1 eqCTUASyd7eSDoJa7XSnZmnpjVoEUVF2xILNr9isttCXi+eRrL5st1FcRQxgvGaY638fr+ JUuWLnUUkIa3urg8tl96wEDyNDnzonMGKfGKxp6BZczhnC9EBFxdviJkpwFB3w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1647102928; a=rsa-sha256; cv=none; b=Z3ZxxJ+EWsBIa0x4hlx4gYrHZNymgoOW1DHrGzYpDLv8eo8P6SIxEOu664DNqSHeDhN6gR k2QqBAgjzP9sDNWRhmVd+x/SIlcbSjEW3qXfmcizK6CytP9qGvi3CFY/0cd+1RI4vixy4+ oJLRX5zf4WIneccZvdpcDuAE+6/YcaWmQmF9othEOYhKyG1nO/BlVSuAiT/Al8nZvdKCLU y2poZgiCJEzzjVuXI2nB2lsaGrAJ78cjhQcbsDAJjpY+1GMoJE25FK0IlgovULU0PH6pIw AuZECKr/UlRrMBbL7FTYGMEs1L6J72Qtwqp7jWyy0K3Wf0k/Y8V8VZglbzbe+Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N On Sat, Mar 12, 2022 at 8:59 AM Mateusz Guzik wrote: > > The branch main has been updated by mjg: > > URL: https://cgit.FreeBSD.org/src/commit/?id=5fc3cc2713eff8cdabbf6e5d03bf8a799adf808c > > commit 5fc3cc2713eff8cdabbf6e5d03bf8a799adf808c > Author: Mateusz Guzik > AuthorDate: 2022-03-12 12:27:25 +0000 > Commit: Mateusz Guzik > CommitDate: 2022-03-12 14:59:14 +0000 > > amd64: make bcmp in libc just call memcmp > > Preferably bcmp would just alias memcmp but there is build magic which > makes this problematic. > > Reviewed by: jhb > Differential Revision: https://reviews.freebsd.org/D28846 > --- > lib/libc/amd64/string/Makefile.inc | 1 - > lib/libc/amd64/string/bcmp.c | 16 ++++++++++++++++ > 2 files changed, 16 insertions(+), 1 deletion(-) > > diff --git a/lib/libc/amd64/string/Makefile.inc b/lib/libc/amd64/string/Makefile.inc > index cb370bc6be1c..b77079afc933 100644 > --- a/lib/libc/amd64/string/Makefile.inc > +++ b/lib/libc/amd64/string/Makefile.inc > @@ -1,7 +1,6 @@ > # $FreeBSD$ > > MDSRCS+= \ > - bcmp.S \ > memcmp.S \ > memcpy.S \ > memmove.S \ We should probably add a tools/build/depend-cleanup.sh entry for this, so that non-clean builds pick up the new object, but > diff --git a/lib/libc/amd64/string/bcmp.c b/lib/libc/amd64/string/bcmp.c > new file mode 100644 > index 000000000000..b45176dc2d56 > --- /dev/null > +++ b/lib/libc/amd64/string/bcmp.c > @@ -0,0 +1,16 @@ > +/*- > + * Written by Mateusz Guzik > + * Public domain. > + */ > + > +#include > +__FBSDID("$FreeBSD$"); > + > +#include > + > +int > +bcmp(const void *b1, const void *b2, size_t len) > +{ > + > + return (memcmp(b1, b2, len)); > +} Why do this instead of replacing the previous contents of bcmp.S with either: #define memcmp bcmp #include "memcmp.S" or, restructure memcmp like you did with memcpy/memmove? Thanks, Kyle Evans