Repository navigation
Conversation
When `--pass-arg=fpcast-emu-export-thunks` is passed to `fpcast-emu`, export an `(i64 x 16) -> i64` thunk named `fpcast$<export>` alongside each original function export by reusing the thunk in `funcThunks`. Skip imports, `dynCall_*` and `fpcast$*` exports, and non-function exports, and unwrap `orig$` suffixes so both direct and `orig$` export pairs share the corresponding `fpcast$` thunk export. This enables dynamic linkers such as Emscripten to resolve uniform function pointer targets across `MAIN_MODULE` and `SIDE_MODULE` exports while preserving original direct-call exports.
fpcast$ thunks for dynamic linkingfpcast$ thunks for dynamic linking
tlively
reviewed
Nov 23, 2026
tlively
reviewed
Nov 23, 2026
Move the `--pass-arg=fpcast-emu-export-thunks` export loop out of `FuncCastEmulation::run` into `exportThunks`, and deduplicate the `funcThunks` lookup between table elements and exports via `getThunk`.
sbc100
force-pushed
the
fpcast-emu-export-thunks
branch
from
November 24, 2026 00:31
f5cf6fa to
22969e7
Compare
This branch has not been deployed
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.
When
--pass-arg=fpcast-emu-export-thunksis passed tofpcast-emu, export an(i64 x 16) -> i64thunk namedfpcast$<export>alongside each original function export by reusing the thunk infuncThunks.Skip imports,
dynCall_*andfpcast$*exports, and non-function exports, and unwraporig$suffixes so both direct andorig$export pairs share the correspondingfpcast$thunk export.This enables dynamic linkers such as Emscripten to resolve uniform function pointer targets across
MAIN_MODULEandSIDE_MODULEexports while preserving original direct-call exports.