From nobody Wed Jun 05 23:47:06 2024 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 4Vvkf06B0nz5MGLm; Wed, 05 Jun 2024 23:47:20 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pl1-x636.google.com (mail-pl1-x636.google.com [IPv6:2607:f8b0:4864:20::636]) (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 4Vvkf0201yz4Fh3; Wed, 5 Jun 2024 23:47:20 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20230601 header.b="nWbR/Zky"; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of yaneurabeya@gmail.com designates 2607:f8b0:4864:20::636 as permitted sender) smtp.mailfrom=yaneurabeya@gmail.com Received: by mail-pl1-x636.google.com with SMTP id d9443c01a7336-1f67fa9cd73so10950515ad.0; Wed, 05 Jun 2024 16:47:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717631238; x=1718236038; 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=9QWTFMPjshKLOrsxXRXQdZtXu3/pnblpBYW77fzrxh8=; b=nWbR/Zkyy1FzwWgm6ftjiGdoJT61+lFTltHp2CXKZ0LuT97pKUiBEsbo/Sgg37deQ6 hkaC9InPkwRO5lLU/ySwEjfZRitEnG6nDW7rl6KMtw7fVzy7GUiWkpU1HBBO4kWuzROK Wy2NvYfV4kKhz0VNMp7DSZjzX0a+DqZhFtp+RN8zNQ0vkwNMtHtOXnobi8xpmvWvcBWt zpjyixAKPrFUS0amApGY9Ums2y50n5Y1vHCLUOt72rSQZlJx5enrDObk6APm6ikiNEMw Nxn7s6uM2TiGlWYfO/CkrjWmgRDilId2HbMBO0V4Llykreute49NVn63U6G+Ks+SXsr6 AXaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717631238; x=1718236038; 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=9QWTFMPjshKLOrsxXRXQdZtXu3/pnblpBYW77fzrxh8=; b=E7XAG1M6F6QnQXMMLWcmdzT7ZhLWx9xfmq8o+OcjO3E98TvhzjGvz7Tbhfr93raVkc w5xEHLaoT2Ayqi0D/F13/zAzgKy8+HNbGsXL/GVCxPWfzCNUgWlIjrqYG9xT0uZA/dvz cVt1Q23kR+Xl7TdH+3BFK1t3URrL8XRHFkeEmjwdChVnscavLMd06VYFVaJOMtL/UetJ O/BM5fA7my3jNTbAijDh8rhX2Cgxec5ZBclQJ9Bv/j1Qd7sgbXAKNWDY0y7MRDjIdsZB WjNEBJx2ihnFAEFR34rCMH3ZVsyGcv0GQx3CrntgH9v6lHYMejlwcO0/jC/Btjk/5/tb ufNw== X-Forwarded-Encrypted: i=1; AJvYcCU1X+IXeXYuNwSS47ABAYfh9TaNsp8YEV/Oeg2NuXVQlCY1LExUa6uNiXgIG2N5IbWZngx9cTvwhBzZWCEA45u1jvyuEyoSfuWtVy5A5hnM8UCkrjuZu1kkjcYjbOKD22tXopvzvnKDrKe6gC0Q1F3IOA== X-Gm-Message-State: AOJu0YzE69cKWZ3TebJ0A2vU3OATmn1mEp0Asdfn39+cDS6NSTbHZ6rg BAjY8vPYbfoAqJ56rUEd/gVLb9rxiJW+Zv9rM9EAlpPN6C+k3vTOsIyz1w== X-Google-Smtp-Source: AGHT+IGq+5CSG2mrFpoiEUblmSfpUE0Xp3ljJB61YZvmZP7G3Tfe/06ni8k3264J4iKvWzrG0i83cQ== X-Received: by 2002:a17:902:cec9:b0:1eb:7162:82c7 with SMTP id d9443c01a7336-1f6b8ede496mr15815455ad.18.1717631238079; Wed, 05 Jun 2024 16:47:18 -0700 (PDT) Received: from smtpclient.apple ([162.118.1.182]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1f6bd7d2cb8sm1106535ad.140.2024.06.05.16.47.17 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Jun 2024 16:47:17 -0700 (PDT) From: Enji Cooper Message-Id: <917A072B-D970-428A-B4B2-EA93ADFE67C7@gmail.com> Content-Type: multipart/signed; boundary="Apple-Mail=_ED887DA8-1BF9-458D-91AD-D884882DE5A8"; protocol="application/pgp-signature"; micalg=pgp-sha256 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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:47:06 -0700 In-Reply-To: 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 [-4.98 / 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.12)[0.122]; RCVD_TLS_LAST(0.00)[]; ARC_NA(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_EQ_ADDR_SOME(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::636:from] X-Rspamd-Queue-Id: 4Vvkf0201yz4Fh3 --Apple-Mail=_ED887DA8-1BF9-458D-91AD-D884882DE5A8 Content-Type: multipart/alternative; boundary="Apple-Mail=_32A48224-E49F-4478-907D-645B6A321128" --Apple-Mail=_32A48224-E49F-4478-907D-645B6A321128 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Jun 5, 2024, at 4:42=E2=80=AFPM, Enji Cooper = wrote: >=20 >> 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) % >=20 > 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. Also, POSIX says it could be defined by limits.h: = https://pubs.opengroup.org/onlinepubs/7908799/xsh/limits.h.html . It = might just be that an extra header is required to make the tool compile = with the proper PAGE_SIZE prior to this change. -Enji --Apple-Mail=_32A48224-E49F-4478-907D-645B6A321128 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8
On Jun 5, = 2024, at 4:42=E2=80=AFPM, Enji Cooper <yaneurabeya@gmail.com> = wrote:

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.

Also, POSIX says it = could be defined by limits.h: h= ttps://pubs.opengroup.org/onlinepubs/7908799/xsh/limits.h.html . = It might just be that an extra header is required to make the tool = compile with the proper PAGE_SIZE prior to this = change.
-Enji

= --Apple-Mail=_32A48224-E49F-4478-907D-645B6A321128-- --Apple-Mail=_ED887DA8-1BF9-458D-91AD-D884882DE5A8 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----- iQIzBAEBCAAdFiEEkHfexGRJ3gYRdA2gGpE5DjPsNJgFAmZg+PsACgkQGpE5DjPs NJg1og//fDTssIts3YrVsadzmffYVmuEVW8gZo2bs2176RE2XkFSlasSgecyIv/2 /QQP09IuV21ZpIzd7vnJh0LSRd+6EgUf0AigQxK+x9VVQY6iev+kiEcKk4T/GI1c sclSoOjxiOfmZXQhTaA8GOnElZkG218ToXgYrrH2ZR+gfJsRYiMgbstdD939rEBY 9N42igKuAfW4e91TnSug3bKUYHyu/6Ai9dG6U9W7nHMhc9V4sRA9jpDhR4ViuJPz Jaz2jpfVXDVuC0woSYbVOIUkg01RE/f9ZcXWqHsJoQkomjRLw9wQKqv8KXqoCv5T maY0UxstXlp2bJ3fO2N3tfnO88lTIZSDQK2dDao8i6sFJw2fQqoZRIaSiNq+N4Qr JY3ffnPWhpC4CoJWbOfvPs8iCEwHgTw95NN0zbgc9Q+CvVLG3eHKhX0ju/AmzFya npz0FoRBhBRwF+YUOfKnr+hZ6J908Fo0DKcCryn2Py7vFVEPX0bJQu2uurtf/GIT 9TSh6EKZGzwngnkWrI2YMTX/lCxuni2PGPJudIC8I3Mxlyhc06lTw8I5ZAh4qak5 BsNGd7K7sshW0lxSj7ymbRGG+Jku5+/VDzzSguPcAXfM+OXtAdv8D2Vr9aBazndo 6x9aYk8Pbot+TpPlI8KSsxSYUGPahkyXyZfqGTvJ8U6qW4dmR9Y= =N3S5 -----END PGP SIGNATURE----- --Apple-Mail=_ED887DA8-1BF9-458D-91AD-D884882DE5A8--