This is an archive of the discontinued LLVM Phabricator instance.

[ORC] Perform name mangling in findSymbolIn(), as done in findSymbol().
ClosedPublic

Authored by anarazel on May 23 2018, 9:16 PM.

Details

Summary

The lack of name mangling causes a unittest failure after r333147 (in TestEagerIRCompilation), as OSX prefixes symbol names with '_'. The lack of name mangling therefore leads to a NULL pointer being returned
and then called, hence the failure.

While it looks like it, this isn't an actual behavioral change, as findSymbolIn() previously was not exposed externally, and essentially dead code. Which explains why nobody noticed the issue previously.

Diff Detail

Repository
rL LLVM

Event Timeline

anarazel created this revision.May 23 2018, 9:16 PM

FWIW, I don't think this is really obvious / trivial enough to land w/o review by someone familiar w/ Orc and the users.

While I *suspect* the lack of mangling is jsut an oversight, it is a behavior change and might break users or should at least be thought about by someone w/ familiarity.

Until this is fixed one way or another, you should probably revert the patch that is failing bots.

FWIW, I don't think this is really obvious / trivial enough to land w/o review by someone familiar w/ Orc and the users.

While I *suspect* the lack of mangling is jsut an oversight, it is a behavior change and might break users or should at least be thought about by someone w/ familiarity.

I don't think it's actually an *exposed* behaviour change. The modified file is in lib/ and therefore not externally exposed, and before https://reviews.llvm.org/D44889 OrcCBindingsStack::findSymbolIn() wasn't actually called from anywhere (OrcCBindingsStack.h is only included by OrcCBindings.cpp). Therefore the code previously was dead code, which explains why nobody noticed the issue previously.

Until this is fixed one way or another, you should probably revert the patch that is failing bots.

Seems sensible. Will do in a few, just need to get back to the laptop with the credentials.

anarazel edited the summary of this revision. (Show Details)May 23 2018, 9:58 PM
lhames accepted this revision.May 24 2018, 8:52 AM

Yep -- the lack of mangling was just an oversight. Thanks for tracking this down!

This revision is now accepted and ready to land.May 24 2018, 8:52 AM
anarazel updated this revision to Diff 148435.May 24 2018, 9:42 AM

Rebase after temporary revert of r333147.

This revision was automatically updated to reflect the committed changes.