This is an archive of the discontinued LLVM Phabricator instance.

[ORC-RT] Configure the ORC runtime for more architectures and platforms
ClosedPublic

Authored by benlangmuir on Oct 19 2021, 4:34 PM.

Details

Summary

Enable building the ORC runtime for 64-bit and 32-bit ARM architectures, and for all Darwin embedded platforms (iOS, tvOS, and watchOS). This covers building the cross-platform code, but does not add TLV runtime support for the new architectures, which can be added independently.

Diff Detail

Event Timeline

benlangmuir created this revision.Oct 19 2021, 4:34 PM
benlangmuir requested review of this revision.Oct 19 2021, 4:34 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 19 2021, 4:34 PM
Herald added a subscriber: Restricted Project. · View Herald Transcript
benlangmuir added inline comments.Oct 19 2021, 4:38 PM
compiler-rt/cmake/Modules/AllSupportedArchDefs.cmake
81

Any concerns about adding this for Linux, etc.? I could if(APPLE) the new additons if so.

compiler-rt/lib/orc/simple_packed_serialization.h
404

Does this need a range check on 32-bit platforms? If so, is this the correct place to do so or is there a more central place?

lhames accepted this revision.Oct 19 2021, 4:53 PM
lhames added a subscriber: sgraenitz.
lhames added inline comments.
compiler-rt/cmake/Modules/AllSupportedArchDefs.cmake
81

No -- I think we want to enable this for Linux. @sgraenitz added a JITLink ELF/AArch64 backend recently, and this would let us start building out runtime support for that.

compiler-rt/lib/orc/simple_packed_serialization.h
404

Yes -- this needs a range check and this is the right place for it. Thanks for spotting that!

This revision is now accepted and ready to land.Oct 19 2021, 4:53 PM
  • Added check against size_t max to avoid truncation on 32-bit platforms
  • Improved cmake configuration -- on non-Apple platforms I missed updating a place looking for x86_64_SOURCES, and I also improved it so that we consistently build either the macho or elfnix TLS support, but not both (before my changes it was doing that on Apple but on Linux). We should probably further constrain the elfnix TLS to only build on ELF platforms, but I'm not changing that here.
lhames accepted this revision.Oct 20 2021, 10:27 AM

LGTM. Thanks Ben!

Looks like you broke this build: https://lab.llvm.org/buildbot/#/builders/77/builds/10681

Do you mind reverting this change?

@kstoimenov thanks for the heads up, reverted in f3671de5500ff1f8210419226a9603a7d83b1a31.

This error was in some old debug info that was accidentally left in the library. I have removed it in 27d53cc10786f723f6cc9e9fd451ab83870b0d3a. This should be safe to re-land.

The build is green now, thanks!

Oops -- I actually didn't push 27d53cc1078. I've landed it in 5c72323141e4.