Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PostEmscripten: Preserve __em_js__ exports (and data) in side modules #5780

Merged
merged 1 commit into from
Jun 23, 2023

Conversation

sbc100
Copy link
Member

@sbc100 sbc100 commented Jun 23, 2023

No description provided.

sbc100 added a commit to emscripten-core/emscripten that referenced this pull request Jun 23, 2023
This works in a similar way to EM_ASM. See #18228.

Depends on WebAssembly/binaryen#5780
@sbc100 sbc100 changed the title PostEmscripten: Preserve __em_js__ exports in side modules PostEmscripten: Preserve __em_js__ exports (and data) n side modules Jun 23, 2023
@sbc100 sbc100 changed the title PostEmscripten: Preserve __em_js__ exports (and data) n side modules PostEmscripten: Preserve __em_js__ exports (and data) in side modules Jun 23, 2023
@sbc100 sbc100 requested a review from tlively June 23, 2023 03:38
@sbc100
Copy link
Member Author

sbc100 commented Jun 23, 2023

Added some testing

(export "__start_em_asm" (global $em_asm_start))
;; CHECK: (export "__stop_em_asm" (global $em_asm_stop))
(export "__stop_em_asm" (global $em_asm_stop))
(export "__start_em_js" (global $em_js_start))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this one not preserved in the output?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For EM_ASM we use the global start/stop symbols and split the resulting string on NULL.

For EM_JS each string is exported via its own global export e.g. __em_js__foo so we don't need the start/stop symbols.

@sbc100 sbc100 merged commit 1545deb into main Jun 23, 2023
11 checks passed
@sbc100 sbc100 deleted the side_modules branch June 23, 2023 16:57
sbc100 added a commit to emscripten-core/emscripten that referenced this pull request Jun 24, 2023
This works in a similar way to EM_ASM. See #18228.

Depends on WebAssembly/binaryen#5780
sbc100 added a commit to emscripten-core/emscripten that referenced this pull request Jun 24, 2023
This works in a similar way to EM_ASM. See #18228.

Depends on WebAssembly/binaryen#5780
sbc100 added a commit to emscripten-core/emscripten that referenced this pull request Jun 26, 2023
This works in a similar way to EM_ASM. See #18228.

Depends on WebAssembly/binaryen#5780
sbc100 added a commit to emscripten-core/emscripten that referenced this pull request Jun 26, 2023
This works in a similar way to EM_ASM. See #18228.

Depends on WebAssembly/binaryen#5780
sbc100 added a commit to emscripten-core/emscripten that referenced this pull request Jun 26, 2023
This works in a similar way to EM_ASM. See #18228.

Depends on WebAssembly/binaryen#5780
sbc100 added a commit to emscripten-core/emscripten that referenced this pull request Jun 26, 2023
This works in a similar way to EM_ASM. See #18228.

Depends on WebAssembly/binaryen#5780
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants