Skip to content

Conversation

@sbc100
Copy link
Member

@sbc100 sbc100 commented Nov 26, 2025

In the past emscripten would build the main module as relocatable, but these days we build it statically and in that case it makes sense for the main module to define and export these globals, rather than defining them in JS.

@sbc100 sbc100 requested a review from kripken November 26, 2025 23:10
@sbc100 sbc100 force-pushed the asyncify_export_globals branch 2 times, most recently from c147040 to a0f5fb1 Compare November 26, 2025 23:17
In the past emscripten would build the main module as relocatable, but
these days we build it statically and in that case it makes sense for
the main module to define and export these globals, rather than defining
them in JS.
auto verbose = hasArgument("asyncify-verbose");
auto relocatable = hasArgument("asyncify-relocatable");
auto importGlobals = hasArgument("asyncify-relocatable");
auto exportGlobals = hasArgument("asyncify-export-globals");
Copy link
Member

Choose a reason for hiding this comment

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

These flags should be documented in the comment earlier, among the other docs.

auto asserts = hasArgument("asyncify-asserts");
auto verbose = hasArgument("asyncify-verbose");
auto relocatable = hasArgument("asyncify-relocatable");
auto importGlobals = hasArgument("asyncify-relocatable");
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
auto importGlobals = hasArgument("asyncify-relocatable");
auto importGlobals = hasArgument("asyncify-relocatable");

Maybe relocatable => import-globals for symmetry?

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