Commit Graph

7 Commits

Author SHA1 Message Date
Shawn Landden
bbfb53d524 c: add fma and fmaf 2019-06-19 12:07:02 -05:00
Shawn Landden
720ed74413 add bcmp implementation as LLVM 9 now emits those
The optimizer will now convert calls to memcmp into a calls to bcmp
in some circumstances. Users who are building freestanding code (not
depending on the platform’s libc) without specifying -ffreestanding may
need to either pass -fno-builtin-bcmp, or provide a bcmp function.

http://llvm.org/docs/ReleaseNotes.html#non-comprehensive-list-of-changes-in-this-release
2019-06-08 17:24:30 -04:00
Andrew Kelley
01a4897da5
improve the libc of wasm32-freestanding target
* introduce wasm32-freestanding-musl .h files to fix
   conflicts with stddef.h and errno.h
 * fix an issue with zig build system regarding installation of
   webassembly libraries
 * add implementations to zig's libc:
   - strcmp
   - strncmp
   - strerror
   - strlen

See #514
2019-05-29 20:32:27 -04:00
emekoi
1c73c08298 ran zig fmt on stdlib 2019-05-19 16:33:31 -04:00
Andrew Kelley
978fab817c
the wasm freestanding _start function is return value void 2019-05-16 14:19:13 -04:00
Andrew Kelley
81e960eb74
improvements to build-lib use case of WebAssembly
* build-exe does include the startup code that supplies _start for the
   wasm32-freestanding target. Previously this did not occur because
   of logic excluding "freestanding".
 * build-lib for wasm32-freestanding target gets linked by LLD. To avoid
   infinite recursion, compiler_rt and zig libc are built as objects
   rather than libraries.
   - no "lib" prefix and ".wasm" extension instead of ".a". Rather than
   build-lib foo.zig producing "libfoo.a", now it produces "foo.wasm".
 * go back to using `.o` extension for webassembly objects
 * zig libc only provides _start symbol for wasm when linking libc.
2019-05-16 13:56:56 -04:00
Andrew Kelley
14cdb01f35 improvements to zig's implementation of libc and WebAssembly
* rename std/special/builtin.zig to std/special/c.zig
   not to be confused with @import("builtin") which is entirely
   different, this is zig's multi-target libc implementation.
 * WebAssembly: build-exe is for executables which have a main().
   build-lib is for building libraries of functions to use from,
   for example, a web browser environment.
   - for now pass --export-all for libraries when there are any
     C objects because we have no way to detect the list of exports
     when compiling C code.
   - stop passing --no-entry for executables. if you want --no-entry
     then use build-lib.
 * make the "musl" ABI the default ABI for wasm32-freestanding.
 * zig provides libc for wasm32-freestanding-musl.
2019-05-15 20:14:58 -04:00