Re: Host requirements to build the Tools binaries

Izumi Tsutsui <[email protected]> Wed, 14 Aug 2024 09:43:47 +0900
Newsgroups gmane.os.netbsd.devel.toolchain
Message-ID <[email protected]>
> Building with latest Debian "unstable" containers doesn't work for me
> right now, as strptime() (used in bin/date/date.c) isn't made visible
> through features.h pulled in via tools/compat/compat_defs.h .  After
> discussing this topic a bit with Christos, he suggested to bring up
> this discussion on tech-toolchain.

IIRC glibc2 requires "-D_GNU_SOURCE" (or "-D_XOPEN_SOURCE") for
XPG4 strptime(3):
 https://manpages.ubuntu.com/manpages/trusty/man7/feature_test_macros.7.html
 https://sourceware.org/git/?p=glibc.git;a=blob;f=time/time.h;hb=f2bea4da2e65b5d91a23a01fb2062bcec33974aa#l213
 https://sourceware.org/git/?p=glibc.git;a=blob;f=include/features.h;h=650d4c5e129518dbec0d6d4eecf9d7ebff7fdfd5;hb=f2bea4da2e65b5d91a23a01fb2062bcec33974aa

#ifdef __GNU_LIBRARY__
#define _GNU_SOURCE
#endif
in compat_defs.h etc. will work?

BTW it looks strptime(3) is also in POSIX.1-2008:
 https://pubs.opengroup.org/onlinepubs/9699919799/functions/strptime.html

---
Izumi Tsutsui