Skip to content

Commit 10d9c81

Browse files
adapt for pyodide built
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
1 parent 012fc1b commit 10d9c81

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

.github/workflows/pyodide.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ jobs:
4343
cd src/api/python
4444
CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" CXXFLAG="${CXXFLAGS}" ~/env/bin/pyodide build --exports whole_archive
4545
env:
46-
CFLAGS: "-fexceptions -s DISABLE_EXCEPTION_CATCHING=0 -pthread -s USE_PTHREADS=1 -g2 -s SAFE_HEAP=0 -s PTHREAD_POOL_SIZE=0 -s PTHREAD_POOL_SIZE_STRICT=0"
47-
LDFLAGS: "-fexceptions -s WASM_BIGINT -s -pthread -s USE_PTHREADS=1"
48-
CXXFLAGS: "-fexceptions -pthread -s USE_PTHREADS=1 -s DISABLE_EXCEPTION_CATCHING=0"
46+
CFLAGS: "-fexceptions -s DISABLE_EXCEPTION_CATCHING=0 -pthread -s USE_PTHREADS=1 -g2 -s SAFE_HEAP=0 -s PTHREAD_POOL_SIZE=0 -s PTHREAD_POOL_SIZE_STRICT=0 -latomic"
47+
LDFLAGS: "-fexceptions -s WASM_BIGINT -s -pthread -s USE_PTHREADS=1 -latomic"
48+
CXXFLAGS: "-fexceptions -pthread -s USE_PTHREADS=1 -s DISABLE_EXCEPTION_CATCHING=0 -latomic"
4949

5050
- name: Setup env-pyodide
5151
run: |

src/api/python/setup.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ class LibError(Exception):
2626
SRC_DIR = SRC_DIR_LOCAL if os.path.exists(SRC_DIR_LOCAL) else SRC_DIR_REPO
2727

2828
IS_SINGLE_THREADED = False
29+
ENABLE_LTO = True
2930

3031
IS_PYODIDE = 'PYODIDE_ROOT' in os.environ and os.environ.get('_PYTHON_HOST_PLATFORM', '').startswith('emscripten')
3132

@@ -43,6 +44,7 @@ class LibError(Exception):
4344
build_env['CXXFLAGS'] = build_env.get('CXXFLAGS', '') + " -fexceptions"
4445
build_env['LDFLAGS'] = build_env.get('LDFLAGS', '') + " -fexceptions"
4546
IS_SINGLE_THREADED = True
47+
ENABLE_LTO = False
4648
# build with pthread doesn't work. The WASM bindings are also single threaded.
4749

4850
else:
@@ -122,6 +124,7 @@ def _z3_version():
122124

123125
def _configure_z3():
124126
global IS_SINGLE_THREADED
127+
global ENABLE_LTO
125128
# bail out early if we don't need to do this - it forces a rebuild every time otherwise
126129
if os.path.exists(BUILD_DIR):
127130
return
@@ -136,7 +139,7 @@ def _configure_z3():
136139
'CMAKE_BUILD_TYPE' : 'Release',
137140
'Z3_BUILD_EXECUTABLE' : True,
138141
'Z3_BUILD_LIBZ3_SHARED' : True,
139-
'Z3_LINK_TIME_OPTIMIZATION' : True,
142+
'Z3_LINK_TIME_OPTIMIZATION' : ENABLELTO,
140143
'WARNINGS_AS_ERRORS' : 'SERIOUS_ONLY',
141144
# Disable Unwanted Options
142145
'Z3_USE_LIB_GMP' : False, # Is default false in python build

0 commit comments

Comments
 (0)