From nobody Fri Oct 07 20:50:23 2022 X-Original-To: dev-commits-src-all@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 4MkgSF4tLFz4drNm for ; Fri, 7 Oct 2022 20:50:37 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com [IPv6:2a00:1450:4864:20::62b]) (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 4MkgSC6FnYz3ZmD for ; Fri, 7 Oct 2022 20:50:35 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-ej1-x62b.google.com with SMTP id nb11so13768621ejc.5 for ; Fri, 07 Oct 2022 13:50:35 -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=cnz6Ns+/P1mOKlfuZnHXZ6qZcip26RKShZSB4s2qTbBhiwPno1K0/NMLqTJy+bLroG cQXOLs/yrR2h0d3gu/lGha0Cj8DdM2AUSQB/Sazr2ydeumLu1hTcoGtnXiIjKd/H1zTb 0tKxNd5caQyF95MEuqibfV8vHMQZPmIcD1BaWRW9dAk2JyNDtJEhAFC4EsYEN2nybP7x bScPsMdSPQnLBHEfQuwgtJuJB9uOWSTqbo+Qq6szVe9BESEATMIYEJdKT6REyoyDiv+a 3yEzxanaqApbjVKseWQUGfgLKS0qhf+EsK3TnTpWixEjeSXsv1ogDbb3sTvs2YypQ5Ji 22rA== X-Gm-Message-State: ACrzQf0Jo+drx7VFYI+Vb6EhAMaW9lqFUJyDCgT1xAEanJQPgcqKV6Ng H5Hh170EMdRV0/w1fpBk5R2Q2/w2SK/KryprEhf+Cw== 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 all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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: 4MkgSC6FnYz3ZmD 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::62b) 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-all@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::62b: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-all@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--