From nobody Fri Oct 07 20:50:23 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 4MkgSF4YsYz4drc3 for ; Fri, 7 Oct 2022 20:50:37 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com [IPv6:2a00:1450:4864:20::630]) (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 4MkgSD30M7z3Ztx for ; Fri, 7 Oct 2022 20:50:36 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-ej1-x630.google.com with SMTP id bj12so13665302ejb.13 for ; Fri, 07 Oct 2022 13:50:36 -0700 (PDT) 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=YZo+4MsQ+aVki5t55xYYJFL4Ts0j2erd5Kc1zaV5fvg=; b=7QOfjBRnPWoQVkjMjszYITSjT8u4YNnSaEZrQ5v6uhq0Zp1TlXDLfetly4cCaeN0zH ebwTHyv/jRhBiQXQSqwaSIN27PDGhXuQvA3ofV9XE9HZdQ3yG73oel18Sk3UPw1n0FXY 4chUBkCh6LEuua4yQxMjgPCmJDASDw8kdGRwL0WFWE7jGbzveHGP04BvTwjPUimNJ+XT JVUh8a1KcDoJbuVfvpf3k8h/G/mYRiOOcYUz+C6hCuGO3ZyHMe8vugLXErVglGwOaaZM nXdj5Yj2H8Mm/UTG5utRIxzsnf55foJlokHxvFq+wfMow8MZ6hAkY2cLMO+gA3sb5Ukl Zpag== 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=YZo+4MsQ+aVki5t55xYYJFL4Ts0j2erd5Kc1zaV5fvg=; b=MU1u4MvBcgQpzG7aB7Ug54La6/mr4gfyvgR5Akhu22WpXJ+c5fxd0lIfjknG7m/kf7 gBMFYVKODASk2x3J7gtTDVt44x9UbWaBjwuLKjAqM71MCUtMGfTYRm63WGmYUxxHinJu 8uCGDF5AZSjdjTi1vh9OjKf7jk/0S9EEZVMbp4K5g6LoFYeo/jy0rvy0avoDeAHwhp+v XhGTz5QkfaO7rS9RJDU+MxFz1Qc3WoTkuDQQqxLN/hTXbHit3QqWrMVneQT71q2x913Z 022NOxLtcirIX0E2+CNPWjAHYZESTsRDl0/RYFREagB0ydIrbLw5jesyOMNizwZfcVrm PISQ== X-Gm-Message-State: ACrzQf19Z4MUfyW2yUCR2dn6e2PjehWlPK/pXA+HtmNtSfP3mXA1LrvU zF9nFWb6qqc6awOtc5MFAcnjY81ske+cOtRRPOsXZg== X-Google-Smtp-Source: AMsMyM4NOokTLk/eHdjnxn7ZvI+7YpQivS45/TbBl+pT/g0EeMAeYhOzjI5460exrAkiKYnKPZDA98TSD92bQmBv5+s= X-Received: by 2002:a17:907:969e:b0:782:6b92:6b1f with SMTP id hd30-20020a170907969e00b007826b926b1fmr5342961ejc.140.1665175834663; Fri, 07 Oct 2022 13:50:34 -0700 (PDT) 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: <202210072032.297KWiuG035424@gitrepo.freebsd.org> <28566608-eb68-7948-77b5-5e49739d8ec5@FreeBSD.org> In-Reply-To: <28566608-eb68-7948-77b5-5e49739d8ec5@FreeBSD.org> From: Warner Losh Date: Fri, 7 Oct 2022 14:50:23 -0600 Message-ID: Subject: Re: git: ce9e720af2f8 - main - : Add a fallback for __LONG_WIDTH__ for older compilers. To: John Baldwin Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: multipart/alternative; boundary="0000000000001d34d305ea77f604" X-Rspamd-Queue-Id: 4MkgSD30M7z3Ztx X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20210112.gappssmtp.com header.s=20210112 header.b=7QOfjBRn; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2a00:1450:4864:20::630) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-3.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.998]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20210112.gappssmtp.com:s=20210112]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; MLMMJ_DEST(0.00)[dev-commits-src-main@freebsd.org]; R_SPF_NA(0.00)[no SPF record]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::630:from]; RCVD_TLS_LAST(0.00)[]; ARC_NA(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; RCPT_COUNT_THREE(0.00)[4]; FROM_HAS_DN(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20210112.gappssmtp.com:+]; TO_DN_SOME(0.00)[]; DMARC_NA(0.00)[bsdimp.com]; PREVIOUSLY_DELIVERED(0.00)[dev-commits-src-main@freebsd.org]; RCVD_COUNT_TWO(0.00)[2] X-ThisMailContainsUnwantedMimeParts: N --0000000000001d34d305ea77f604 Content-Type: text/plain; charset="UTF-8" Hey John, On Fri, Oct 7, 2022 at 2:43 PM John Baldwin wrote: > On 10/7/22 1:32 PM, John Baldwin wrote: > > The branch main has been updated by jhb: > > > > URL: > https://cgit.FreeBSD.org/src/commit/?id=ce9e720af2f8fa378e36134bab8a82ebf67c159d > > > > commit ce9e720af2f8fa378e36134bab8a82ebf67c159d > > Author: John Baldwin > > AuthorDate: 2022-10-07 19:44:31 +0000 > > Commit: John Baldwin > > CommitDate: 2022-10-07 19:44:31 +0000 > > > > : Add a fallback for __LONG_WIDTH__ for older > compilers. > > > > clang only includes a __LONG_WIDTH__ builtin in clang 14 and later. > > --- > > sys/sys/_pv_entry.h | 5 +++++ > > 1 file changed, 5 insertions(+) > > > > diff --git a/sys/sys/_pv_entry.h b/sys/sys/_pv_entry.h > > index 411643cf49ec..3cd0d9c687f6 100644 > > --- a/sys/sys/_pv_entry.h > > +++ b/sys/sys/_pv_entry.h > > @@ -77,6 +77,11 @@ typedef struct pv_entry { > > #error Unsupported page size > > #endif > > > > +/* Support clang < 14 */ > > +#ifndef __LONG_WIDTH__ > > +#define __LONG_WIDTH__ (__CHAR_BIT__ * __SIZEOF_LONG__) > > +#endif > > + > > This was the smallest change to fix CI breakage. However, we may want to > do > this differently. We could perhaps add this fallback for __LONG_WIDTH__ to > , or we could change sys/_pv_entry.h to use the expanded form > always (or pick a different spelling?) > I'm inclined to move those 5 lines to sys/cdefs.h since that file generally tries to provide either a FreeBSD-specific spelling of compiler-specific things, or provides the standard thing when that's not available. __LONG_WIDTH__ is trending towards standardization, imho, so it may make sense to standardize FreeBSD's uses there as well. Warner --0000000000001d34d305ea77f604 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hey John,

On Fri, Oct 7, 2022 at 2:43 = PM John Baldwin <jhb@freebsd.org&= gt; wrote:
On 10= /7/22 1:32 PM, John Baldwin wrote:
> The branch main has been updated by jhb:
>
> URL: https://= cgit.FreeBSD.org/src/commit/?id=3Dce9e720af2f8fa378e36134bab8a82ebf67c159d<= /a>
>
> commit ce9e720af2f8fa378e36134bab8a82ebf67c159d
> Author:=C2=A0 =C2=A0 =C2=A0John Baldwin <jhb@FreeBSD.org>
> AuthorDate: 2022-10-07 19:44:31 +0000
> Commit:=C2=A0 =C2=A0 =C2=A0John Baldwin <jhb@FreeBSD.org>
> CommitDate: 2022-10-07 19:44:31 +0000
>
>=C2=A0 =C2=A0 =C2=A0 <sys/_pv_entry>: Add a fallback for __LONG_W= IDTH__ for older compilers.
>=C2=A0 =C2=A0 =C2=A0
>=C2=A0 =C2=A0 =C2=A0 clang only includes a __LONG_WIDTH__ builtin in cl= ang 14 and later.
> ---
>=C2=A0 =C2=A0sys/sys/_pv_entry.h | 5 +++++
>=C2=A0 =C2=A01 file changed, 5 insertions(+)
>
> diff --git a/sys/sys/_pv_entry.h b/sys/sys/_pv_entry.h
> index 411643cf49ec..3cd0d9c687f6 100644
> --- a/sys/sys/_pv_entry.h
> +++ b/sys/sys/_pv_entry.h
> @@ -77,6 +77,11 @@ typedef struct pv_entry {
>=C2=A0 =C2=A0#error Unsupported page size
>=C2=A0 =C2=A0#endif
>=C2=A0 =C2=A0
> +/* Support clang < 14 */
> +#ifndef __LONG_WIDTH__
> +#define=C2=A0 =C2=A0 =C2=A0 __LONG_WIDTH__=C2=A0 (__CHAR_BIT__ * __SI= ZEOF_LONG__)
> +#endif
> +

This was the smallest change to fix CI breakage.=C2=A0 However, we may want= to do
this differently.=C2=A0 We could perhaps add this fallback for __LONG_WIDTH= __ to
<sys/cdefs.h>, or we could change sys/_pv_entry.h to use the expanded= form
always (or pick a different spelling?)

=
imho, so it may make sense to standardize FreeBSD's uses there as = well.

Warner
--0000000000001d34d305ea77f604--