[ORC] Use JITLink as the default linker for LLJIT on Linux/arm64.

Also updates the OrcCAPIsTest unit test to enable the C API tests on Linux.
This commit is contained in:
Lang Hames 2023-02-05 03:36:40 +00:00
parent ae51a82868
commit 6747fc07d1
2 changed files with 18 additions and 5 deletions

View File

@ -715,11 +715,22 @@ Error LLJITBuilderState::prepareForConstruction() {
// JIT linker.
if (!CreateObjectLinkingLayer) {
auto &TT = JTMB->getTargetTriple();
if (TT.getArch() == Triple::riscv64 ||
TT.getArch() == Triple::loongarch64 ||
(TT.isOSBinFormatMachO() &&
(TT.getArch() == Triple::aarch64 || TT.getArch() == Triple::x86_64))) {
bool UseJITLink = false;
switch (TT.getArch()) {
case Triple::riscv64:
case Triple::loongarch64:
UseJITLink = true;
break;
case Triple::aarch64:
UseJITLink = !TT.isOSBinFormatCOFF();
break;
case Triple::x86_64:
UseJITLink = TT.isOSBinFormatMachO();
break;
default:
break;
}
if (UseJITLink) {
JTMB->setRelocationModel(Reloc::PIC_);
JTMB->setCodeModel(CodeModel::Small);
CreateObjectLinkingLayer =

View File

@ -46,3 +46,5 @@ target_link_libraries(OrcJITTests PRIVATE
${ORC_JIT_TEST_LIBS})
set_property(TARGET OrcJITTests PROPERTY FOLDER "Tests/UnitTests/ExecutionTests")
export_executable_symbols(OrcJITTests)