On 2018/11/27 19:36, George Koehler wrote:
> On Tue, 27 Nov 2018 16:12:08 -0500
> George Koehler <kern...@gmail.com> wrote:
> 
> > NetBSD's packages of gcc5 and gcc7 do contain the headers from float.h
> > to stdatomic.h (or most of them).  I haven't found the reason why
> > NetBSD keeps those headers and OpenBSD doesn't.
> 
> Found it!
> 
> $ cat gcc-6.4.0/gcc/config/t-openbsd
> # We don't need GCC's own include files.
> USER_H = $(EXTRA_HEADERS)
> 
> This t-openbsd gets enabled by gcc-6.4.0/gcc/config.gcc and then
> included by build-powerpc/{prev-gcc,gcc}/Makefile so it overrides
> USER_H.  The effect is to remove gcc's float.h, iso646.h, stdarg.h,
> stdbool.h, stddef.h, varargs.h, stdfix.h, stdnoreturn.h, stdalign.h,
> stdatomic.h from the compiler.
> 
> The obvious fix (though I haven't tried it) is to remove this USER_H
> override, either by commenting it or by patching config.gcc to ignore
> t-openbsd.  Most platforms don't override USER_H.  (The only other
> platform to override USER_H is config/mips/t-sdemtk, but its
> override looks outdated to me.)

This fix seems like the right approach in general to me, I think this
is definitely worth trying.

> Another option is to keep the USER_H override and add only the 4
> headers stdfix.h, stdnoreturn.h, stdalign.h, stdatomic.h.  This may
> become outdated if a future version of gcc adds more headers.

That sounds like it's asking for future trouble.

> Another option is to add the 4 headers to base OpenBSD.  If there
> is some reason why /usr/include has its own float.h, iso646.h, and so
> on, then the same reason might be why to add the 4 headers.

I'm not sure if it's the same for all of these headers, but stdatomic.h
in particular seems much more tightly bound to the compiler than to
the OS.

> gcc also has its own stdint.h, but doesn't use it on OpenBSD, because
> config.gcc defaults to use_gcc_stdint=none and has no code to enable
> it on OpenBSD.
> 
> For comparison, ports-clang (pkg_info -L llvm) seems to package its
> own float.h, iso646.h, and so on, and its own stdint.h; while
> base-clang seems to omit headers that exist in /usr/include.

It does for some but not others. diff -wu of iso646.h, for example,
differs only in whitespace, copyright/PD notice, and double-inclusion
protection macro..

Reply via email to