From ad36fa06053cee0fa3f04974c515dada60f6a565 Mon Sep 17 00:00:00 2001 From: Lovell Fuller Date: Mon, 12 Aug 2024 16:27:15 +0100 Subject: [PATCH] Ensure emnapiInit function is exported Prevents latest emscripten optimising it away --- src/binding.gyp | 2 +- src/emscripten/common.gypi | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/binding.gyp b/src/binding.gyp index f1fc60910..33607f9aa 100644 --- a/src/binding.gyp +++ b/src/binding.gyp @@ -192,7 +192,7 @@ '-Oz', '-sALLOW_MEMORY_GROWTH', '-sENVIRONMENT=node', - '-sEXPORTED_FUNCTIONS=["_vips_shutdown", "_uv_library_shutdown"]', + '-sEXPORTED_FUNCTIONS=["emnapiInit", "_vips_shutdown", "_uv_library_shutdown"]', '-sNODERAWFS', '-sTEXTDECODER=0', '-sWASM_ASYNC_COMPILATION=0', diff --git a/src/emscripten/common.gypi b/src/emscripten/common.gypi index e13d7a720..125a52659 100644 --- a/src/emscripten/common.gypi +++ b/src/emscripten/common.gypi @@ -9,8 +9,7 @@ 'default_configuration': 'Release', 'type': 'executable', 'cflags': [ - '-pthread', - '-sDEFAULT_TO_CXX=0' + '-pthread' ], 'cflags_cc': [ '-pthread' @@ -19,6 +18,7 @@ '--js-library= JSON.stringify(path.relative(process.cwd(), x))).join(\' \')")'