-
Notifications
You must be signed in to change notification settings - Fork 747
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
Module splitting and multiple tables #7047
Comments
What might be happening is that |
That could make sense; it would require wasm-split (and Binaryen more generally) to accept a new form of argument. Currently there are the generic flags such as Separately I'm also looking at fixing wasm-split's multi-table output to work with emscripten's JS, since we might as well take advantage of multiple tables. |
The enabled features should always be the full set of features that the module is allowed to use, whether or not it actually does. In other words, As @kripken mentioned, Emscripten reads the target features section and turns those into a set of feature flags to pass to Binaryen, so in theory the target features section should already be in sync with the feature flags, whether or not the target features section is stripped. |
I discovered a couple of things while working on some unrelated stuff (enabling bulk memory and nontrapping-fp by default).
While doing that I wrote #7043 to make testing on the emscripten side easier and to make the current default behavior consistent with what will be the default when we enable bigint by default (and thus stop running wasm-emscripten-finalize by default). Namely, linked binaries will contain target_feature sections by default.
I discovered that the presence of that section affects the behavior of module splitting (and probably beyond):
features.hasReferenceTypes()
and friends now returns true, since LLVM is now enabling reference types. This somewhat weird by itself, since the presence of the section is what controls this, and not whether e.g. there are actually multiple tables (orexnref
etc) or flag/configuration, and because emscripten has historically stripped that section most (but not all!) of the time. Probably we should do something about that, but I'm not 100% sure what; maybe if the feature section is missing, we could set those feature flags when we encounter module properties that imply them? or maybe fall back to which features are enabled on the command line? maybe that will depend on the particular use offeatures.hasFoo()
, I'm not sure how pervasive those uses are but if they are common it seems like we should maybe be more robust.But more to the immediate point, #7043 also caused the roll into emscripten to fail because emscripten's use of module splitting doesn't seem to support multiple tables (there is a JS loading failure I haven't exactly diagnosed yet). I think this is also going to block enabling the features by default, so we will either need to fix emscripten's loading JS, or make a way for emscripten to disable multiple tables for now, so we can separate the problem of feature enablement from updating for multiple tables.
The text was updated successfully, but these errors were encountered: