tech-toolchain archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: Host requirements to build the Tools binaries
> > So this boils down to: What APIs / standards does NetBSD (while
> > building `tools`) expect to be implemented?
> >
>
> strptime is marked as XSI[1], so you'll need to add `_XOPEN_SOURCE' as the
> man-page on Linux indicates (either on the cmd. line, or before any headers
> are included, or in the very first header read as tsutsui@ said):
>
> [1] https://pubs.opengroup.org/onlinepubs/9699919799/functions/strptime.html
On Linux (actually glibc2), _XOPEN_SOURCE expand declarations to add
XPG4 functions etc.
On NetBSD (and FreeBSD and OpenBSD), _XOPEN_SOURCE restricts declarations
to disallow NetBSD or GNU extensions.
Then several packages require extra -D_NETBSD_SOURCE definitions to
allow such functions on NetBSD.
https://github.com/NetBSD/src/commit/4be7a2dcf395bcf0739f131315b64970d74b265e
It looks _GNU_SOURCE on glibc2 allows all declarations including
XPG4 and POSIX etc. as our _NETBSD_SOURCE does.
Note OpenBSD changed their _OPENBSD_SOURCE (like our _NETBSD_SOURCE)
to _BSD_SOURCE, probably as old glibc2 did:
https://github.com/openbsd/src/commit/431045e8b96f00cdfe3ad00cae059bf4e15e90fa
however it looks glibc2 deprecated the _BSD_SOURCE and
prefered _GNU_SOURCE (as described above):
https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=59dd864187ee61b6f0bfd7abc85e2fea4b479cb7#patch4
https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=c941736c92fa3a319221f65f6755659b2a5e0a20#patch3
---
Izumi Tsutsui
Home |
Main Index |
Thread Index |
Old Index