You've already forked linux-packaging-mono
Imported Upstream version 5.18.0.205
Former-commit-id: 7f59f7e792705db773f1caecdaa823092f4e2927
This commit is contained in:
parent
5cd5df71cc
commit
8e12397d70
13
external/llvm/tools/lli/ChildTarget/CMakeLists.txt
vendored
Normal file
13
external/llvm/tools/lli/ChildTarget/CMakeLists.txt
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
set(LLVM_LINK_COMPONENTS
|
||||
OrcJIT
|
||||
RuntimeDyld
|
||||
Support
|
||||
)
|
||||
|
||||
add_llvm_utility(lli-child-target
|
||||
ChildTarget.cpp
|
||||
|
||||
DEPENDS
|
||||
intrinsics_gen
|
||||
)
|
||||
|
67
external/llvm/tools/lli/ChildTarget/ChildTarget.cpp
vendored
Normal file
67
external/llvm/tools/lli/ChildTarget/ChildTarget.cpp
vendored
Normal file
@ -0,0 +1,67 @@
|
||||
#include "llvm/ExecutionEngine/Orc/OrcABISupport.h"
|
||||
#include "llvm/ExecutionEngine/Orc/OrcRemoteTargetServer.h"
|
||||
#include "llvm/Support/Debug.h"
|
||||
#include "llvm/Support/DynamicLibrary.h"
|
||||
#include "llvm/Support/Process.h"
|
||||
#include <sstream>
|
||||
|
||||
#include "../RemoteJITUtils.h"
|
||||
|
||||
using namespace llvm;
|
||||
using namespace llvm::orc;
|
||||
using namespace llvm::sys;
|
||||
|
||||
#ifdef __x86_64__
|
||||
typedef OrcX86_64_SysV HostOrcArch;
|
||||
#else
|
||||
typedef OrcGenericABI HostOrcArch;
|
||||
#endif
|
||||
|
||||
ExitOnError ExitOnErr;
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
|
||||
if (argc != 3) {
|
||||
errs() << "Usage: " << argv[0] << " <input fd> <output fd>\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
ExitOnErr.setBanner(std::string(argv[0]) + ":");
|
||||
|
||||
int InFD;
|
||||
int OutFD;
|
||||
{
|
||||
std::istringstream InFDStream(argv[1]), OutFDStream(argv[2]);
|
||||
InFDStream >> InFD;
|
||||
OutFDStream >> OutFD;
|
||||
}
|
||||
|
||||
if (sys::DynamicLibrary::LoadLibraryPermanently(nullptr)) {
|
||||
errs() << "Error loading program symbols.\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
auto SymbolLookup = [](const std::string &Name) {
|
||||
return RTDyldMemoryManager::getSymbolAddressInProcess(Name);
|
||||
};
|
||||
|
||||
auto RegisterEHFrames = [](uint8_t *Addr, uint32_t Size) {
|
||||
RTDyldMemoryManager::registerEHFramesInProcess(Addr, Size);
|
||||
};
|
||||
|
||||
auto DeregisterEHFrames = [](uint8_t *Addr, uint32_t Size) {
|
||||
RTDyldMemoryManager::deregisterEHFramesInProcess(Addr, Size);
|
||||
};
|
||||
|
||||
FDRawChannel Channel(InFD, OutFD);
|
||||
typedef remote::OrcRemoteTargetServer<FDRawChannel, HostOrcArch> JITServer;
|
||||
JITServer Server(Channel, SymbolLookup, RegisterEHFrames, DeregisterEHFrames);
|
||||
|
||||
while (!Server.receivedTerminate())
|
||||
ExitOnErr(Server.handleOne());
|
||||
|
||||
close(InFD);
|
||||
close(OutFD);
|
||||
|
||||
return 0;
|
||||
}
|
21
external/llvm/tools/lli/ChildTarget/LLVMBuild.txt
vendored
Normal file
21
external/llvm/tools/lli/ChildTarget/LLVMBuild.txt
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
;===- ./tools/lli/ChildTarget/LLVMBuild.txt --------------------*- Conf -*--===;
|
||||
;
|
||||
; The LLVM Compiler Infrastructure
|
||||
;
|
||||
; This file is distributed under the University of Illinois Open Source
|
||||
; License. See LICENSE.TXT for details.
|
||||
;
|
||||
;===------------------------------------------------------------------------===;
|
||||
;
|
||||
; This is an LLVMBuild description file for the components in this subdirectory.
|
||||
;
|
||||
; For more information on the LLVMBuild system, please see:
|
||||
;
|
||||
; http://llvm.org/docs/LLVMBuild.html
|
||||
;
|
||||
;===------------------------------------------------------------------------===;
|
||||
|
||||
[component_0]
|
||||
type = Tool
|
||||
name = lli-child-target
|
||||
parent = lli
|
Reference in New Issue
Block a user