Skip to content

Commit 4c2b77e

Browse files
committed
3.1.61.2bi
1 parent e5f815b commit 4c2b77e

File tree

5 files changed

+96
-97
lines changed

5 files changed

+96
-97
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
rustsdk: false
2727
nimsdk: false
2828
COPTS: -O2 -g3
29-
EMFLAVOUR: 3.1.74
29+
EMFLAVOUR: 3.1.61
3030

3131
steps:
3232
- uses: actions/checkout@v4.2.2

emsdk-cc

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,12 @@ elif env("CONFIG_SITE", false):
7777
else:
7878
CONFIGURE = env("CONFIGURE", false)
7979

80+
# 3.1.56 - 3.1.61
81+
# no '-mno-bulk-memory-opt' '-mno-fp16'
82+
83+
# 3.1.68 wasm opt
84+
# --enable-call-indirect-overlong
85+
8086

8187
if MVP:
8288
# turn of wasm ex (https://github.com/emscripten-core/emscripten/pull/20536)
@@ -102,21 +108,22 @@ if MVP:
102108
-D_FILE_OFFSET_BITS=64
103109
-sSUPPORT_LONGJMP=emscripten
104110
-mno-bulk-memory
105-
-mno-bulk-memory-opt
106111
-mnontrapping-fptoint
107112
-mno-reference-types
108113
-mno-sign-ext
109114
-mno-extended-const
110115
-mno-atomics
111116
-mno-tail-call
112-
-mno-fp16
113117
-mno-multivalue
114118
-mno-relaxed-simd
115119
-mno-simd128
116120
-mno-multimemory
117121
-mno-exception-handling
118122
"""
119123
)
124+
# -mno-fp16
125+
# -mno-bulk-memory-opt
126+
120127
else:
121128
CPU = arglist("-D_FILE_OFFSET_BITS=64 -mcpu=bleeding-edge -m64")
122129

python-wasi-sdk.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,8 @@ END
216216
fi
217217

218218
# use ./ or emsdk will pollute env
219-
./scripts/emsdk-fetch.sh > /dev/null
219+
./scripts/emsdk-fetch.sh
220+
# > /dev/null
220221

221222
echo " ---------- building cpython wasm support ${PYBUILD} ${CIVER} -----------" 1>&2
222223

@@ -346,7 +347,8 @@ END
346347
fi
347348
done
348349

349-
350+
# remove builder/installer
351+
rm ${SDKROOT}/python-was?-sdk.sh
350352

351353
exit 0
352354

python-wasm-sdk.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,8 @@ END
216216
fi
217217

218218
# use ./ or emsdk will pollute env
219-
./scripts/emsdk-fetch.sh > /dev/null
219+
./scripts/emsdk-fetch.sh
220+
# > /dev/null
220221

221222
echo " ---------- building cpython wasm support ${PYBUILD} ${CIVER} -----------" 1>&2
222223

@@ -346,7 +347,8 @@ END
346347
fi
347348
done
348349

349-
350+
# remove builder/installer
351+
rm ${SDKROOT}/python-was?-sdk.sh
350352

351353
exit 0
352354

scripts/emsdk-fetch.sh

Lines changed: 78 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ then
66

77
. ${CONFIG:-config}
88

9-
10-
119
# for full rebuild
1210
# rm emsdk/.complete
1311

@@ -26,9 +24,6 @@ then
2624
fi
2725

2826

29-
30-
31-
3227
if [ -f emsdk/.complete ]
3328
then
3429
echo " * found emsdk/.complete : not patching/building emsdk"
@@ -41,11 +36,11 @@ then
4136
sed -i 's|extern FILE \*const|extern FILE \*|g' cache/sysroot/include/stdio.h
4237

4338
echo "FIXME: Applying https://github.com/emscripten-core/emscripten/pull/20281 dylink.js : handle ** argument case"
44-
if [ -f test/other/test_em_js_side.c ]
45-
then
46-
wget https://patch-diff.githubusercontent.com/raw/emscripten-core/emscripten/pull/20281.diff
47-
patch -p1 < 20281.diff
48-
else
39+
# if [ -f test/other/test_em_js_side.c ]
40+
# then
41+
# wget https://patch-diff.githubusercontent.com/raw/emscripten-core/emscripten/pull/20281.diff
42+
# patch -p1 < 20281.diff
43+
# else
4944
patch -p1 <<END
5045
diff --git a/src/library_dylink.js b/src/library_dylink.js
5146
index 632e20aa61e3..ebb13995d6c3 100644
@@ -62,47 +57,47 @@ index 632e20aa61e3..ebb13995d6c3 100644
6257
var func = `(${jsArgs}) => ${body};`;
6358
END
6459

65-
fi
60+
# fi
6661

6762

6863
echo "FIXME: Applying https://github.com/emscripten-core/emscripten/pull/17956 file corruption when using emscripten_run_preload_plugins with BrowserFS"
6964
wget https://patch-diff.githubusercontent.com/raw/emscripten-core/emscripten/pull/17956.diff
7065

71-
if patch -p1 < 17956.diff
72-
then
73-
echo applied https://github.com/emscripten-core/emscripten/pull/17956
74-
# 18941 has been merged
75-
else
76-
# deal with old version of emsdk for the above 3.1.45 patch
77-
sed -i 's|new Uint8Array(data.object.contents), true, true|FS.readFile(_file), true, true|g' src/library_browser.js
78-
# merged since 3.1.34 which quite the more stable atm
79-
#echo "MAYBE FIXME: Applying https://github.com/emscripten-core/emscripten/pull/18941"
80-
#wget https://patch-diff.githubusercontent.com/raw/emscripten-core/emscripten/pull/18941.diff
81-
#patch -p1 < 18941.diff
82-
fi
83-
84-
echo "FIXME: Applying https://github.com/emscripten-core/emscripten/pull/21472 glfw3: gl level version major/minor hints"
85-
wget https://patch-diff.githubusercontent.com/raw/emscripten-core/emscripten/pull/21472.diff
86-
patch -p1 < 21472.diff
87-
88-
89-
echo "FIXME: Applying https://github.com/emscripten-core/emscripten/pull/20442 fix mouse position for 3D canvas"
90-
# wget https://patch-diff.githubusercontent.com/raw/emscripten-core/emscripten/pull/20442.diff
91-
# patch -p1 < 20442.diff
92-
wget https://patch-diff.githubusercontent.com/raw/pmp-p/emscripten/pull/2.diff
93-
patch -p1 < 2.diff
94-
95-
echo "FIXME: Applying https://github.com/pmp-p/emscripten/pull/3 ioctl TIOCSWINSZ"
96-
wget https://github.com/pmp-p/emscripten/pull/3.diff
97-
patch -p1 < 3.diff
98-
99-
#echo "FIXME: remove XHR for .data and use fetch" MERGED
100-
#wget https://patch-diff.githubusercontent.com/raw/emscripten-core/emscripten/pull/22016.diff
101-
#patch -p1 < 22016.diff
102-
103-
#echo "FIXME: scriptDirectory workaround" MERGER
104-
#wget https://patch-diff.githubusercontent.com/raw/emscripten-core/emscripten/pull/22605.diff
105-
#patch -p1 < 22605.diff
66+
if patch -p1 < 17956.diff
67+
then
68+
echo applied https://github.com/emscripten-core/emscripten/pull/17956
69+
# 18941 has been merged
70+
else
71+
# deal with old version of emsdk for the above 3.1.45 patch
72+
sed -i 's|new Uint8Array(data.object.contents), true, true|FS.readFile(_file), true, true|g' src/library_browser.js
73+
# merged since 3.1.34 which quite the more stable atm
74+
#echo "MAYBE FIXME: Applying https://github.com/emscripten-core/emscripten/pull/18941"
75+
#wget https://patch-diff.githubusercontent.com/raw/emscripten-core/emscripten/pull/18941.diff
76+
#patch -p1 < 18941.diff
77+
fi
78+
79+
echo "FIXME: Applying https://github.com/emscripten-core/emscripten/pull/21472 glfw3: gl level version major/minor hints"
80+
wget https://patch-diff.githubusercontent.com/raw/emscripten-core/emscripten/pull/21472.diff
81+
patch -p1 < 21472.diff
82+
83+
84+
echo "FIXME: Applying https://github.com/emscripten-core/emscripten/pull/20442 fix mouse position for 3D canvas"
85+
# wget https://patch-diff.githubusercontent.com/raw/emscripten-core/emscripten/pull/20442.diff
86+
# patch -p1 < 20442.diff
87+
wget https://patch-diff.githubusercontent.com/raw/pmp-p/emscripten/pull/2.diff
88+
patch -p1 < 2.diff
89+
90+
echo "FIXME: Applying https://github.com/pmp-p/emscripten/pull/3 ioctl TIOCSWINSZ"
91+
wget https://github.com/pmp-p/emscripten/pull/3.diff
92+
patch -p1 < 3.diff
93+
94+
#echo "FIXME: remove XHR for .data and use fetch" MERGED
95+
#wget https://patch-diff.githubusercontent.com/raw/emscripten-core/emscripten/pull/22016.diff
96+
#patch -p1 < 22016.diff
97+
98+
#echo "FIXME: scriptDirectory workaround" MERGER
99+
#wget https://patch-diff.githubusercontent.com/raw/emscripten-core/emscripten/pull/22605.diff
100+
#patch -p1 < 22605.diff
106101

107102
popd # emsdk/upstream/emscripten -> emsdk
108103

@@ -202,7 +197,7 @@ END
202197
if [ -f emsdk/.complete ]
203198
then
204199
echo "
205-
* emsdk prereq ok
200+
* emsdk third parties ok
206201
" 1>&2
207202
else
208203
# sdl2_image is too old
@@ -225,32 +220,19 @@ END
225220
embuilder --pic build $one
226221
done
227222

228-
for one in $ALL
229-
do
230-
embuilder build $one
231-
embuilder --pic build $one
232-
done
233223

234-
curl -fsSL https://bun.sh/install | bash
224+
echo "
225+
* building third parties done, mark is emsdk/.complete )
226+
" 1>&2
235227

236-
export SYS_NODE=$(echo -n $SDKROOT/emsdk/node/??.??.*/bin/node)
228+
# for one in $ALL
229+
# do
230+
# embuilder build $one
231+
# embuilder --pic build $one
232+
# done
237233

238-
# emsdk shipped node cannot run on alpine
239-
if [ -f /alpine ]
240-
then
241-
if [ -f $SYS_NODE.glibc ]
242-
then
243-
echo "node alpine node version already selected"
244-
else
245-
mv $SYS_NODE $SYS_NODE.glibc
246-
cp -vf /usr/bin/node $SYS_NODE
247-
fi
248-
fi
249234

250235
export PATH=$(echo -n ${SDKROOT}/emsdk/node/??.??.*/bin):$PATH
251-
$SDKROOT/emsdk/node/??.??.*/bin/npm install --prefix $SDKROOT/emsdk/node/??.??.* -g pnpm@^9.0.0
252-
253-
# maybe rewrite that in python and move it to emcc.py
254236

255237
cat > emsdk/upstream/emscripten/emcc <<END
256238
#!/bin/bash
@@ -308,7 +290,6 @@ END
308290

309291
chmod +x emsdk/upstream/emscripten/em*
310292
touch emsdk/.complete
311-
sync
312293
fi
313294

314295
# EM_PKG_CONFIG_PATH ?
@@ -327,45 +308,52 @@ END
327308
export PATH=$(echo -n ${EMSDK}/node/??.??.*/bin):$EMSDK/upstream/emscripten/system/bin:$EMSDK/upstream/emscripten:$PATH
328309
fi
329310

330-
#ln $EMSDK/upstream/emscripten/emstrip $EMSDK/upstream/emscripten/strip
331-
#ln $EMSDK/upstream/emscripten/emstrip.py $EMSDK/upstream/emscripten/strip.py
332-
311+
echo "
312+
* installing wasm-objdump (wasi)
313+
"
333314
mkdir -p ${SDKROOT}/devices/$(arch)/usr/bin/
334315
cp $SDKROOT/wasisdk/bin/wasm-objdump* ${SDKROOT}/devices/$(arch)/usr/bin/
335316

317+
318+
319+
336320
TRUE=$(which true)
321+
echo "
322+
* pointing readelf and ldconfig to ${TRUE}
323+
"
337324
for fix in readelf ldconfig
338325
do
339326
FIXED=$EMSDK/upstream/emscripten/system/bin/$fix
340327
[ -f $FIXED ] || cp $TRUE $FIXED
341328
done
342329

330+
331+
332+
# emsdk shipped node cannot run on alpine
343333
export SYS_NODE=$(echo -n $SDKROOT/emsdk/node/??.??.*/bin/node)
334+
if [ -f /alpine ]
335+
then
336+
if [ -f $SYS_NODE.glibc ]
337+
then
338+
echo "node alpine node version already selected"
339+
else
340+
mv $SYS_NODE $SYS_NODE.glibc
341+
cp -vf /usr/bin/node $SYS_NODE
342+
fi
343+
fi
344344

345345
export NPROC=1
346346
export EMSDK_NUM_CORES=$NPROC
347347

348348
mkdir -p src
349-
350-
export CPPFLAGS="-I$PREFIX/include"
351-
export LDFLAGS="-L$PREFIX/lib"
352-
# -msoft-float
353-
354-
# module build opts
355-
export CFLDPFX="$CPPFLAGS $LDFLAGS -Wno-unused-command-line-argument"
356-
export PYDK=true
357-
358-
# if which ccache 2>&1 >/dev/null; then
359-
# export EM_COMPILER_WRAPPER=ccache
360-
# export _EMCC_CCACHE=1
361-
# fi
362-
363-
export EMCC_SKIP_SANITY_CHECK=1
364-
export EM_IGNORE_SANITY=1
365-
366349
export SYSROOT=$EMSDK/upstream/emscripten/cache/sysroot
367350
popd # ${SDKROOT:-/opt/python-wasm-sdk}
351+
352+
echo "
353+
will use node = $SYS_NODE
354+
sysroot = $SYSROOT
355+
"
368356
else
369-
echo "emsdk: config already set !" 1>&2
357+
echo "emsdk: already fetched and config set !" 1>&2
370358
fi
371359

0 commit comments

Comments
 (0)