File tree Expand file tree Collapse file tree 4 files changed +10
-4
lines changed Expand file tree Collapse file tree 4 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ class IncrementalExecutor {
5656 virtual llvm::Error addModule (PartialTranslationUnit &PTU);
5757 virtual llvm::Error removeModule (PartialTranslationUnit &PTU);
5858 virtual llvm::Error runCtors () const ;
59- llvm::Error cleanUp ();
59+ virtual llvm::Error cleanUp ();
6060 llvm::Expected<llvm::orc::ExecutorAddr>
6161 getSymbolAddress (llvm::StringRef Name, SymbolNameKind NameKind) const ;
6262
Original file line number Diff line number Diff line change @@ -196,7 +196,6 @@ IncrementalCompilerBuilder::CreateCpp() {
196196#ifdef __EMSCRIPTEN__
197197 Argv.push_back (" -target" );
198198 Argv.push_back (" wasm32-unknown-emscripten" );
199- Argv.push_back (" -pie" );
200199 Argv.push_back (" -shared" );
201200#endif
202201 Argv.insert (Argv.end (), UserArgs.begin (), UserArgs.end ());
Original file line number Diff line number Diff line change @@ -72,13 +72,13 @@ llvm::Error WasmIncrementalExecutor::addModule(PartialTranslationUnit &PTU) {
7272 OutputFile.close ();
7373
7474 std::vector<const char *> LinkerArgs = {" wasm-ld" ,
75- " -pie " ,
75+ " -shared " ,
7676 " --import-memory" ,
7777 " --no-entry" ,
7878 " --export-all" ,
7979 " --experimental-pic" ,
80- " --no-export-dynamic" ,
8180 " --stack-first" ,
81+ " --allow-undefined" ,
8282 OutputFileName.c_str (),
8383 " -o" ,
8484 OutputFileName.c_str ()};
@@ -109,6 +109,12 @@ llvm::Error WasmIncrementalExecutor::runCtors() const {
109109 return llvm::Error::success ();
110110}
111111
112+ llvm::Error WasmIncrementalExecutor::cleanUp () const {
113+ // Can't call cleanUp through IncrementalExecutor as it
114+ // tries to deinitialize JIT which hasn't been initialized
115+ return llvm::Error::success ();
116+ }
117+
112118WasmIncrementalExecutor::~WasmIncrementalExecutor () = default ;
113119
114120} // namespace clang
Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ class WasmIncrementalExecutor : public IncrementalExecutor {
2828 llvm::Error addModule (PartialTranslationUnit &PTU) override ;
2929 llvm::Error removeModule (PartialTranslationUnit &PTU) override ;
3030 llvm::Error runCtors () const override ;
31+ llvm::Error cleanUp () override ;
3132
3233 ~WasmIncrementalExecutor () override ;
3334};
You can’t perform that action at this time.
0 commit comments