This was triggered by gcc for some reason It included sys/types.h and
assumed sys/select.h to be there. And that seams to be the case in musl.
The problem with relibc here is that sys/types.h is are part of relibc
"include/*.h" files, while sys/select.h is generated by cbindgen. That
makes it impossible to #include select.h in types.h epsecially that
there are files like fcntl.c that uses types.h. They would complain
about missing headers. I fixed this by renaming sys/types.h to
sys/types_internal.h and then generating types.h using cbindgen as well
except for that. however fcntl and dlmalloc can include types_internal
instead of types.h
The problem here is that _Bool type is not defined in C++ yet this file
is using it. That leads to issues when compiling gcc. I borrowed the
same techniques used in other stdbool.h
This patch implements sys/user.h file that works for both x86_64 as well
as aarch64. This include file is used by sys/procfs.h which is needed
dependency for binutils. There is bug in this patch in aarch64 implementation
which is the lack of f128 implementation in rust, thus we can't create cbinding
for long double.
I faced many issues when compiling libstdC++-V3 and linking against
relibc mainly:
- Missing types (max_align_t)
- Different types definitions(ptrdiff_t , size_t)
- and the fact that wchar_t is part of standard C++ and it seams that we
canno redefine standard types
Typically with libc implementations, wchar_t and co are either defined
entirely by the libc or, under libc's arrangement, by headers supplied
by the compiler.
Things like dlmalloc in relibc need these definitions from relibc itself
and that's already already furnished by relibc's stddef.h.
These additional definitions here are redundant and collide with
compiler headers - for example: onig_sys (something that uutils depends
on) breaks. Instead, this patch makes the compiler headers define
things appropriately.