-
Notifications
You must be signed in to change notification settings - Fork 3.8k
DAWN-486 ⁃ WASM doesn't call constructor for globally initialized objects #518
Comments
➤ Corey Lederer commented: From Bart's comment on old ticket: FWIW, this is not the job of the Virtual Machine in the c++ spec. It is the job of the compiler tool-chain/runtime library. In compilers compatible with the GNU libc(++) runtimes the linker will produce __CTOR_LIST__ and __DTOR_LIST__ symbols and the runtime entry point (which isn't actually "main") will call those and then call "main". The runtime dependency in implementing this that way is a working "atexit" function to call the __DTOR_LIST__ We don't actually use EMSCRIPTEN to compile our wasm. That is the glue between WASM and a browser, that provides all of these runtime features. We would need to emulate what they did to support some of these things. |
@brianjohnson5972 is this issue still relevant? |
@spoonincode What is the state of this issue with our current supported libraries? |
This should be working with eosio.cdt afaik |
eosio.cdt fixes these issues. |
If the following code is included in wasm and run, it passes, since it appears that objects allocated in global space are just initialized to 0 and doesn't run the ctor.
Found emscripten-core/emscripten#5391, so we may need to get a more recent emscripten.
The text was updated successfully, but these errors were encountered: