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



Izumi Tsutsui <tsutsui%ceres.dti.ne.jp@localhost> writes:

>> > 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.

Indeed, adding a "visibility define" not only ensures that everything
from that spec is present, but that everything not in that spec is not
present.

It's an interesting question what we really require, and if there should
be a set of visibility defines.  But, defining _GNU_SOURCE on Linux
seems like a reasonable approach to try.


Home | Main Index | Thread Index | Old Index