[tz] A small first step in merging NetBSD changes into tzcode

Paul Eggert eggert at cs.ucla.edu
Thu Jan 5 01:03:05 UTC 2023

On 2023-01-02 16:55, Paul Eggert via tz wrote:
>>> By the way, I'd been meaning to try to sync tzdb localtime.c with 
>>> NetBSD's at some point. Shouldn't be that hard, I'd think, and might 
>>> help get bugs fixed faster (in both directions).
>> That would be great!
> OK, thanks, I'll add that to my list of things to do.

I took a look at that and saw there are quite a few changes and NetBSD 
has some gimmicks to deal with old binaries with 32-bit time_t (is that 
still relevant?) so I decided to start with something simpler, namely 
zdump.c. I compared NetBSD zdump.c to tzcode and saw one improvement in 
NetBSD which used a NetBSD-specific function, and recoded that in 
standard POSIX by installing the attached patch into tzdb.

However, before going further I wanted to test whether this compiles for 
NetBSD. Unfortunately the build instructions for NetBSD, which say to 
run this to build on (say) Fedora x86-64:

   # https://www.netbsd.org/docs/guide/en/chap-build.html#chap-build-release
   ./build.sh -U -u -j4 -m amd64 -O ~/obj release

do not seem to build a zdump command. And I'm a little puzzled about how 
to build incrementally (e.g., if I change one source file how can I just 
build from that change). What I really want to do is just compile the 
stuff in netbsd/src/lib/libc/time without compiling anything else.

So, a dumb question: how should I build zdump and zic on NetBSD, if I'm 
cross-compiling like the above. Also, how can I build just the 
src/lib/libc/time stuff?

(I was doing the above with NetBSD source 
<https://github.com/NetBSD/src> commit 
44b804de4eb23cf464c343e250f4c7da21751aa7 dated today at 06:04:07 UTC.)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Prefer-fprintf-strerror-to-perror.patch
Type: text/x-patch
Size: 1849 bytes
Desc: not available
URL: <http://mm.icann.org/pipermail/tz/attachments/20230104/0eed15e7/attachment.bin>

More information about the tz mailing list