Skip to content

Commit 81c0660

Browse files
authored
Add cross compile patch llvm 20
1 parent 9c64f35 commit 81c0660

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

.github/workflows/emscripten.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ jobs:
306306
else
307307
# Apply patches
308308
llvm_vers=$(echo "${{ matrix.clang-runtime }}" | tr '[:lower:]' '[:upper:]')
309-
if [[ "${llvm_vers}" == "19" ]]; then
309+
if [[ "${llvm_vers}" == "19" ]]||[[ "${llvm_vers}" == "20" ]]; then
310310
git apply -v ../patches/llvm/emscripten-clang${{ matrix.clang-runtime }}-*.patch
311311
echo "Apply emscripten-clang${{ matrix.clang-runtime }}-*.patch patches:"
312312
fi
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
diff --git a/clang/lib/Interpreter/Wasm.cpp b/clang/lib/Interpreter/Wasm.cpp
2+
index aa10b160ccf8..184867e2b55f 100644
3+
--- a/clang/lib/Interpreter/Wasm.cpp
4+
+++ b/clang/lib/Interpreter/Wasm.cpp
5+
@@ -76,8 +76,8 @@ llvm::Error WasmIncrementalExecutor::addModule(PartialTranslationUnit &PTU) {
6+
llvm::TargetMachine *TargetMachine = Target->createTargetMachine(
7+
PTU.TheModule->getTargetTriple(), "", "", TO, llvm::Reloc::Model::PIC_);
8+
PTU.TheModule->setDataLayout(TargetMachine->createDataLayout());
9+
- std::string ObjectFileName = PTU.TheModule->getName().str() + ".o";
10+
- std::string BinaryFileName = PTU.TheModule->getName().str() + ".wasm";
11+
+ std::string ObjectFileName = "/tmp/" + PTU.TheModule->getName().str() + ".o";
12+
+ std::string BinaryFileName = "/tmp/" + PTU.TheModule->getName().str() + ".wasm";
13+
14+
std::error_code Error;
15+
llvm::raw_fd_ostream ObjectFileOutput(llvm::StringRef(ObjectFileName), Error);

0 commit comments

Comments
 (0)