Package: node-inwasm / 0.0.13~git20230419+dfsg-3

fix-emscripten.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
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: {