Skip to content

Commit 0245967

Browse files
committed
Use webassembly exception handling
It's a bit hard to make the rust compiler play along, see the upstream PR for the rust difficulties pyodide/pyodide-build#81
1 parent f51f4b1 commit 0245967

File tree

11 files changed

+27
-27
lines changed

11 files changed

+27
-27
lines changed

Makefile.envs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ export MAIN_MODULE_LDFLAGS= $(LDFLAGS_BASE) \
143143
-s LZ4=1 \
144144
-s EXPORT_NAME="'_createPyodideModule'" \
145145
-s EXPORT_EXCEPTION_HANDLING_HELPERS \
146-
-s EXCEPTION_CATCHING_ALLOWED=['we only want to allow exception handling in side modules'] \
146+
-fwasm-exceptions \
147147
-sEXPORTED_RUNTIME_METHODS='wasmTable,ERRNO_CODES' \
148148
-s USE_ZLIB \
149149
-s USE_BZIP2 \

packages/RobotRaconteur/meta.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ requirements:
1515
- numpy
1616

1717
build:
18-
cxxflags: -fexceptions -fPIC -DBOOST_SP_DISABLE_THREADS=1 -O2
19-
ldflags: -fexceptions
18+
cxxflags: -fwasm-exceptions -fPIC -DBOOST_SP_DISABLE_THREADS=1 -O2
19+
ldflags: -fwasm-exceptions
2020
script: |
2121
export INSTALL_DIR=${WASM_LIBRARY_DIR}
2222
@@ -26,7 +26,7 @@ build:
2626
-DNUMPY_INCLUDE_DIR=$HOSTINSTALLDIR/lib/python$PYMAJOR.$PYMINOR/site-packages/numpy/_core/include/ \
2727
-DPYTHON3_INCLUDE_DIR=$PYTHONINCLUDE -DPYTHON3_EXECUTABLE=python$PYMAJOR.$PYMINOR \
2828
-DPYTHON3_LIBRARY=$HOSTINSTALLDIR/lib/python$PYMAJOR.$PYMINOR.a \
29-
-DCMAKE_CXX_FLAGS="-fPIC -fexceptions -DBOOST_AP_DISABLE_THREADS=1 -O2 -DBOOST_BIND_GLOBAL_PLACEHOLDERS=1 -Wno-enum-constexpr-conversion" \
29+
-DCMAKE_CXX_FLAGS="-fPIC -fwasm-exceptions -DBOOST_AP_DISABLE_THREADS=1 -O2 -DBOOST_BIND_GLOBAL_PLACEHOLDERS=1 -Wno-enum-constexpr-conversion" \
3030
-DBoost_INCLUDE_DIR=$WASM_LIBRARY_DIR/include -DBoost_LIBRARY_DIR=$WASM_LIBRARY_DIR/lib \
3131
-DBoost_DATE_TIME_LIBRARY_RELEASE=$WASM_LIBRARY_DIR/lib/libboost_date_time.a \
3232
-DBoost_DATE_TIME_LIBRARY_DEBUG=$WASM_LIBRARY_DIR/lib/libboost_date_time.a \
@@ -48,7 +48,7 @@ build:
4848
-DUSE_PREGENERATED_SOURCE=ON \
4949
.
5050
emmake make -j ${PYODIDE_JOBS:-3}
51-
emcc ${SIDE_MODULE_LDFLAGS} -fexceptions out/lib/libRobotRaconteurCore.a \
51+
emcc ${SIDE_MODULE_LDFLAGS} -fwasm-exceptions out/lib/libRobotRaconteurCore.a \
5252
out/Python3/RobotRaconteur/_RobotRaconteurPython.a \
5353
$WASM_LIBRARY_DIR/lib/libboost_chrono.a \
5454
$WASM_LIBRARY_DIR/lib/libboost_date_time.a \

packages/boost-cpp/meta.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ build:
2222
./b2 variant=release toolset=clang-emscripten link=static threading=single \
2323
--with-date_time --with-filesystem \
2424
--with-system --with-regex --with-chrono --with-random --with-program_options --disable-icu \
25-
cxxflags="$SIDE_MODULE_CXXFLAGS -fexceptions -DBOOST_SP_DISABLE_THREADS=1" \
26-
cflags="$SIDE_MODULE_CFLAGS -fexceptions -DBOOST_SP_DISABLE_THREADS=1" \
25+
cxxflags="$SIDE_MODULE_CXXFLAGS -fwasm-exceptions -DBOOST_SP_DISABLE_THREADS=1" \
26+
cflags="$SIDE_MODULE_CFLAGS -fwasm-exceptions -DBOOST_SP_DISABLE_THREADS=1" \
2727
linkflags="-fpic $SIDE_MODULE_LDFLAGS" \
2828
--layout=system -j"${PYODIDE_JOBS:-3}" --prefix=${INSTALL_DIR} \
2929
install

