Description: try to fix emscripten
Author: Yadd <yadd@debian.org>
Forwarded: not-needed
Last-Update: 2023-09-14

--- node-inwasm-0.0.13~git20230419+dfsg.orig/inwasm/src/runners/emscripten_c.ts
+++ node-inwasm-0.0.13~git20230419+dfsg/inwasm/src/runners/emscripten_c.ts
@@ -23,7 +23,7 @@ export default function(def: IWasmDefini
   // memory settings
   if (memorySettings.descriptor) {
     if (memorySettings.descriptor.initial !== undefined) {
-      switches.push(`-s INITIAL_MEMORY=${memorySettings.descriptor.initial * 65536}`);
+      // switches.push(`-s INITIAL_MEMORY=${memorySettings.descriptor.initial * 65536}`);
     }
     if (memorySettings.descriptor.maximum !== undefined) {
       if (memorySettings.descriptor.initial !== memorySettings.descriptor.maximum) {
@@ -33,7 +33,7 @@ export default function(def: IWasmDefini
     }
   }
   if (memorySettings.mode === 'imported') {
-    switches.push('-s IMPORTED_MEMORY=1');
+    // switches.push('-s IMPORTED_MEMORY=1');
   }
 
   // apply custom switches late
@@ -42,7 +42,7 @@ export default function(def: IWasmDefini
   }
 
   // FIXME:
-  switches.push(...['-s ERROR_ON_UNDEFINED_SYMBOLS=0', '-s WARN_ON_UNDEFINED_SYMBOLS=0']);
+  //switches.push(...['-s ERROR_ON_UNDEFINED_SYMBOLS=0', '-s WARN_ON_UNDEFINED_SYMBOLS=0']);
 
   const funcs = ['-s', `EXPORTED_FUNCTIONS=${_funcs}`];
   const bin = '/usr/bin/emcc';
--- node-inwasm-0.0.13~git20230419+dfsg.orig/testproject/src/example_emscripten_c.wasm.ts
+++ node-inwasm-0.0.13~git20230419+dfsg/testproject/src/example_emscripten_c.wasm.ts
@@ -43,7 +43,7 @@ const convert_simd = InWasm({
   srctype: 'C',
   compile: {
     defines: { CHUNK_SIZE: SETTINGS.chunkSize },
-    switches: ['-msimd128', '-msse', '-msse2', '-mssse3', '-msse4.1', '-s TOTAL_STACK=0', '-s IMPORTED_MEMORY=1']
+    switches: ['-msimd128', '-msse', '-msse2', '-mssse3', '-msse4.1']
   },
   imports: importObj,
   exports: {
@@ -94,7 +94,7 @@ const convert_scalar = InWasm({
   srctype: 'C',
   compile: {
     defines: { CHUNK_SIZE: SETTINGS.chunkSize },
-    switches: ['-s TOTAL_STACK=0', '-s IMPORTED_MEMORY=1']
+    switches: []
   },
   imports: importObj,
   exports: {
--- node-inwasm-0.0.13~git20230419+dfsg.orig/testproject/src/tests/emscripten_c.test.wasm.ts
+++ node-inwasm-0.0.13~git20230419+dfsg/testproject/src/tests/emscripten_c.test.wasm.ts
@@ -23,7 +23,7 @@ describe('emscripten-c', () => {
         mode: OutputMode.SYNC,
         srctype: 'C',
         compile: {
-          switches: ['-s TOTAL_STACK=0']
+          switches: []
         },
         exports: {
           memory: new WebAssembly.Memory({ initial: 1 })
@@ -42,7 +42,7 @@ describe('emscripten-c', () => {
         mode: OutputMode.SYNC,
         srctype: 'C',
         compile: {
-          switches: ['-s TOTAL_STACK=0']
+          switches: []
         },
         exports: {
           memory: new WebAssembly.Memory({ initial: 1, maximum: 1 })
@@ -60,7 +60,7 @@ describe('emscripten-c', () => {
         mode: OutputMode.SYNC,
         srctype: 'C',
         compile: {
-          switches: ['-s TOTAL_STACK=0']
+          switches: []
         },
         exports: {
           memory: new WebAssembly.Memory({ initial: 2, maximum: 20 })
@@ -80,7 +80,7 @@ describe('emscripten-c', () => {
         mode: OutputMode.SYNC,
         srctype: 'C',
         compile: {
-          switches: ['-s TOTAL_STACK=0']
+          switches: []
         },
         imports: importObj,
         exports: {
@@ -111,7 +111,7 @@ describe('emscripten-c', () => {
         mode: OutputMode.SYNC,
         srctype: 'C',
         compile: {
-          switches: ['-s TOTAL_STACK=0']
+          switches: []
         },
         imports: importObj,
         exports: {
