|
20 | 20 | else |
21 | 21 | git clone --no-tags --depth 1 --single-branch --branch main https://github.com/emscripten-core/emsdk.git |
22 | 22 | pushd emsdk |
23 | | - #git checkout 91f8563a9d1a4a0ec03bbb2be23485367d85a091 |
24 | 23 | ./emsdk install ${EMFLAVOUR:-latest} |
25 | 24 | ./emsdk activate ${EMFLAVOUR:-latest} |
26 | 25 | popd |
|
34 | 33 | then |
35 | 34 | echo " * found emsdk/.complete : not patching/building emsdk" |
36 | 35 | else |
37 | | - pushd emsdk/upstream/emscripten |
| 36 | + pushd emsdk |
38 | 37 |
|
| 38 | + pushd emsdk/upstream/emscripten |
39 | 39 |
|
40 | 40 | echo "FIXME: applying stdio* are not const" |
41 | 41 | sed -i 's|extern FILE \*const|extern FILE \*|g' cache/sysroot/include/stdio.h |
42 | 42 |
|
43 | | - |
44 | 43 | echo "FIXME: Applying https://github.com/emscripten-core/emscripten/pull/20281 dylink.js : handle ** argument case" |
45 | 44 | if [ -f test/other/test_em_js_side.c ] |
46 | 45 | then |
|
81 | 80 | #wget https://patch-diff.githubusercontent.com/raw/emscripten-core/emscripten/pull/18941.diff |
82 | 81 | #patch -p1 < 18941.diff |
83 | 82 | fi |
84 | | - popd # emsdk/upstream/emscripten |
85 | | - |
86 | | -# wget https://raw.githubusercontent.com/paradust7/minetest-wasm/main/emsdk_emcc.patch |
87 | | -# patch -p1 < emsdk_emcc.patch |
88 | 83 |
|
89 | | - pushd emsdk/upstream/emscripten |
90 | 84 | echo "FIXME: Applying https://github.com/emscripten-core/emscripten/pull/21472 glfw3: gl level version major/minor hints" |
91 | 85 | wget https://patch-diff.githubusercontent.com/raw/emscripten-core/emscripten/pull/21472.diff |
92 | 86 | patch -p1 < 21472.diff |
|
109 | 103 | #echo "FIXME: scriptDirectory workaround" MERGER |
110 | 104 | #wget https://patch-diff.githubusercontent.com/raw/emscripten-core/emscripten/pull/22605.diff |
111 | 105 | #patch -p1 < 22605.diff |
112 | | - popd # upstream/emscripten |
113 | 106 |
|
| 107 | + popd # emsdk/upstream/emscripten |
| 108 | + |
| 109 | +# wget https://raw.githubusercontent.com/paradust7/minetest-wasm/main/emsdk_emcc.patch |
| 110 | +# patch -p1 < emsdk_emcc.patch |
| 111 | + |
| 112 | + |
| 113 | + # https://github.com/emscripten-forge/recipes/blob/main/recipes/recipes/emscripten_emscripten-wasm32/patches/0001-Add-useful-error-when-symbol-resolution-fails.patch |
| 114 | + patch -p1 <<END |
| 115 | +--- emsdk-orig/upstream/emscripten/src/library_dylink.js |
| 116 | ++++ emsdk/upstream/emscripten/src/library_dylink.js |
| 117 | +@@ -723,6 +723,9 @@ |
| 118 | + var resolved; |
| 119 | + stubs[prop] = (...args) => { |
| 120 | + resolved ||= resolveSymbol(prop); |
| 121 | ++ if (!resolved) { |
| 122 | ++ throw new Error(`Dynamic linking error: cannot resolve symbol ${prop}`); |
| 123 | ++ } |
| 124 | + return resolved(...args); |
| 125 | + }; |
| 126 | + } |
| 127 | +
|
| 128 | +END |
114 | 129 |
|
115 | 130 |
|
116 | 131 | # https://github.com/paradust7/minetest-wasm/blob/main/emsdk_dirperms.patch |
|
162 | 177 | case F_GETOWN_EX: |
163 | 178 | case F_SETOWN: |
164 | 179 | END |
165 | | - |
| 180 | + popd # emsdk |
166 | 181 | fi # emsdk/.complete |
167 | 182 |
|
168 | 183 | export EMSDK_PYTHON=$SYS_PYTHON |
|
349 | 364 | export EM_IGNORE_SANITY=1 |
350 | 365 |
|
351 | 366 | export SYSROOT=$EMSDK/upstream/emscripten/cache/sysroot |
352 | | - popd |
| 367 | + popd # ${SDKROOT:-/opt/python-wasm-sdk} |
353 | 368 | else |
354 | 369 | echo "emsdk: config already set !" 1>&2 |
355 | 370 | fi |
|
0 commit comments