This is an archive of the discontinued LLVM Phabricator instance.

[ORC][examples] Export exectuable symbols explicitly in LLJITWithExecutorProcessControl
ClosedPublic

Authored by sgraenitz on Sep 23 2021, 9:56 AM.

Details

Summary

Functions in static code that should be callable from JITed code must be exported. For dynamic libraries extern functions are exported by default. For exectuables, linkers usually strip them away unless we explicitly ask for keeping them.

Diff Detail

Event Timeline

sgraenitz created this revision.Sep 23 2021, 9:56 AM
sgraenitz requested review of this revision.Sep 23 2021, 9:56 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 23 2021, 9:56 AM

Issue reported during review D110260. With this fix, nm should return something like this now:

➜ nm bin/LLJITWithExecutorProcessControl | grep return1
0000000100004c10 T _return1
xgupta accepted this revision.Sep 23 2021, 10:50 AM

Yes it is correctly return that symbol, LGTM.

This revision is now accepted and ready to land.Sep 23 2021, 10:50 AM
sgraenitz added a comment.EditedSep 23 2021, 12:34 PM

FYI Included one more typo fix in ExecutorAddress.h (Edit: This was in the other review.)

This revision was landed with ongoing or failed builds.Sep 23 2021, 12:40 PM
This revision was automatically updated to reflect the committed changes.