Skip to content

Instantly share code, notes, and snippets.

@matu3ba
Created January 22, 2023 01:39
Show Gist options
  • Save matu3ba/8ac61b3325ca38b87d026668140326e2 to your computer and use it in GitHub Desktop.
Save matu3ba/8ac61b3325ca38b87d026668140326e2 to your computer and use it in GitHub Desktop.
Bootstep Zig from wasm file
wasm2.c ──────►┌──────┐   ┌──────┐   ┌────┐   ┌──────┐   ┌────┐   ┌────┐   ┌────┐
               │wasm2c│──►│zig1.c│──►│zig1│──►│zig2.c│──►│zig2│──►│zig3│──►│zig4│
          ┌───►└──────┘ ┌►└──────┘┌─►└────┘   └──────┘┌─►└────┘   └────┘   └────┘
          │  zig1.wasm ─┘         │                   │     ▲        ▲        ▲
CC ───────┴───────────────────────┴───────────────────┘     │      binary-identical
                                                            │
idealized, see TODO:                                        │(optional)
used LLVM libs ─────────────────────►┌────┐                 │
                                     │LLVM│─────────────────┘
CXX ────────────────────────────────►└────┘

CC = host c compiler: clang/gcc/msvcc/tcc or zig cc build with zig-bootstrap(clang)
CXX = host c++ compiler: clang++/g++/msvcc or zig c++ build with zig-bootstrap(clang++)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment