From fafaa4c870b01d565acb95744bf19dfdcf1a22b8 Mon Sep 17 00:00:00 2001 From: youben11 Date: Tue, 5 Apr 2022 11:34:22 +0100 Subject: [PATCH] fix(macos): ignore undefined symbols for JIT compilation --- compiler/lib/Support/CompilerEngine.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/compiler/lib/Support/CompilerEngine.cpp b/compiler/lib/Support/CompilerEngine.cpp index cc8c839cb..cbdd91085 100644 --- a/compiler/lib/Support/CompilerEngine.cpp +++ b/compiler/lib/Support/CompilerEngine.cpp @@ -450,9 +450,12 @@ const std::string CompilerEngine::Library::CLIENT_PARAMETERS_EXT = ".concrete.params.json"; const std::string CompilerEngine::Library::LINKER = "ld"; #ifdef __APPLE__ -// ld in Mac can't find some symbols without specifying these libs +// We need to tell the linker that some symbols will be missing during linking, +// this symbols should be available during runtime however. This is the case +// when JIT compiling, the JIT should either link to the runtime library that +// has the missing symbols, or it would have been loaded even prior to that const std::string CompilerEngine::Library::LINKER_SHARED_OPT = - " -dylib -lc -o "; + " -dylib -undefined dynamic_lookup -o "; const std::string CompilerEngine::Library::DOT_SHARED_LIB_EXT = ".dylib"; #else // Linux const std::string CompilerEngine::Library::LINKER_SHARED_OPT = " --shared -o ";