aboutsummaryrefslogtreecommitdiff
path: root/src/stage1/codegen.cpp
diff options
context:
space:
mode:
authorCody Tapscott <topolarity@tapscott.me>2022-03-01 10:41:38 -0700
committerCody Tapscott <topolarity@tapscott.me>2022-04-18 10:19:34 -0700
commit922d8378e724063063e709223e90e3a577e4566a (patch)
tree5f9dc11661b8a954c41e59ad9a286bda899c6f3c /src/stage1/codegen.cpp
parentf8d2b87fa122a948e2c8e1056e2ec4cfd4cf01bf (diff)
downloadzig-922d8378e724063063e709223e90e3a577e4566a.tar.gz
zig-922d8378e724063063e709223e90e3a577e4566a.zip
stage2: Add limited WASI support for selfExePath and globalCacheDir
This change adds support for locating the Zig executable and the library and global cache directories, based on looking in the fixed "/zig" and "/cache" directories. Since our argv[0] on WASI is just the basename (any absolute/relative path information is deleted by the runtime), there's very limited introspection we can do on WASI, so we rely on these fixed directories. These can be provided on the command-line using `--mapdir`, as follows: ``` wasmtime --mapdir=/cwd::. --mapdir=/cache::"$HOME/.cache/zig" --mapdir=/zig::./zig-out/ ./zig-out/bin/zig.wasm ```
Diffstat (limited to 'src/stage1/codegen.cpp')
0 files changed, 0 insertions, 0 deletions