Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions recipes/recipes_emscripten/llvm/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,21 @@ emcmake cmake ${CMAKE_ARGS} -S ../llvm -B . \
-DLLVM_HOST_TRIPLE=wasm32-unknown-emscripten \
-DLLVM_TARGETS_TO_BUILD="WebAssembly" \
-DLLVM_ENABLE_ASSERTIONS=ON \
-DLLVM_ENABLE_EH=ON \
-DLLVM_ENABLE_RTTI=ON \
-DLLVM_INCLUDE_BENCHMARKS=OFF \
-DLLVM_INCLUDE_EXAMPLES=OFF \
-DLLVM_INCLUDE_TESTS=OFF \
-DLLVM_ENABLE_LIBEDIT=OFF \
-DLLVM_ENABLE_PROJECTS="clang;lld" \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DLLVM_ENABLE_THREADS=OFF \
-DLLVM_ENABLE_ZSTD=OFF \
-DLLVM_ENABLE_LIBXML2=OFF \
-DCLANG_ENABLE_STATIC_ANALYZER=OFF \
-DCLANG_ENABLE_ARCMT=OFF \
-DCLANG_ENABLE_BOOTSTRAP=OFF \
-DCMAKE_CXX_FLAGS="-Dwait4=__syscall_wait4"
-DCMAKE_CXX_FLAGS="-Dwait4=__syscall_wait4 -fexceptions"

# Build step
emmake make -j4
Expand All @@ -35,4 +38,4 @@ emmake make -j4
emmake make install

# Copy all files with ".wasm" extension to $PREFIX/bin
cp $SRC_DIR/build/bin/*.wasm $PREFIX/bin
cp $SRC_DIR/build/bin/*.wasm $PREFIX/bin
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/clang/lib/Interpreter/Wasm.cpp b/clang/lib/Interpreter/Wasm.cpp
index aa10b160ccf8..184867e2b55f 100644
index aa10b160ccf8..55c3323e31f5 100644
--- a/clang/lib/Interpreter/Wasm.cpp
+++ b/clang/lib/Interpreter/Wasm.cpp
@@ -76,8 +76,8 @@ llvm::Error WasmIncrementalExecutor::addModule(PartialTranslationUnit &PTU) {
Expand All @@ -13,3 +13,19 @@ index aa10b160ccf8..184867e2b55f 100644

std::error_code Error;
llvm::raw_fd_ostream ObjectFileOutput(llvm::StringRef(ObjectFileName), Error);
@@ -99,10 +99,15 @@ llvm::Error WasmIncrementalExecutor::addModule(PartialTranslationUnit &PTU) {

std::vector<const char *> LinkerArgs = {"wasm-ld",
"-shared",
+ "--allow-multiple-definition",
"--import-memory",
"--experimental-pic",
"--stack-first",
"--allow-undefined",
+ "--demangle",
+ "--no-gc-sections",
+ "--export-all",
+ "--export-dynamic",
ObjectFileName.c_str(),
"-o",
BinaryFileName.c_str()};
2 changes: 1 addition & 1 deletion recipes/recipes_emscripten/llvm/recipe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ source:
- patches/shift_temporary_files_to_tmp_dir.patch

build:
number: 0
number: 1

requirements:
build:
Expand Down