From nobody Wed Jun 5 23:42:34 2024 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 4VvkXn0PGgz5MFff; Wed, 05 Jun 2024 23:42:49 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf1-x42f.google.com (mail-pf1-x42f.google.com [IPv6:2607:f8b0:4864:20::42f]) (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 "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VvkXm15gsz4F4k; Wed, 5 Jun 2024 23:42:48 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20230601 header.b="S/E7zBeA"; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of yaneurabeya@gmail.com designates 2607:f8b0:4864:20::42f as permitted sender) smtp.mailfrom=yaneurabeya@gmail.com Received: by mail-pf1-x42f.google.com with SMTP id d2e1a72fcca58-702555eb23bso297077b3a.1; Wed, 05 Jun 2024 16:42:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717630966; x=1718235766; darn=freebsd.org; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:from:to:cc:subject:date:message-id:reply-to; bh=nFtoAyUPiUCXH7nmY86cSpfWKxW42/JBUi7XrjAE8r4=; b=S/E7zBeAu79qCSzNXc6eCTs7R3454o7HOYAE7IRXw4CSChsHy08aOq68VHuCUKdts0 X71ttyveJMRVjAMo0uEU/tisfWu5mUD6IQ7VZQlAN1gRfVoURXAukDwf+U+J/5unikLw g2ZoMoPPY51xVYXLEgKQ1JM1yHQjVxw0D7tHuljx/hImPhDclYdmsusOWoGID8RsfQTZ 0H6q5mriUK2Ny+HWLXKWBOxmLROCdawKNv8o2bmd/inK/pwMlueQZccu34j7gC/xLX/8 Am0XrqeYms40miGzar+Qclz0Gg8UcZ3jvGu1mIV1mgfY7lz7kWonGwcr9IcODwpmYjkp /uLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717630966; x=1718235766; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=nFtoAyUPiUCXH7nmY86cSpfWKxW42/JBUi7XrjAE8r4=; b=B0Z0XLH5/JU6DJHfxs+RxA5TcUYod9v/2QEnB+yh6uaFK2XeW9oXN0GzEVajHEeJ0O Z9DA2dY1+mb3zqfxXpZKrkNOPBjLeJ2evoe9URp6o5YraM+MieZXhGxjERX3acYqAHz4 AUYUy185cwCzXB/5WjaYDE96tKqja08grPviy5zmRxQ4FBjuezCKK84E5I9PcmZs8HHw 1BgFUINvuaF+rW056vL40l0tSXOEsDLrSkJeP3sTEmqRXuHJDkFl+MfOtLlGQDJQo29R IOSyOjLtPS35TTvw57Su0OkW26Z7STxPcEqRrHYqzLR3Toz4XYpla9pmOgCaqnGaX/lN mLXQ== X-Forwarded-Encrypted: i=1; AJvYcCUIlXtdko/cAKVCgMGkcKr/6JKHiczPtMiQiXoDfho8vHXBXvhpgOMBg0DyHq5EWtbXGXAp0q6BfTPXFdF4Q8Ti4RYKXIOnikLgppL4ve2vPOrAXBWB0J+MZXKJKd1KzbGp6kqcMjWpbaxc3Li6dixeVw== X-Gm-Message-State: AOJu0YwrirTy+vPAWC+hbKpyVdFbSUsANK+15/fFATbpeRi9+91RHrNM rUnHbU/TySO02us9Lp3/CDT65aODZhqn88CfFxVfV1u5pbjxwsiJuCrskA== X-Google-Smtp-Source: AGHT+IGK+qUG/XfSUWw8KyC86yCUCNrmBh/3QxS6nGf6MMkb05MyiZda8NOg6FPWMpKDTBK6Y3Jhig== X-Received: by 2002:a05:6a21:1f03:b0:1a7:7358:f108 with SMTP id adf61e73a8af0-1b2b6fdfc5dmr4143045637.24.1717630965866; Wed, 05 Jun 2024 16:42:45 -0700 (PDT) Received: from smtpclient.apple ([162.118.1.182]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-703fd53e0d0sm50424b3a.211.2024.06.05.16.42.45 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Jun 2024 16:42:45 -0700 (PDT) From: Enji Cooper Message-Id: Content-Type: multipart/signed; boundary="Apple-Mail=_DBDAF988-3B9B-4D64-AF2B-11B57B8F70DB"; protocol="application/pgp-signature"; micalg=pgp-sha256 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.600.62\)) Subject: Re: git: 41ee91c64f47 - main - newfs_msdos: fix build on non-FreeBSD systems Date: Wed, 5 Jun 2024 16:42:34 -0700 In-Reply-To: <202406040628.4546SJ98088668@gitrepo.freebsd.org> Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" To: =?utf-8?Q?Stefan_E=C3=9Fer?= References: <202406040628.4546SJ98088668@gitrepo.freebsd.org> X-Mailer: Apple Mail (2.3774.600.62) X-Spamd-Bar: ----- X-Spamd-Result: default: False [-5.05 / 15.00]; SIGNED_PGP(-2.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20230601]; MIME_GOOD(-0.20)[multipart/signed,multipart/alternative,text/plain]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; NEURAL_SPAM_SHORT(0.05)[0.046]; RCVD_TLS_LAST(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; ARC_NA(0.00)[]; TO_DN_SOME(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:+,3:~,4:~]; FREEMAIL_ENVFROM(0.00)[gmail.com]; FREEMAIL_FROM(0.00)[gmail.com]; FROM_HAS_DN(0.00)[]; HAS_ATTACHMENT(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org,dev-commits-src-main@freebsd.org]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; APPLE_MAILER_COMMON(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::42f:from] X-Rspamd-Queue-Id: 4VvkXm15gsz4F4k --Apple-Mail=_DBDAF988-3B9B-4D64-AF2B-11B57B8F70DB Content-Type: multipart/alternative; boundary="Apple-Mail=_2177F822-964E-4C5D-AF25-53AE6A5914A7" --Apple-Mail=_2177F822-964E-4C5D-AF25-53AE6A5914A7 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Jun 3, 2024, at 11:28=E2=80=AFPM, Stefan E=C3=9Fer = wrote: >=20 > The branch main has been updated by se: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3D41ee91c64f47faaa8131df3cd8a63bdb= 60fa486a >=20 > commit 41ee91c64f47faaa8131df3cd8a63bdb60fa486a > Author: Stefan E=C3=9Fer > AuthorDate: 2024-06-04 06:26:09 +0000 > Commit: Stefan E=C3=9Fer > CommitDate: 2024-06-04 06:26:09 +0000 >=20 > newfs_msdos: fix build on non-FreeBSD systems >=20 > Disable data area alignment if the build environment does not = define > PAGE_SIZE (e.g., when building on Linux or macOS). >=20 > Reported by: jrtc27 > MFC after: 1 week > --- > sbin/newfs_msdos/mkfs_msdos.c | 4 ++++ > 1 file changed, 4 insertions(+) >=20 > diff --git a/sbin/newfs_msdos/mkfs_msdos.c = b/sbin/newfs_msdos/mkfs_msdos.c > index 423fbbcadcc5..1bca560a59e1 100644 > --- a/sbin/newfs_msdos/mkfs_msdos.c > +++ b/sbin/newfs_msdos/mkfs_msdos.c > @@ -571,7 +571,11 @@ mkfs_msdos(const char *fname, const char *dtype, = const struct msdos_options *op) > if (o.align) > alignto =3D bpb.bpbSecPerClust; > else > +#ifdef PAGE_SIZE > alignto =3D PAGE_SIZE / bpb.bpbBytesPerSec; > +#else > + alignto =3D 1; > +#endif > if (alignto > 1) { > /* align data clusters */ > alignment =3D (bpb.bpbResSectors + bpb.bpbBigFATsecs * = bpb.bpbFATs + rds) % I realize this might seem silly, but what about = sysconf(_SC_PAGE_SIZE) ( = https://pubs.opengroup.org/onlinepubs/9699919799/functions/sysconf.html = ) with platforms that don=E2=80=99t have direct access to PAGE_SIZE? = It=E2=80=99s supported on Linux and MacOS at least. Cheers, -Enji= --Apple-Mail=_2177F822-964E-4C5D-AF25-53AE6A5914A7 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8
On Jun 3, = 2024, at 11:28=E2=80=AFPM, Stefan E=C3=9Fer <se@freebsd.org> = wrote:

The branch = main has been updated by se:

URL: = https://cgit.FreeBSD.org/src/commit/?id=3D41ee91c64f47faaa8131df3cd8a63bdb= 60fa486a

commit = 41ee91c64f47faaa8131df3cd8a63bdb60fa486a
Author: =     Stefan E=C3=9Fer = <se@FreeBSD.org>
AuthorDate: 2024-06-04 06:26:09 = +0000
Commit:     Stefan E=C3=9Fer = <se@FreeBSD.org>
CommitDate: 2024-06-04 06:26:09 +0000

=    newfs_msdos: fix build on non-FreeBSD systems

=    Disable data area alignment if the build environment = does not define
   PAGE_SIZE (e.g., when building on = Linux or macOS).

   Reported by: =    jrtc27
   MFC after: =      1 week
---
= sbin/newfs_msdos/mkfs_msdos.c | 4 ++++
1 file changed, 4 = insertions(+)

diff --git a/sbin/newfs_msdos/mkfs_msdos.c = b/sbin/newfs_msdos/mkfs_msdos.c
index 423fbbcadcc5..1bca560a59e1 = 100644
--- a/sbin/newfs_msdos/mkfs_msdos.c
+++ = b/sbin/newfs_msdos/mkfs_msdos.c
@@ -571,7 +571,11 @@ mkfs_msdos(const = char *fname, const char *dtype, const struct msdos_options *op)
= =    if (o.align)
alignto =3D = bpb.bpbSecPerClust;
=    else
+#ifdef PAGE_SIZE
alignto =3D= PAGE_SIZE / bpb.bpbBytesPerSec;
+#else
+ =        alignto =3D 1;
+#endif
= =    if (alignto > 1) {
/* align data clusters */
= = = alignment =3D (bpb.bpbResSectors + bpb.bpbBigFATsecs * = bpb.bpbFATs + rds) %

I realize = this might seem silly, but what about sysconf(_SC_PAGE_SIZE) ( https://pubs.opengroup.org/onlinepubs/9699919799/functions/sysconf.= html ) with platforms that don=E2=80=99t have direct access to = PAGE_SIZE? It=E2=80=99s supported on Linux and MacOS at = least.
Cheers,
-Enji
= --Apple-Mail=_2177F822-964E-4C5D-AF25-53AE6A5914A7-- --Apple-Mail=_DBDAF988-3B9B-4D64-AF2B-11B57B8F70DB Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEkHfexGRJ3gYRdA2gGpE5DjPsNJgFAmZg9+oACgkQGpE5DjPs NJgtuw/9HG0/1ATJAV4mWm6dO5t41uHH11gAj3ONXPEjG962AFQaYQf8C0p+o0sM KxsIuA325Uvh20cZTItSkHX5s580Kc+nVl3zt7lbqs8ye1uwbOyf7EaQ2p2tjYwK /SZrAZ1ac2MHrYjnz+tH1QemCKWzwhFFCRO4rClAh8mN/BoHkIG9gptDn8kMjVTv K91KpVi7p8R6yWq6GkFbvX18Dz56aJMfvs8wQey1ReHcCwkVaQSo4EZR9Rncj1pM ajm5m/hy6q5VAsQEWq26qH6ZP09ZjI24g9+PqggFRhCVImDxPKmJlN3UXuIbLMqg lZPgd/BxTEOw/8gR/Uk2O44IXVdiIZVQbTNZzKZII7bzHAR+s9SiwAupyLuUY/Lu RX5B1wa9UdoUCxw6HVf40UVy/Ycln763OBNBWjvdmIo3vvLPTzknafNvNlr3w0H9 aXHwKqjKPu6O3LH5uTm1udEGbeHP4pFwLTz0GZPI0fI2nQCTICLVDyXD4SnRR445 /gBNMeI9MIm3RCjTbaONqLjJmYoLCFE7W8NHCbDi1sCOGE+xThKfFL276t+gpPCa s1IIr6aXV9MiRQIWvDtKbgDQlAdks4qHbIUALAzyTjWUD75IoFcg5us1t3DhLohV qANBrDpxKgzfDbXBSmXz4L9Xqh58CSbAs1iMvQVnBGkfK4F/H1o= =ziqq -----END PGP SIGNATURE----- --Apple-Mail=_DBDAF988-3B9B-4D64-AF2B-11B57B8F70DB--