|
21 | 21 | #include "llvm/Support/Casting.h"
|
22 | 22 | #include "llvm/Support/Path.h"
|
23 | 23 |
|
24 |
| -/home/maximus/cppyy-interop-dev/CppInterOp/llvm-project/compiler-rt/lib/orc/macho_platform.cpp |
25 |
| - |
26 |
| -#ifdef USE_CLING |
27 |
| - |
28 |
| -#include "cling/Interpreter/DynamicLibraryManager.h" |
29 |
| -#include "cling/Interpreter/Interpreter.h" |
30 |
| -#include "cling/Interpreter/Transaction.h" |
31 |
| -#include "cling/Interpreter/Value.h" |
32 |
| - |
33 |
| -#include "cling/Utils/AST.h" |
34 |
| - |
35 |
| -namespace Cpp { |
36 |
| -namespace Cpp_utils = cling::utils; |
37 |
| -} |
38 |
| - |
39 |
| -namespace compat { |
40 |
| - |
41 |
| -using Interpreter = cling::Interpreter; |
42 |
| - |
43 | 24 | #ifdef __APPLE__
|
44 |
| -#include <mach-o/dyld.h> |
45 |
| -#include <sys/stat.h> |
| 25 | +// #include <mach-o/dyld.h> |
| 26 | +// #include <sys/stat.h> |
| 27 | +#include <dlfcn.h> |
46 | 28 | // Define a minimal mach header for JIT'd code.
|
47 |
| -static MachO::mach_header_64 fake_mach_header = { |
48 |
| - .magic = MachO::MH_MAGIC_64, |
49 |
| - .cputype = MachO::CPU_TYPE_ARM64, |
50 |
| - .cpusubtype = MachO::CPU_SUBTYPE_ARM64_ALL, |
51 |
| - .filetype = MachO::MH_DYLIB, |
| 29 | +static llvm::MachO::mach_header_64 fake_mach_header = { |
| 30 | + .magic = llvm::MachO::MH_MAGIC_64, |
| 31 | + .cputype = llvm::MachO::CPU_TYPE_ARM64, |
| 32 | + .cpusubtype = llvm::MachO::CPU_SUBTYPE_ARM64_ALL, |
| 33 | + .filetype = llvm::MachO::MH_DYLIB, |
52 | 34 | .ncmds = 0,
|
53 | 35 | .sizeofcmds = 0,
|
54 | 36 | .flags = 0,
|
@@ -77,7 +59,25 @@ int find_dynamic_unwind_sections(uintptr_t addr,
|
77 | 59 | typedef int (*unw_find_dynamic_unwind_sections)(
|
78 | 60 | uintptr_t addr, struct unw_dynamic_unwind_sections* info);
|
79 | 61 |
|
80 |
| -#endif |
| 62 | +#endif // #ifdef __APPLE__ |
| 63 | + |
| 64 | + |
| 65 | +#ifdef USE_CLING |
| 66 | + |
| 67 | +#include "cling/Interpreter/DynamicLibraryManager.h" |
| 68 | +#include "cling/Interpreter/Interpreter.h" |
| 69 | +#include "cling/Interpreter/Transaction.h" |
| 70 | +#include "cling/Interpreter/Value.h" |
| 71 | + |
| 72 | +#include "cling/Utils/AST.h" |
| 73 | + |
| 74 | +namespace Cpp { |
| 75 | +namespace Cpp_utils = cling::utils; |
| 76 | +} |
| 77 | + |
| 78 | +namespace compat { |
| 79 | + |
| 80 | +using Interpreter = cling::Interpreter; |
81 | 81 |
|
82 | 82 | inline void maybeMangleDeclName(const clang::GlobalDecl& GD,
|
83 | 83 | std::string& mangledName) {
|
|
0 commit comments