Re: git: 783c318fd118 - main - zoneinfo: On amd64, include 32-bit data.

From: Jessica Clarke <jrtc27_at_freebsd.org>
Date: Wed, 25 Jan 2023 16:37:04 UTC
On 25 Jan 2023, at 16:22, Dag-Erling Smørgrav <des@FreeBSD.org> wrote:
> 
> Jessica Clarke <jrtc27@freebsd.org> writes:
>> Dag-Erling Smørgrav <des@FreeBSD.org> writes:
>>>   zoneinfo: On amd64, include 32-bit data.
>> I’m not sure how this makes sense. Isn’t the file format entirely MI?
> 
> It's not machine independent so much as multi-target.  The file
> structure is basically:
> 
>    32-bit header
>    32-bit data
>    64-bit header
>    64-bit data
> 
> Recent versions leave out the 32-bit data unless you pass -b fat on the
> command line.  To a legacy binary, that looks like a valid file (the
> 32-bit header is still present) with no transitions.

But the 64-bit version is machine independent, it’s just not compatible
with old consumers. And those old consumers can be run on i386 (jail or
full system), not just amd64 with lib32, and will need the 32-bit data
just as much, yet won’t have it. Which is what my point was in the rest
of my previous email that you chopped off when replying.

I think this really needs to be

.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386"

(or the same with MACHINE_CPUARCH to be more forward-thinking)

Though -b fat governs things other than whether you get 32-bit data,
namely working around bugs in older versions, which may well apply to
non-x86 architectures. So probably we should just do the same thing on
every architecture (unless you want to go and figure out when each
architecture entered FreeBSD and when each bug worked around got fixed,
though probably at least some of them were in the recent import) so as
to not get weird edge-case failures on non-x86, as it can be a pain to
deal with failures that only show up on non-x86 but are from the
configuration not the architecture.

Jess