Skip to content

Commit

Permalink
Make sure pal_icushim_static.c is linked in even if no symbols are us…
Browse files Browse the repository at this point in the history
…ed from it, so the EMSCRIPTEN_KEEPALIVE functions in it are actually kept. (dotnet#48550)
  • Loading branch information
vargaz authored Feb 22, 2021
1 parent e56b35c commit 3473d30
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,16 @@ EMSCRIPTEN_KEEPALIVE int32_t mono_wasm_load_icu_data(void * pData)
return 1;
}
}

/*
* driver.c calls this to make sure this file is linked, otherwise
* its not, meaning the EMSCRIPTEN_KEEPALIVE functions above
* are not kept.
*/
void mono_wasm_link_icu_shim(void)
{
}

#endif

int32_t GlobalizationNative_LoadICU(void)
Expand Down
4 changes: 4 additions & 0 deletions src/mono/wasm/runtime/driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -466,11 +466,15 @@ mono_wasm_register_bundled_satellite_assemblies ()
}
}

void mono_wasm_link_icu_shim (void);

EMSCRIPTEN_KEEPALIVE void
mono_wasm_load_runtime (const char *unused, int debug_level)
{
const char *interp_opts = "";

mono_wasm_link_icu_shim ();

#ifdef DEBUG
monoeg_g_setenv ("MONO_LOG_LEVEL", "debug", 0);
monoeg_g_setenv ("MONO_LOG_MASK", "gc", 0);
Expand Down

0 comments on commit 3473d30

Please sign in to comment.