Page MenuHomePhabricator

Make JITDylib ignore Exported flag
AbandonedPublic

Authored by save-buffer on Jul 31 2019, 4:37 PM.

Details

Summary
This change addresses an issue with current compatibility with COFF.
COFF lacks an "Exported" flag. When the COFF object file is generated,
ORC compares the flags from the symbol table in the object file to the
flags it expected from the IR. This was incorrect because when
generating a COFF, the Exported flag was never set. This change ignores
it in asserts.

Diff Detail

Event Timeline

save-buffer created this revision.Jul 31 2019, 4:37 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 31 2019, 4:37 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
save-buffer edited the summary of this revision. (Show Details)

Hi Sasha,

I definitely want this to work on Windows, but this isn't the right way to fix it. Instead, you want to turn on symbol-flag-overrides in the linking layer by calling RTDyldObjectLinkingLayer's (or ObjectLinkingLayer's, if you're using that) setOverrideObjectFlagsWithResponsibilityFlags() method.

If you have a custom JIT stack:

ObjLinkingLayer.setOverrideObjectFlagsWithResponsibilityFlags(true);

should do it.

I will update LLJIT to do this automatically if the target is Windows.

save-buffer abandoned this revision.Aug 2 2019, 8:07 AM

Great, thanks!