Repository navigation
wasm32 bundles: built by stage1, embedded beside the host's, selected by target (#2131) - #2260
Merged
Merged
Conversation
`:cross-rt-wasm` now builds the four corpus bundles for wasm32 beside the wasm32 runtime objects, by stage1 as the host bundles are (there is no wasm32 cross compiler to build them with the release), into out/wo/wasm32 and the store slot <name>/wasm32-<abi>. Verified: `src/main build :cross-rt-wasm` produced pcre2, zlib, c_algorithms and tommyds .o/.wi/ .manifest with `target wasm32` in 253s, and a cached rerun in 29s. The loops index with the i64 `len()` returns (D11); no cast.
…ed by target; the wasm runtime provides the corpora's libc externs (#2131 layer 2) Bundle slots were keyed by name only, one per corpus, so a `--target wasm32` link of a std.regex program met the darwin pcre2 bundle and was refused. Now: - build: the stage and release embeds carry the wasm32 plans' blobs under `wo_<name>_wasm32_*`; stage1's embed has the matching empty slots; the index generator takes `<name>@<target>` entries and emits `embedded_bundles_target_data(index)` ("" is the compiler's own target). - compiler: `embedded_bundle_for_this_target(index)`; the link stage's selection, Compilation's interface registration and Resolve's provider lookup skip a slot carried for another target (D39: an interface is its target's; two under one module identity would be refused as #2248 does). - rt/wasm.w provides the thirteen libc symbols the migrated corpora declare (the ctype family and memchr), in With, C locale, under their C names through FnAbi's wasm libc-provider list; the ABI hash is re-recorded (no convention change). Verified with the pinned seed: full build green, fixpoint through the chain, `nm` shows the wasm32 slots in the release, a native std.regex program links and runs unchanged, `hello.w --target wasm32` runs under node, `:wasm-tests` 6 files ok. A std.regex program for wasm32 now links and runs and returns false for every match: #2131 item 4 (the corpus's 64-bit model on 32-bit pointers), recorded on the issue with the repro. Loops index with the i64 len() returns; no casts added.
Contributor
Author
|
Battery GREEN on d19f7a3 (tools/battery.w: gate 41s, uat 28s, battery-checks 876s; status.txt has no RED). Main moved only by docs-only merges since the branch point (D108). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#2131 layers 1 and 2.
Layer 1:
:cross-rt-wasmbuilds the four corpus bundles for wasm32 (by stage1, as the host's are) into out/wo/wasm32 and the store.Layer 2: the native release carries the wasm32 bundles beside its own (
wo_<name>_wasm32_*blobs,<name>@wasm32index entries withembedded_bundles_target_data); the link stage, interface registration and import resolution select a bundle by target. rt/wasm.w provides the corpora's thirteen libc externs (ctype family, memchr) in With under their C names (FnAbi's wasm libc-provider list; ABI hash re-recorded, no convention change).Evidence: full build and fixpoint green under the pinned seed;
nmshows the wasm32 slots in the release; a native std.regex program links and runs unchanged;hello.w --target wasm32runs under node;:wasm-tests6 files ok. A std.regex program for wasm32 links and runs and returns false for every match: item 4 (64-bit corpus model on 32-bit pointers), recorded on the issue with the repro; not claimed fixed here.Not in this PR: item 3 (the release carrying the wasm32 runtime objects; today
WITH_RUNTIME_ROOT=out/lib), the SDK path resolving from the tree rather than the cwd, item 4, item 5. Gate and battery to follow.