We already use the compiler's versions of these; this just moves from
having libc #include_next them to having libc just omit them entirely,
which is simpler.
This removes the special code to define musl's include guard, however
I originally added that when I was still working out how WASI's stddef.h
would interact with other code. I believe it's no longer important.
This isn't strictly required, as wasm SIMD loads and stores work on
unaligned memory. However, it may provide better performance. That said,
this isn't currently studied by any benchmarking.
The lseek optimization turns lseek calls into __wasilibc_tell calls when
possible, using macros and __builtin_constant_p. However, this isn't
safe in C++ code in the presence of namespaces and `using` declarations,
to just disable it in C++ for now.
For functions like sqrt, fabs, and others, use the builtin functions,
which provide single-instruction implementations, rather than using
musl's portable implementations.
My understanding is that these dummy libs represent libraries who's
contents, under musl, live in libc itself rather than being split out
into separate libs.
libc++/libc++abi are not provided my musl so doesn't make sense to
pretend that we provide them.
This replaces our custom `unlink` wrapper with an upstream one. We still
end up replacing the entire body with local changes, but this makes it
easier to see what those changes are.
The other change here is a fix to ignore repeated '/'s in paths.
WASI's values for SEEK_CUR, SEEK_SET, and SEEK_END differ from musl's
values, so fix musl code that bakes in knowledge of these values.
This fixes src/functional/memstream.c.
POSIX requires fcntl.h to define the SEEK_* macros, so this satisfies
that requirement. Also, this allows <stdio.h> to avoid including as much
unnecessary content.
This fixes one issue with src/api/fcntl.c.
These functions aren't specific to the underlying system call interface,
so they don't need to be in the "bottom half".
This also fixes src/functional/inet_pton.c and
src/regression/inet_pton-empty-last-field.c in musl's libc-test.
This was commented out earlier when timezone handling was more in flux,
but it's ok to minimally support this now.
This fixes src/functional/strftime.c in libc-test.
Initialize `environ` even if there are no environment variables, so that
it alwasy points to a NULL-terminated array even if that array just
contains the NULL. This fixes src/functional/env.c.
Remove build rules for $(SYSROOT) and $(SYSROOT_INC). The latter
becomes `include_dirs`. The former is not needed, instead just add
startup_files to the finish rule.