[llvm] r333147 - [ORC] Add findSymbolIn() wrapper to C bindings.

Andres Freund via llvm-commits llvm-commits at lists.llvm.org
Wed May 23 21:31:01 PDT 2018


Hi,

On 2018-05-23 21:08:19 -0700, Andres Freund wrote:
> On 2018-05-23 20:24:16 -0700, Andres Freund wrote:
> > On 2018-05-24 01:01:42 -0000, Andres Freund via llvm-commits wrote:
> > The green.lab.llvm.org builder seems to be OSX - I can't for the heck of
> > me see what was OS specific in that change however.
> > 
> > I've organized remote access to an OSX laptop (using linux myself), and
> > will build LLVM there to see whether I can reproduce the problem. On
> > linux the tests pass, even under valgrind.
> 
> That helped. As far as I can tell the bug is in pre-existing code that
> this commit exposed. Compare:
> 
>   JITSymbol findSymbol(const std::string &Name,
>                                  bool ExportedSymbolsOnly) {
>     if (auto Sym = IndirectStubsMgr->findStub(Name, ExportedSymbolsOnly))
>       return Sym;
>     return CODLayer.findSymbol(mangle(Name), ExportedSymbolsOnly);
>   }
> 
> with
> 
>   JITSymbol findSymbolIn(orc::VModuleKey K, const std::string &Name,
>                          bool ExportedSymbolsOnly) {
>     assert(KeyLayers.count(K) && "looking up symbol in unknown module");
>     return KeyLayers[K]->findSymbolIn(K, Name, ExportedSymbolsOnly);
>   }
> 
> Note that the second function doesn't do a mangle(Name). On OSX the
> actual symbol will have a '_' prefix, but without mangling the looked up
> function won't.
> 
> I'll open a review about this.

Submitted as https://reviews.llvm.org/D47308

Seems like the fairly obvious fix to me, but I'm not clear enough on the
review policy to commit this without review.

Greetings,

Andres Freund


More information about the llvm-commits mailing list