This is split out from the LTO change. It's needed by the LTO build so
that we can easily build these files in non-LTO mode, since they satisfy
calls emitted by LLVM codegen after LTO.
Use wasm's builtin min and max operators to implement libc `fmin`,
`fmax, `fminf`, and `fmaxf`, by handling the NaN cases explicitly.
Credit to https://github.com/emscripten-core/emscripten/pull/9689
for spotting this opportunity!
For now, this means using `//`-style comments in .c source files (though
not public header files), and spaces rather than tabs. No strong opinion
here; this is just what the majority of the current code is using.
This also synchronizes basics/crt/crt1.c with libc-bottom-half's
version, though this is just a cleanup as the former isn't currently used
by the main wasi-libc build.
For functions like sqrt, fabs, and others, use the builtin functions,
which provide single-instruction implementations, rather than using
musl's portable implementations.
Musl's generic definitions for PRIxPTR and several others in
<inttypes.h> are incorrect for wasm, so introduce a new <inttypes.h>
and <__header_inttypes.h> in the basics module using compiler-provided
definitions.
Fixes#13.
* Fix ssize_t redefinition mismatch.
Align definition with comment and previous define in __typedef_ssize_t.h
* Fix __typedef_ssize_t.h, redundancy in sys/types.h
This populates the repo with a very minimal set of files. This is just
enough to set out a basic outline. Hopefully as we move forward we'll
be replacing many of these parts, but this is just something basic to
get things started.
This tree isn't really usable yet, as it doesn't yet have an easy way
to obtain a compiler-rt/libgcc build.