Commit Graph

27 Commits

Author SHA1 Message Date
Andrew Kelley
876ab99f5c disable package manager code when bootstrapping
This makes building from source go faster and avoids tripping over
unimplemented things in the C backend.
2023-01-11 15:39:49 -08:00
Andrew Kelley
23b1544f6c update zig1.wasm for MSVC compatibility 2023-01-02 14:09:26 -07:00
Veikka Tuominen
b7730c7478 update zig1.wasm to overflow arithmetic builtin changes 2022-12-27 15:13:14 +02:00
Veikka Tuominen
2a5e1426aa update zig1.wasm to builtin.Type field changes 2022-12-18 13:31:38 +01:00
Veikka Tuominen
51ed5416ab update zig1.wasm to @call changes 2022-12-13 13:14:20 +02:00
Andrew Kelley
d10fd78d46 update zig1.wasm
This includes the latest changes from master branch with fixes to the C
backend that affect aarch64-windows which are necessary to build from
source on this target.
2022-12-10 16:28:49 -07:00
Veikka Tuominen
89d1ccc477 replace zig1.wasm to the removal of BoundFn
This also no longer uses zstd compression on this file. The reasoning
for this is:

 * It has been demonstrated that the release tarballs are actually
   smaller if zig1.wasm gets compressed along with the other files
   rather than separately compressed.

 * More importantly, leaving zig1.wasm uncompressed may result in a
   smaller git repository size, since the repository as a whole could
   have savings across the multiple versions of zig1.wasm, which would
   not be possible if each one was independently compressed.

 * When in doubt, do what is simpler, which is to not have this extra
   zstd mechanism. This will remove the only "vendored" code from our
   build process, which is a nice property to have.

Co-authored-by: Andrew Kelley <andrew@ziglang.org>
2022-12-09 20:59:13 -07:00
Andrew Kelley
c51288f1f6 remove the zstd mechanism from the build process 2022-12-09 20:59:13 -07:00
Jacob Young
6966fb8ca5 wasm2c: reuse locals
* Reduce stack usage of a -O0 build of zig1 by 33%.
 * Avoid compiler builtin calls.
2022-12-09 03:45:29 -05:00
Andrew Kelley
9627018d0c build: obtain zigcpp library prefix/suffix from cmake 2022-12-07 01:44:15 -07:00
Andrew Kelley
20d86d9c63 add zig1.wasm.zst
This commit adds a 637 KB binary file to the source repository. This
commit does nothing else, so it should be replaced with a different
commit before this branch is merged to avoid bloating the git
repository.
2022-12-06 12:27:28 -07:00
Jacob Young
3683602226 wasm2c: improve amortized speed of memory.grow 2022-12-06 12:27:28 -07:00
Jacob Young
793db27805 wasi: add support for windows paths 2022-12-06 12:27:28 -07:00
Jacob Young
5dbd28f171 wasm2c: support memory.copy with overlapping buffers 2022-12-06 12:15:05 -07:00
Jacob Young
9f4ef4de23 wasm2c: remove unnecessary brackets to reduce max bracket depth
This avoids the need to pass `-fbracket-depth=512` to clang.
2022-12-06 12:15:04 -07:00
Jacob Young
ce4e5fee63 wasm2c: avoid aliasing issues on memory access 2022-12-06 12:15:04 -07:00
Jacob Young
e000db2782 wasi: implement file truncation
The way this is implemented destroys the contents of the file, so
revisit if this causes issues in the future.
2022-12-06 12:15:04 -07:00
Jacob Young
1263346774 use zig-wasm2c for bootstrapping 2022-12-06 12:15:04 -07:00
Andrew Kelley
9b8cf13c00 zig1.c: remove executable bit
This was set on accident.
2022-12-06 12:15:04 -07:00
Andrew Kelley
6337808e65 update zig1.c to latest zig-wasi 2022-12-06 12:15:04 -07:00
Matt Knight
e9d9be2902 Some fixes for the wasi interpreter for macOS (#13587)
* Remove usage of O_PATH, ifdef for macos stat struct, and integer formatting
2022-12-06 12:15:04 -07:00
Andrew Kelley
33e3db11fe zig1.c: autodetect host target triple
instead of assuming x8_64-linux in CMake
2022-12-06 12:15:04 -07:00
Andrew Kelley
34e9bbb9d4 enable the LLVM backend in stage2
This takes a bit longer since the interpreted part has to do more work
but it saves a round trip through the compiler by allowing `zig2 build`
to be the final step. 1-2-3, done.

For me this is currently failing due to compilation errors generated by
GCC when compiling zig2.c but in theory if those are fixed, it should
work!
2022-12-06 12:15:04 -07:00
Andrew Kelley
fb9a6084e2 zig1.c: decompress zig1.wasm.zst with zstd 2022-12-06 12:15:04 -07:00
Andrew Kelley
d1b3409df1 add zstd v1.5.2
only the decompression files
2022-12-06 12:15:04 -07:00
Andrew Kelley
39fd77bc16 interpret the WASI blob to produce zig2.c and compiler_rt.c
* synchronize zig1.c from zig-wasi external project
 * change the way argv works to avoid absolute paths
 * autodetect isatty
 * compiler_rt: disable some functions when object format is C
 * add missing flag from config.zig.in

The next problem is that compiling compiler_rt.c with gcc gives
"conflicting types" errors for `__eqhf2` and friends.
2022-12-06 12:15:04 -07:00
Andrew Kelley
ef447c3eca redo CMakeLists.txt to use WASI interpreter
current status is that it hits error: OutOfMemory for unknown reasons,
probably due to bugs in the C WASI interpreter port.
2022-12-06 12:15:04 -07:00