From nobody Sun May 3 18:48:37 2026 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 4g7v204qM9z6bs2k for ; Sun, 03 May 2026 18:48:56 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) (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 4g7v201yXCz3lPH for ; Sun, 03 May 2026 18:48:51 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-4890d945eb4so24005675e9.0 for ; Sun, 03 May 2026 11:48:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777834130; x=1778438930; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-gg:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=ccFfxir9trlNsniLRapBXRh48nxUdv74CiuMMmVBcU4=; b=qzV918YrZWDl9NZlHbjybqLcUWI73vdkvQwfaQW7BslzLgH8N+rGTjv++Jcl28YNCI GLCAKYB8u0HUt/6eYBiVunz2SQoLsIP/AGeCZcX/8TsMPK041cQQ+OqMH4xCGhj9w9NA sVRFJm7m2HQUrtxrgnAgypCft3pqIzwoTeXOkwtxDhsgsEoWk6Ybonxe9uA7UFd8RDBu 2mIhnJCQQCu3KtaC2lxEA4xFHmQa2c07m+ZlrxYyBfVzLQnwo+cIi4dLIrfH640faVGF 26rToh5pj+K1eSbQhMeZCGab4opFxp3pRl0CXyTQlNGo1no3pvtteQcP0zrYnFfix9S1 hFVQ== X-Forwarded-Encrypted: i=1; AFNElJ/DLf7bd3JurqIE0Q2Az4zSu057gAPVGDTO1Fs0kRbsPCWWZwNgaSLcosyxPGMsb3YmqhTeykV19IJx4+f+0K6GjdFsww==@freebsd.org X-Gm-Message-State: AOJu0YwAJ0U/2u5Mn09UbKeUwmQWkt4AYtOOPwGzFaQRhmbTrUFUBHHQ Tv0SgiXfjNIONB1vpTrs7nAmbDWTZreIUTvv4mop0W+4uyHnCSCKfxEBJ5tjRywpHeM= X-Gm-Gg: AeBDiet3dS1uFr3j55ESM7smwK1LSwdG+CNXLSndHDAMwItIv6MzGvQ0mNkSZ4LqCuO 04b01OKk6jvm5s2Db9AS4MjQLT1g7lXCcHvAUUgqFq9W2AHnKxEwkbot65JE7HmuK4BuVtbrh+X bM/OkoQUbq8hWf9rrxbzbrj3bQo3OUP5Nsf8HScP+ZnV5IFMVrikkrucLJc4auWTOjeEfikSkAc uWc9+svv7qlpcQXLdcpBBv/tElSmAOg7oiWv0DNYHqwwgibW/iG8JzKybpMFfXNio0rc8QupTlH sNayNZqnsapuGqZJtqH6maBUmMKhZHkpNXfiqLM1El1kx4mLEl3FBmUc0jn4L185MTqoPU0UXdE NWWTja17Zgcr3hj5o1aluiddyiuMbfGm438WowT67Lj0x14qFXVIUm4PdxHqJ2zgqh8Y4EwQvIr AUMgGXL9cemRwLxQHslyibz2b/Kk1ZFdiTFGjKSFvFni6ARebFNwxW3k8gRd8uYlGBGheImGXhq 7OeRYTsjxeLaw== X-Received: by 2002:a05:600c:26d2:b0:48a:5236:7f38 with SMTP id 5b1f17b1804b1-48a8607970fmr142754895e9.14.1777834129280; Sun, 03 May 2026 11:48:49 -0700 (PDT) Received: from smtpclient.apple (nat-184-7.net.cam.ac.uk. [131.111.184.7]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-44a9879ef89sm23105541f8f.30.2026.05.03.11.48.48 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 03 May 2026 11:48:48 -0700 (PDT) Content-Type: text/plain; charset=utf-8 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3864.400.21\)) Subject: Re: git: 01674e15dedb - main - bsd.endian.mk: Optimize the handling of big/little endian determination. From: Jessica Clarke In-Reply-To: <69f6b1ec.181e8.27d0b938@gitrepo.freebsd.org> Date: Sun, 3 May 2026 19:48:37 +0100 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <6C5FEC1A-D8E1-45B8-A80A-B32F81392058@freebsd.org> References: <69f6b1ec.181e8.27d0b938@gitrepo.freebsd.org> To: "Stephen J. Kiernan" X-Mailer: Apple Mail (2.3864.400.21) X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] X-Rspamd-Queue-Id: 4g7v201yXCz3lPH X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated On 3 May 2026, at 03:24, Stephen J. Kiernan wrote: >=20 > The branch main has been updated by stevek: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3D01674e15dedb15f8ce498af0680c50bb= 075c5482 >=20 > commit 01674e15dedb15f8ce498af0680c50bb075c5482 > Author: Stephen J. Kiernan > AuthorDate: 2024-04-03 23:25:19 +0000 > Commit: Stephen J. Kiernan > CommitDate: 2026-05-03 02:21:56 +0000 >=20 > bsd.endian.mk: Optimize the handling of big/little endian = determination. >=20 > Add variables to contain lists of MACHINE_ARCH values to use > to determine little or big endian. >=20 > Only error out about not being able to determine endianess if > TARGET_ENDIANNESS is empty and not cross-compiling. >=20 > Reviewed by: sjg > Obtained from: Hewlett Packard Enterprise Development LP > Differential Revision: https://reviews.freebsd.org/D44629 > --- > share/mk/bsd.endian.mk | 39 +++++++++++++++++++++++++++++---------- > 1 file changed, 29 insertions(+), 10 deletions(-) >=20 > diff --git a/share/mk/bsd.endian.mk b/share/mk/bsd.endian.mk > index 0c5ebb7aeba2..2a617a1d2794 100644 > --- a/share/mk/bsd.endian.mk > +++ b/share/mk/bsd.endian.mk > @@ -1,20 +1,35 @@ >=20 > -.if ${MACHINE_CPUARCH} =3D=3D "aarch64" || \ > - ${MACHINE_CPUARCH} =3D=3D "arm" || \ > - ${MACHINE_ARCH} =3D=3D "amd64" || \ > - ${MACHINE_ARCH} =3D=3D "i386" || \ > - ${MACHINE_ARCH} =3D=3D "powerpc64le" || \ > - ${MACHINE_CPUARCH} =3D=3D "riscv" Losing MACHINE_CPUARCH makes me sad as a downstream that adds new MACHINE_ARCH for aarch64 and riscv. For riscv at least it=E2=80=99s now = riscv* which I guess is close enough, but for aarch64 it=E2=80=99s not = wildcarded. Similarly arm though I don=E2=80=99t care about that personally. > +MACHINE_ARCH_LIST.little =3D \ > + aarch64 \ > + amd64 \ > + armv7 \ > + i386 \ > + powerpc64le \ > + riscv* > + > +MACHINE_ARCH_LIST.big =3D \ > + powerpc \ > + powerpc64 > + > +.for e in big little > +N_$e:=3D ${MACHINE_ARCH_LIST.$e:${M_ListToSkip}} Should we be worried about catching MACHINE(_ARCH) being empty? Jessica > +.endfor > + > +# For the host, we need to look at the host architecture > +.if ${MACHINE:Nhost*} =3D=3D "" > +_ENDIAN_ARCH=3D${_HOST_ARCH} > +.else > +_ENDIAN_ARCH=3D${MACHINE_ARCH} > +.endif > + > +.if ${_ENDIAN_ARCH:${N_little}} =3D=3D "" > TARGET_ENDIANNESS=3D 1234 > CAP_MKDB_ENDIAN=3D -l > LOCALEDEF_ENDIAN=3D -l > -.elif ${MACHINE_ARCH} =3D=3D "powerpc" || \ > - ${MACHINE_ARCH} =3D=3D "powerpc64" > +.elif ${_ENDIAN_ARCH:${N_big}} =3D=3D "" > TARGET_ENDIANNESS=3D 4321 > CAP_MKDB_ENDIAN=3D -b > LOCALEDEF_ENDIAN=3D -b > -.elif ${.MAKE.OS} =3D=3D "FreeBSD" > -.error Don't know the endian of this architecture > .else > # > # During bootstrapping on !FreeBSD OSes, we need to define some value. = Short of > @@ -33,3 +48,7 @@ TARGET_ENDIANNESS=3D 1234 > CAP_MKDB_ENDIAN=3D -B # Poisoned value, invalid flags for both = cap_mkdb > LOCALEDEF_ENDIAN=3D -B # and localedef. > .endif > + > +.if empty(TARGET_ENDIANNESS) && ${.MAKE.OS} =3D=3D "FreeBSD" > +.error Don't know the endianness of this architecture > +.endif >=20