packages/casadi/meta.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ requirements:
1212
build:
1313
exports: requested
1414
cflags: |
15-
-fexceptions -frtti
15+
-fwasm-exceptions -frtti
1616
cxxflags: |
17-
-fexceptions -frtti
17+
-fwasm-exceptions -frtti
1818
ldflags: |
19-
-fexceptions
19+
-fwasm-exceptions
2020
about:
2121
home: http://casadi.org
2222
PyPI: https://pypi.org/project/casadi

packages/coolprop/meta.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ source:
1616
- ./pyproject.toml
1717

1818
build:
19-
cflags: -fexceptions
20-
cxxflags: -fexceptions
21-
ldflags: -fexceptions
19+
cflags: -fwasm-exceptions
20+
cxxflags: -fwasm-exceptions
21+
ldflags: -fwasm-exceptions
2222

2323
requirements:
2424
run:

packages/cpp-exceptions-test/meta.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ source:
1111
build:
1212
type: shared_library
1313
script: |
14-
em++ ${SIDE_MODULE_CFLAGS} -fexceptions -I${PYTHONINCLUDE} -flto -fno-lto -std=c++20 -c throw.cpp -o throw.o
15-
em++ ${SIDE_MODULE_CFLAGS} -fexceptions -I${PYTHONINCLUDE} -flto -fno-lto -std=c++20 -c catch.cpp -o catch.o -mreference-types
16-
em++ ${SIDE_MODULE_LDFLAGS} -fexceptions -o ${DISTDIR}/cpp-exceptions-test-throw.so throw.o
17-
em++ ${SIDE_MODULE_LDFLAGS} -fexceptions -o ${DISTDIR}/cpp-exceptions-test-catch.so catch.o
14+
em++ ${SIDE_MODULE_CFLAGS} -fwasm-exceptions -I${PYTHONINCLUDE} -flto -fno-lto -std=c++20 -c throw.cpp -o throw.o
15+
em++ ${SIDE_MODULE_CFLAGS} -fwasm-exceptions -I${PYTHONINCLUDE} -flto -fno-lto -std=c++20 -c catch.cpp -o catch.o -mreference-types
16+
em++ ${SIDE_MODULE_LDFLAGS} -fwasm-exceptions -o ${DISTDIR}/cpp-exceptions-test-throw.so throw.o
17+
em++ ${SIDE_MODULE_LDFLAGS} -fwasm-exceptions -o ${DISTDIR}/cpp-exceptions-test-catch.so catch.o
1818
about:
1919
license: MPL-2.0

packages/cpp-exceptions-test2/meta.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ package:
77
source:
88
path: src
99
build:
10-
cxxflags: -fexceptions
11-
ldflags: -fexceptions
10+
cxxflags: -fwasm-exceptions
11+
ldflags: -fwasm-exceptions
1212
about:
1313
license: MPL-2.0

packages/matplotlib/meta.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ build:
2525
-s USE_FREETYPE=1
2626
-s USE_LIBPNG=1
2727
-s USE_ZLIB=1
28-
-fexceptions
28+
-fwasm-exceptions
2929
-fno-lto
3030
cxxflags: |
3131
-std=c++14
32-
-fexceptions
32+
-fwasm-exceptions
3333
ldflags: |
34-
-fexceptions
34+
-fwasm-exceptions
3535
script: export SETUPTOOLS_SCM_PRETEND_VERSION=$PKG_VERSION
3636
post: |
3737
rm -rf matplotlib/backends/qt_editor

packages/scipy/meta.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,12 @@ build:
5454
-DUNDERSCORE_G77
5555
-fvisibility=default
5656
cxxflags: |
57-
-fexceptions
57+
-fwasm-exceptions
5858
-fvisibility=default
5959
ldflags: |
6060
-L$(NUMPY_LIB)/core/lib/
6161
-L$(NUMPY_LIB)/random/lib/
62-
-fexceptions
62+
-fwasm-exceptions
6363
6464
# Exclude tests via Meson's install tags functionality.
6565
unvendor-tests: true

packages/shapely/meta.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ build:
1111
script: |
1212
export GEOS_CONFIG=${WASM_LIBRARY_DIR}/bin/geos-config
1313
cxxflags: |
14-
-fexceptions
14+
-fwasm-exceptions
1515
ldflags: |
16-
-fexceptions
16+
-fwasm-exceptions
1717
requirements:
1818
run:
1919
- numpy

0 commit comments

Comments
 (0)