Open shym opened 2 months ago
to me, this looks fine. I'm curious whether other systems need this as well? especially OpenBSD?
I expected so too but, at least on OpenBSD 7.3, stdatomic.h
is in the Clang resources and I could compile the OCaml 5.2 runtime which needs this header with the current solo5
package.
The reason may be that the gen_headers.sh
does a cd /usr/include
and cc -M float.h stddef.h stdint.h stdbool.h stdarg.h
to figure out all dependencies of these header files -- eventually an OpenBSD system includes atomic.h/stdatomic.h in these dependencies...
hmm, on a OpenBSD 7.4 system I have access to, there's just no atomic.h, neither a stdatomic.h... but a sys/atomic.h -- and the cc -M
doesn't show it up... well, I don't have insights into the OCaml configure, but if it works without copying stuff, that's fine :)
On an OpenBSD 7.5, I see:
$ echo '#include <stdatomic.h>' > test.c
$ cc -H -c test.c
. /usr/lib/clang/16/include/stdatomic.h
[...]
This PR adds
stdatomic.h
to the set of headers that must be copied over from/usr/include
on FreeBSD because it is not included in the clang resources on that system.stdatomic.h
is not listed in the C standard as a freestanding header but many atomic operations (in particular all the atomic operations the OCaml runtime uses) are really compiler builtins.