aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Interpreter/Interpreter.cpp
diff options
context:
space:
mode:
authorAnutosh Bhat <andersonbhat491@gmail.com>2024-11-19 13:37:40 +0530
committerGitHub <noreply@github.com>2024-11-19 09:07:40 +0100
commit752dbd6112affa418e33910ac08bf9921f9c270b (patch)
treeebaee1e83d231db88e396b68cf8a802f8d4d87b7 /clang/lib/Interpreter/Interpreter.cpp
parente7e5541616435b62da56e0a1fcc587c10b25321c (diff)
downloadllvm-752dbd6112affa418e33910ac08bf9921f9c270b.zip
llvm-752dbd6112affa418e33910ac08bf9921f9c270b.tar.gz
llvm-752dbd6112affa418e33910ac08bf9921f9c270b.tar.bz2
[clang-repl] Improve flags responsible for generating shared wasm binaries (#116735)
There are a couple changes in this PR that help getting clang-repl to run in the browser. Using a jupyterlite instance for the example pasted below 1) Updating flags responsible for generating shared wasm binaries that need to be dynamically loaded Most Importantly as can be seen in the changes `shared` and `allow-undefined` are crucial. ![image](https://github.com/user-attachments/assets/1183fd44-8951-496a-899a-e4af39a48447) 2) While exiting we encounter this. ![image](https://github.com/user-attachments/assets/9487a3f4-7200-471d-ba88-09e98ccbc47a) Now as can be seen here https://github.com/llvm/llvm-project/blob/cd418030de7ae75750bc4e48d1238baf03c675e5/clang/lib/Interpreter/Interpreter.cpp#L421-L430 We call cleanUP in the destructor. Now cleanUP through IncrementalExecutor tries to deinitialize the JIT which wasn't even intialized as runCtors in wasm.cpp is a no-op https://github.com/llvm/llvm-project/blob/cd418030de7ae75750bc4e48d1238baf03c675e5/clang/lib/Interpreter/IncrementalExecutor.cpp#L94-L101 https://github.com/llvm/llvm-project/blob/cd418030de7ae75750bc4e48d1238baf03c675e5/clang/lib/Interpreter/Wasm.cpp#L107-L109
Diffstat (limited to 'clang/lib/Interpreter/Interpreter.cpp')
-rw-r--r--clang/lib/Interpreter/Interpreter.cpp1
1 files changed, 0 insertions, 1 deletions
diff --git a/clang/lib/Interpreter/Interpreter.cpp b/clang/lib/Interpreter/Interpreter.cpp
index bc96da8..73ad766 100644
--- a/clang/lib/Interpreter/Interpreter.cpp
+++ b/clang/lib/Interpreter/Interpreter.cpp
@@ -196,7 +196,6 @@ IncrementalCompilerBuilder::CreateCpp() {
#ifdef __EMSCRIPTEN__
Argv.push_back("-target");
Argv.push_back("wasm32-unknown-emscripten");
- Argv.push_back("-pie");
Argv.push_back("-shared");
#endif
Argv.insert(Argv.end(), UserArgs.begin(), UserArgs.end());