@@ -444,17 +444,20 @@ void rtCompileProcessImplSoInternal(const RtCompileModuleList *modlist_head,
444444 JitFinaliser jitFinalizer (myJit);
445445 /* if (myJit.isMainContext())*/ {
446446 interruptPoint (context, " Resolve functions" );
447- std::vector<std::string> names{};
448- for (auto &elem : moduleInfo.functions ()) {
449- names.emplace_back (elem.name );
450- }
451- for (auto &elem : moduleInfo.getBindHandles ()) {
452- names.emplace_back (elem.name );
453- }
454- auto results = cantFail (myJit.lookupMany (names));
455- for (auto &symbol : results) {
456- myJit.addSymbol ((*symbol.first ).str (),
457- symbol.second .getAddress ().toPtr <void *>());
447+ // macOS may require pointer signing, so caching symbols might not work.
448+ if (!myJit.getTargetMachine ()->getTargetTriple ().isOSDarwin ()) {
449+ std::vector<std::string> names{};
450+ for (auto &elem : moduleInfo.functions ()) {
451+ names.emplace_back (elem.name );
452+ }
453+ for (auto &elem : moduleInfo.getBindHandles ()) {
454+ names.emplace_back (elem.name );
455+ }
456+ auto results = cantFail (myJit.lookupMany (names));
457+ for (auto &symbol : results) {
458+ myJit.addSymbol ((*symbol.first ).str (),
459+ symbol.second .getAddress ().toPtr <void *>());
460+ }
458461 }
459462 for (auto &&fun : moduleInfo.functions ()) {
460463 if (fun.thunkVar == nullptr ) {
0 commit comments