Skip to content

Commit 32df2d4

Browse files
committed
[WIP] Add exception handling support.
1 parent 7ef7e94 commit 32df2d4

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

.gitmodules

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[submodule "src/llvm-project"]
22
path = src/llvm-project
3-
url = https://github.com/llvm/llvm-project
3+
url = https://github.com/whitequark/llvm-project
44
[submodule "src/wasi-libc"]
55
path = src/wasi-libc
66
url = https://github.com/CraneStation/wasi-libc

Makefile

+11-6
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ build/compiler-rt.BUILT: build/llvm.BUILT build/wasi-libc.BUILT
131131
-DCOMPILER_RT_ENABLE_IOS=OFF \
132132
-DCOMPILER_RT_DEFAULT_TARGET_ONLY=On \
133133
-DWASI_SDK_PREFIX=$(BUILD_PREFIX) \
134-
-DCMAKE_C_FLAGS="$(DEBUG_PREFIX_MAP)" \
134+
-DCMAKE_C_FLAGS="$(DEBUG_PREFIX_MAP) -fwasm-exceptions" \
135135
-DLLVM_CONFIG_PATH=$(ROOT_DIR)/build/llvm/bin/llvm-config \
136136
-DCOMPILER_RT_OS_DIR=wasi \
137137
-DCMAKE_INSTALL_PREFIX=$(PREFIX)/lib/clang/$(CLANG_VERSION)/ \
@@ -162,13 +162,13 @@ LIBCXX_CMAKE_FLAGS = \
162162
-DCMAKE_BUILD_TYPE=RelWithDebugInfo \
163163
-DLIBCXX_ENABLE_SHARED:BOOL=OFF \
164164
-DLIBCXX_ENABLE_EXPERIMENTAL_LIBRARY:BOOL=OFF \
165-
-DLIBCXX_ENABLE_EXCEPTIONS:BOOL=OFF \
165+
-DLIBCXX_ENABLE_EXCEPTIONS:BOOL=ON \
166166
-DLIBCXX_ENABLE_FILESYSTEM:BOOL=OFF \
167167
-DLIBCXX_CXX_ABI=libcxxabi \
168168
-DLIBCXX_CXX_ABI_INCLUDE_PATHS=$(LLVM_PROJ_DIR)/libcxxabi/include \
169169
-DLIBCXX_HAS_MUSL_LIBC:BOOL=ON \
170170
-DLIBCXX_ABI_VERSION=2 \
171-
-DLIBCXXABI_ENABLE_EXCEPTIONS:BOOL=OFF \
171+
-DLIBCXXABI_ENABLE_EXCEPTIONS:BOOL=ON \
172172
-DLIBCXXABI_ENABLE_SHARED:BOOL=OFF \
173173
-DLIBCXXABI_SILENT_TERMINATE:BOOL=ON \
174174
-DLIBCXXABI_ENABLE_THREADS:BOOL=OFF \
@@ -177,6 +177,10 @@ LIBCXX_CMAKE_FLAGS = \
177177
-DLIBCXXABI_BUILD_EXTERNAL_THREAD_LIBRARY:BOOL=OFF \
178178
-DLIBCXXABI_HAS_WIN32_THREAD_API:BOOL=OFF \
179179
-DLIBCXXABI_ENABLE_PIC:BOOL=OFF \
180+
-DLIBUNWIND_ENABLE_ASSERTIONS:BOOL=OFF \
181+
-DLIBUNWIND_ENABLE_SHARED:BOOL=OFF \
182+
-DLIBUNWIND_ENABLE_THREADS:BOOL=OFF \
183+
-DLIBUNWIND_USE_COMPILER_RT:BOOL=ON \
180184
-DWASI_SDK_PREFIX=$(BUILD_PREFIX) \
181185
-DUNIX:BOOL=ON \
182186
--debug-trycompile
@@ -186,11 +190,12 @@ build/libcxx.BUILT: build/llvm.BUILT build/compiler-rt.BUILT build/wasi-libc.BUI
186190
mkdir -p build/libcxx
187191
cd build/libcxx && cmake -G Ninja $(LIBCXX_CMAKE_FLAGS) \
188192
-DCMAKE_SYSROOT=$(BUILD_PREFIX)/share/wasi-sysroot \
189-
-DCMAKE_C_FLAGS="$(DEBUG_PREFIX_MAP)" \
190-
-DCMAKE_CXX_FLAGS="$(DEBUG_PREFIX_MAP)" \
193+
-DCMAKE_C_FLAGS="$(DEBUG_PREFIX_MAP) -fwasm-exceptions" \
194+
-DCMAKE_CXX_FLAGS="$(DEBUG_PREFIX_MAP) -fwasm-exceptions" \
191195
-DLIBCXX_LIBDIR_SUFFIX=$(ESCAPE_SLASH)/wasm32-wasi \
192196
-DLIBCXXABI_LIBDIR_SUFFIX=$(ESCAPE_SLASH)/wasm32-wasi \
193-
-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi" \
197+
-DLIBUNWIND_LIBDIR_SUFFIX=$(ESCAPE_SLASH)/wasm32-wasi \
198+
-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \
194199
$(LLVM_PROJ_DIR)/runtimes
195200
ninja $(NINJA_FLAGS) -C build/libcxx
196201
# Do the install.

src/llvm-project

0 commit comments

Comments
 (0)