From nobody Sun Dec 11 14:57:12 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 4NVSXh3ww0z4khWd for ; Sun, 11 Dec 2022 14:57:24 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com [IPv6:2a00:1450:4864:20::635]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NVSXh3WCbz4PS5 for ; Sun, 11 Dec 2022 14:57:24 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ej1-x635.google.com with SMTP id n21so22096699ejb.9 for ; Sun, 11 Dec 2022 06:57:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=FUXNZmOwLm0vwSgrTpxJpYixOP8eAqkKcHctbJTvgXQ=; b=ZWpFTxEBsc++d4u78z0J88dQfVe2v1bnsmaYNqTN7BjaeDtwzWpdfjV++FJoc4/tu2 dpKKNIBs6CTYCsFDGjOlfhEjBrC9UbVyUqGexmSERSd7sivNcAJ2d/Us88Vmk97j7kVu 9TyhxL76ob3ZLhrtsEMudqn8kn5oda2avF0d4nFHSjQXfqTqf08iNYepRaggSGsDnkRT WiJKicygA9NNVq8LvCiZz7aDjPK4bGSSdSx40UKSG52WD2fD0mJim7QS9yjuf0qVb0Se SRk7oDFajv4DQGx/QMMonFKhduGy11vD7iqFwRL6xQE0/ghR9UE69JovT6n8KilTraR+ tG7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=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=FUXNZmOwLm0vwSgrTpxJpYixOP8eAqkKcHctbJTvgXQ=; b=pUs8dfNMMy7/UWIlvdV7ADc5zb0g69gQjgLdiZGOy8aMiViV/+k/YfYNbyA/pznA0E lPqZi8YvqYDf3DN9VtiUMdrAXDfqDjmYIp5Y4LxEyprHvbvoYyxonnaNHTaQsZiH3DSJ wPo9jtw8QmplsNwRFirzVSNpgqJ/BrXAx08PIhjYDQdUjzjX/Xo+W389PKyz5lp9JPAI q0lM4ddv1udUb1Ls2cornpyc5awLGhNC1phBC+Zh8Rm7m1TO5+46TSM8dnx5tyo0H1u/ 4dERfCgEdnebyxmdnhEc1Pxafua6UEUtrAdIpv82X3cl0TLL8mhNjH9Yukj5n9XQ7uYO qAUw== X-Gm-Message-State: ANoB5pk4tfSvKuIrloA08RilrMwOMakX4mLur/l3nrCRqTunXG7EPXlc tlUvaW2j4mvSlfOc9dQICBfmZxIo4spm+xb6xOIhqdQwZz4dVw== X-Google-Smtp-Source: AA0mqf7jtjZga/+fKix28mn6eneaX9AGqiBVSvB7OtUxmNeFk64i31Oa3v43POTEKcalMGAFnBQB2dPYzK0F0Q3YG+A= X-Received: by 2002:a17:906:5a0c:b0:7c0:faca:4d5e with SMTP id mx12-20020a1709065a0c00b007c0faca4d5emr12659622ejc.140.1670770643323; Sun, 11 Dec 2022 06:57:23 -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: <202212111208.2BBC835O095410@gitrepo.freebsd.org> <20221211143724.4D42C415@slippy.cwsent.com> In-Reply-To: <20221211143724.4D42C415@slippy.cwsent.com> From: Warner Losh Date: Sun, 11 Dec 2022 07:57:12 -0700 Message-ID: Subject: Re: git: 83bf6ab56829 - main - uname: switch machine to HW_MACHINE_ARCH To: Cy Schubert Cc: Piotr Kubaj , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: multipart/alternative; boundary="000000000000b2602205ef8e9a18" X-Rspamd-Queue-Id: 4NVSXh3WCbz4PS5 X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N --000000000000b2602205ef8e9a18 Content-Type: text/plain; charset="UTF-8" On Sun, Dec 11, 2022 at 7:37 AM Cy Schubert wrote: > In message <202212111208.2BBC835O095410@gitrepo.freebsd.org>, Piotr Kubaj > write > s: > > The branch main has been updated by pkubaj (ports committer): > > > > URL: > https://cgit.FreeBSD.org/src/commit/?id=83bf6ab568293e325f437342cdb87a62 > > 6353e27c > > > > commit 83bf6ab568293e325f437342cdb87a626353e27c > > Author: Piotr Kubaj > > AuthorDate: 2022-12-11 03:01:44 +0000 > > Commit: Piotr Kubaj > > CommitDate: 2022-12-11 12:05:39 +0000 > > > > uname: switch machine to HW_MACHINE_ARCH > > > > On powerpc64, powerpc64le and riscv64 some software wrongly assumes > that > > it runs on powerpc or riscv (32-bit). > > > > Differential revision: https://reviews.freebsd.org/D35962 > > Approved by: alfredo, imp > > --- > > lib/libc/gen/__xuname.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/lib/libc/gen/__xuname.c b/lib/libc/gen/__xuname.c > > index fba5eaeebc88..bd328d4f880f 100644 > > --- a/lib/libc/gen/__xuname.c > > +++ b/lib/libc/gen/__xuname.c > > @@ -127,11 +127,11 @@ __xuname(int namesize, void *namebuf) > > } > > q += namesize; > > > > - if ((p = getenv("UNAME_m"))) > > + if ((p = getenv("UNAME_p"))) > > strlcpy(q, p, namesize); > > else { > > mib[0] = CTL_HW; > > - mib[1] = HW_MACHINE; > > + mib[1] = HW_MACHINE_ARCH; > > len = namesize; > > oerrno = errno; > > if (sysctl(mib, 2, q, &len, NULL, 0) == -1) { > > > > This probably needs to go into RELNOTES at some point. Though small it's > significant enough to document. > It's also only for uname(3), not uname(1). Warner --000000000000b2602205ef8e9a18 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Sun, Dec 11, 2022 at 7:37 AM Cy Sc= hubert <Cy.Schubert@cschube= rt.com> wrote:
In message <202212111208.2BBC835O095410@gitrepo.freebsd.= org>, Piotr Kubaj
write
s:
> The branch main has been updated by pkubaj (ports committer):
>
> URL: https://cgit.Fre= eBSD.org/src/commit/?id=3D83bf6ab568293e325f437342cdb87a62
> 6353e27c
>
> commit 83bf6ab568293e325f437342cdb87a626353e27c
> Author:=C2=A0 =C2=A0 =C2=A0Piotr Kubaj <pkubaj@FreeBSD.org>
> AuthorDate: 2022-12-11 03:01:44 +0000
> Commit:=C2=A0 =C2=A0 =C2=A0Piotr Kubaj <pkubaj@FreeBSD.org>
> CommitDate: 2022-12-11 12:05:39 +0000
>
>=C2=A0 =C2=A0 =C2=A0uname: switch machine to HW_MACHINE_ARCH
>=C2=A0 =C2=A0 =C2=A0
>=C2=A0 =C2=A0 =C2=A0On powerpc64, powerpc64le and riscv64 some software= wrongly assumes that
>=C2=A0 =C2=A0 =C2=A0it runs on powerpc or riscv (32-bit).
>=C2=A0 =C2=A0 =C2=A0
>=C2=A0 =C2=A0 =C2=A0Differential revision:=C2=A0 https://revie= ws.freebsd.org/D35962
>=C2=A0 =C2=A0 =C2=A0Approved by:=C2=A0 =C2=A0 alfredo, imp
> ---
>=C2=A0 lib/libc/gen/__xuname.c | 4 ++--
>=C2=A0 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/lib/libc/gen/__xuname.c b/lib/libc/gen/__xuname.c
> index fba5eaeebc88..bd328d4f880f 100644
> --- a/lib/libc/gen/__xuname.c
> +++ b/lib/libc/gen/__xuname.c
> @@ -127,11 +127,11 @@ __xuname(int namesize, void *namebuf)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0}
>=C2=A0 =C2=A0 =C2=A0 =C2=A0q +=3D namesize;
>=C2=A0
> -=C2=A0 =C2=A0 =C2=A0if ((p =3D getenv("UNAME_m")))
> +=C2=A0 =C2=A0 =C2=A0if ((p =3D getenv("UNAME_p")))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0strlcpy(q, p, na= mesize);
>=C2=A0 =C2=A0 =C2=A0 =C2=A0else {
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0mib[0] =3D CTL_H= W;
> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0mib[1] =3D HW_MACHINE= ;
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0mib[1] =3D HW_MACHINE= _ARCH;
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0len =3D namesize= ;
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0oerrno =3D errno= ;
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (sysctl(mib, = 2, q, &len, NULL, 0) =3D=3D -1) {
>

This probably needs to go into RELNOTES at some point. Though small it'= s
significant enough to document.

It'= s also only for uname(3), not uname(1).

Warner=C2= =A0
--000000000000b2602205ef8e9a18--