94 Commits

Author SHA1 Message Date
Lang Hames
6bf185920b [ORC] Support visionOS in LC_BUILD_VERSIONs for JITDylibs.
rdar://127846581
2024-05-16 14:47:37 +10:00
Ben Langmuir
2766f2174e
[ORC] Loosen __objc_imageinfo flag merging to match ld (#91767)
Allow mixing objects with/without signed class ro data and category
class properties as long as it happens before we register the metadata.
These combinations are a warning in ld, not a hard error. The only case
that is ABI-breaking is if we already registered with the feature
enabled but later try to load an object that doesn't support it.

rdar://127336061
2024-05-14 08:08:18 -07:00
Lang Hames
e40bc8e509 [ORC][MachO] Make BuildVersionOpts::fromTriple result optional, add test.
Only platform specific darwin OS values (e.g. macosx, ios, watchos, ...) can be
mapped to an LC_BUILD_VERSION platform. For all other values return an empty
optional to indicate that the load command can't be constructed.

Also fixes the simulator conditions to return the correct platform, and adds a
testcase.
2024-03-14 15:11:39 -07:00
Lang Hames
2c80a9accb [ORC][MachO] Pluralize member name.
This member switched from an optional to a vector in 0f252e7bd83.
2024-03-14 10:38:49 -07:00
Lang Hames
0f252e7bd8 [ORC][MachO] Allow multiple LC_BUILD_VERSION commands.
No testcase: I'm still thinking about the best way to test this.
2024-03-14 09:45:28 -07:00
Lang Hames
e77a473601 [ORC][MachO] Simplify use of LC_BUILD_VERSION in JITDylib headers.
API clients can now set a MachO::HeaderOptions::BuildVersionOpts field to have
MachOPlatform add an LC_BUILD_VERSION load command to the Mach header for each
JITDylib.

No testcase yet. In the future we'll try to add a MachO parser to the ORC
runtime and extra test options to llvm-jitlink for this.

This commit also incidentally fixes a bug in the MachOBuilder class that lead to
a delegation cycle.
2024-03-05 14:46:22 -08:00
Ben Langmuir
b08aca7a4f [ORC][MachO] Support common load commands in the platform's mach-o header builder
Add a HeaderOptions struct that can be used to configure commonly-used
load commands LC_ID_DYLIB, LC_LOAD_DYLIB, and LC_RPATH when setupDylib
creates a mach-o header.
2024-01-18 09:14:15 -08:00
Ben Langmuir
08c5f1fede
[ORC] Add absoluteSymbolsLinkGraph to expose absolute symbols to platform (#77008)
Adds a function to create a LinkGraph of absolute symbols, and a
callback in dynamic library search generators to enable using it to
expose its symbols to the platform/orc runtime. This allows e.g. using
__orc_rt_run_program to run a precompiled function that was found via
dlsym. Ideally we would use this in llvm-jitlink's own search generator,
but it will require more work to align with the Process/Platform
JITDylib split, so not handled here.

As part of this change we need to handle LinkGraphs that only have
absolute symbols.
2024-01-05 15:32:29 -08:00
Lang Hames
85c3953934 [ORC][MachO] Expose SimpleMachOHeaderMU and related utilities.
SimpleMachOHeaderMU can be used as a convenient base for classes that create
custom MachO headers. Instances of these custom classes can be used by passing
a MachOHeaderMUBuilder using the MachOPlatform extensions added in ef314d39b92.
2023-12-11 14:30:32 -08:00
Lang Hames
ef314d39b9 [ORC][MachO] Enable customization of MachO-headers produced by MachOPlatform.
MachOPlatform users can now override the default MachO header graph produced
for JITDylibs when setupJITDylib is called.
2023-12-11 09:59:21 -08:00
Lang Hames
93509b4462 [ORC-RT][ORC][MachO] Fix some issues with executor-side symbol tables.
1. Prevent deadlock by unlocking JDStatesMutex when calling back to the
   controller to request a push of new symbols. (If JDStatesMutex is locked
   then the push operation can't register the new symbols, and so can't
   complete).

2. Record MachOPlatform runtime symbols during bootstrap and attach their
   registration to the bootstrap-completion graph, similar to the way that
   deferred allocation actions are handled. We can't register the symbols
   the normal way during bootstrap since the symbol registration function is
   itself in the process of being materialized.

3. Add dlsym testcases to exercise these fixes.
2023-12-07 14:38:51 -08:00
Lang Hames
4288fb8c26 [ORC][MachO] Fix JITDylib header-addr tracking in MachOPlatform.
HeaderAddr shouldn't be a member variable of MachOPlatformPlugin: there's only
one plugin instance shared between all JITDylibs, so the shared HeaderAddr will
be overwritten in an unpredictable and unsafe way. We haven't seen any issues
due to this yet, but it triggered failures during testing of an upcoming
llvm-jitlink patch (e.g. ORC-RT test Darwin/x86-64/jit-re-dlopen-trivial.S).
This patch pre-fixes the issue in advance of the llvm-jitlink patch landing.

This patch also removes some stale debugging output in MachOPlatform.
2023-12-04 18:30:33 -08:00
Lang Hames
bb41fc682e [ORC-RT][ORC][MachO] Add executor-side symbol tables to MachO platform support.
Adds symbol tables to the JITDylibState struct in the ORC runtime
MachOPlatformRuntimeState class. This table will hold the addresses of
materialized symbols (registered by a new JITLink pass in MachOPlatform),
allowing these to be looked up in the executor without an IPC request to the
controller.

The old lookup-symbols callback (made by the runtime in response to dlsym
lookups) is replaced with a push-symbols callback that can trigger
materialization of requested symbols.

Holding a symbol table on the executor side should make repeat calls to dlsym
(and other symbol lookup operations) cheaper since the IPC to trigger
materialization happens at most once per symbol. It should also enable us (at
some point in the future) to symbolicate backtraces in JIT'd code even if the
controller process is gone (e.g. detached or crashed). The trade-off for this
is increased memory consumption in the executor and larger JIT'd data transfers
(since symbol names are now transferred to the executor unconditionally, even
though they may never be used).
2023-12-02 15:25:25 -08:00
Lang Hames
b2e7527318 [ORC] Fix some typos in comments in MachOPlatform. 2023-11-16 16:14:15 -08:00
Ben Langmuir
05a0d94416
[orc][mach-o] Fix mixing objc and swift code in a single JITDylib (#69258)
The system linker merges __objc_imageinfo flags values to select a
compatible set of flags using the minimum swift version and only
erroring on incompatible ABIs. Match that behaviour in the orc macho
platform. One wrinkle is that the JIT can add new objects after the
dylib is running code. In that case we only check for known incompatible
flags and ignore the swift version. It's too late to change the flags at
that point and swift version is unlikely to change runtime behaviour in
practice.
2023-11-03 08:32:08 -07:00
Kazu Hirata
a9d5056862 Use llvm::endianness (NFC)
Now that llvm::support::endianness has been renamed to
llvm::endianness, we can use the shorter form.  This patch replaces
support::endianness with llvm::endianness.
2023-10-10 21:54:15 -07:00
Kazu Hirata
b05dbc4d5f [llvm] Use llvm::endianness::{big,little,native} (NFC)
Now that llvm::support::endianness has been renamed to
llvm::endianness, we can use the shorter form.  This patch replaces
support::endianness::{big,little,native} with
llvm::endianness::{big,little,native}.
2023-10-10 20:14:20 -07:00
Kazu Hirata
6b31b02600
[Support] Deprecate system_endianness (#68279)
system_endianness() just returns llvm::endianness::native, a
compile-time constant equivalent to std::native in C++20.  This patch
deprecates system_endianness() while replacing all invocations of
system_endianness() with llvm::endianness::native.

While we are at it, this patch replaces
llvm::support::endianness::{big,little} with
llvm::endianness::{big,little} in those statements that happen to call
system_endianness().  It does not go out of its way to replace other
occurrences of llvm::support::endianness::{big,little}.
2023-10-05 09:17:09 -07:00
Lang Hames
4db6c717c4 [ORC] Switch from strncpy to memcpy to silence more GCC warnings.
GCC warns when strncpy doesn't copy the null terminator. See discussion at
https://reviews.llvm.org/rG9d701c8a8d65.
2023-07-14 10:51:13 -07:00
Lang Hames
59715e7ff3 Switch to strncpy to silence GCC stringop overflow warnings.
Thanks to Simon Pilgrim for letting me know about these in
https://reviews.llvm.org/rG9d701c8a8d65.
2023-07-13 11:16:54 -07:00
Lang Hames
81cb43f44d [ORC][MachOPlatform] Don't add InitSectionSymbols for __objc_imageinfo.
The __objc_imageinfo section may be deleted (leaving dangling references to any
symbols that it contains), and shouldn't have any dependencies anyway. This
patch verifies that the section has no dependencies and then skips the section.

rdar://108469243
2023-05-05 00:52:03 -07:00
Lang Hames
9d701c8a8d [ORC] Fix fallout from switch to _objc_map/load_images-based registration.
In f448d44663a we switched to calling _objc_map_images and _objc_load_images
for MachO language metadata registration. This patch fixes some bugs arising
from that change:

(1) __objc_imageinfo processing was moved to a post-allocation pass, but this
    prevents us from discarding the redundant copies. This commit moves
    processing back to a pre-prune pass and inserts a symbol for the uniqued
    __objc_image section. Runtime objects use an edge pointing to this symbol
    to access the address.

(2) We were assuming that _objc_map_images & _objc_load_images were available
    in the Objective-C runtime on 10.15, but these functions didn't become
    available until later. This commit bumps the macOS version requirement to
    13.1 where the functions should be available.

(3) The ORC-RT trivial-swift-types-section.S test was missing an
    __objc_unwindinfo section, which triggered an assert that should have
    been an error. The assert has been turned into an error, and the testcase
    has been updated to include an __objc_imageinfo.

rdar://107846455
2023-04-11 16:48:26 -07:00
Lang Hames
2c7f511877 [ORC][MachO] Remove unused variables. 2023-04-08 16:48:13 -07:00
Lang Hames
376e90fdb4 [ORC] Fix reference to struct member in f448d44663a.
A map value was converted from a tuple to a struct during development, but I
missed a use in an assert.
2023-04-08 16:11:14 -07:00
Lang Hames
f448d44663 [ORC][ORC-RT][MachO] Use _objc_(map|load)_images for ObjC & Swift registration.
This patch drops the individual registration calls to the ObjC and Swift
runtimes (for selectors, classes, etc.), and instead creates a Mach header and
load commands that can be passed to _objc_map_images and _objc_load_images to
trigger registration and execution of +load methods. This approach supports
categories (for which there is no current registration API), and more closely
follows dyld's ObjC & Swift registration path.
2023-04-08 15:54:02 -07:00
Lang Hames
88db195695 [ORC][MachO] __objc_imageinfo isn't a MachO "object platform section".
Commit 2666231d173 fixed a typo ("__objc_image_info" was corrected to
"__objc_imageinfo"), but this has exposed a bug where we were adding this
section to the list of platform sections to register with the ORC runtime.
The ORC runtime's MachO "object platform section" code doesn't recognize
this section (it's handled elsewhere) and errors out on it.

The solution is simply to remove __objc_imageinfo from the list of sections
to register in MachOPlatform::PlatformPlugin::registerObjectPlatformSections.
2023-03-31 20:41:32 -07:00
Lang Hames
fdd9df1952 [ORC] Remove more unnecessary ExecutorAddr::getValue calls. 2023-03-31 20:41:32 -07:00
Lang Hames
8b1771bd9f [ORC] Move most ORC APIs to ExecutorAddr, introduce ExecutorSymbolDef.
ExecutorAddr was introduced in b8e5f918166 as an eventual replacement for
JITTargetAddress. ExecutorSymbolDef is introduced in this patch as a
replacement for JITEvaluatedSymbol: ExecutorSymbolDef is an (ExecutorAddr,
JITSymbolFlags) pair, where JITEvaluatedSymbol was a (JITTargetAddress,
JITSymbolFlags) pair.

A number of APIs had already migrated from JITTargetAddress to ExecutorAddr,
but many of ORC's internals were still using the older type. This patch aims
to address that.

Some public APIs are affected as well. If you need to migrate your APIs you can
use the following operations:

* ExecutorAddr::toPtr replaces jitTargetAddressToPointer and
  jitTargetAddressToFunction.

* ExecutorAddr::fromPtr replace pointerToJITTargetAddress.

* ExecutorAddr(JITTargetAddress) creates an ExecutorAddr value from a
  JITTargetAddress.

* ExecutorAddr::getValue() creates a JITTargetAddress value from an
  ExecutorAddr.

JITTargetAddress and JITEvaluatedSymbol will remain in JITSymbol.h for now, but
the aim will be to eventually deprecate and remove these types (probably when
MCJIT and RuntimeDyld are deprecated).
2023-03-27 17:37:58 -07:00
Lang Hames
38d16f509a [ORC] Drop StaticLibraryDefinitionGenerator Load/Create overloads with triples.
We can get the triple from the ExecutionSession, so clients shouldn't have to
provide it.
2023-03-01 15:37:09 -08:00
Lang Hames
0df66569e5 [ORC] Add an ExecutionSession::getTargetTriple convenience function.
Forwards to ExecutorProcessControl::getTargetTriple, and saves clients the
trouble of spelling 'getExecutorProcessControl()' everywhere.
2023-02-21 19:57:36 -08:00
Lang Hames
be2fc577c3 [ORC] Add MachOPlatform::Create overload -- Pass ORC runtime as def generator.
The existing Create method took a path to the ORC runtime and created a
StaticLibraryDefinitionGenerator for it. The new overload takes a
std::unique_ptr<DefinitionGenerator> directly instead. This provides more
flexibility when constructing MachOPlatforms. E.g. The runtime archive can be
embedded in a special section in the ORC controller executable or library,
rather than being on-disk.
2023-02-12 13:30:37 -08:00
Lang Hames
10b5fec256 [JITLink][ORC] Add LinkGraph::allocateCString method.
Renames the existing allocateString method to allocateContent and adds a pair of
allocateCString methods.

The previous allocateString method did not include a null-terminator. It behaved
the same as allocateContent except with a Twine input, rather than an
ArrayRef<char>. Renaming allocateString to allocateBuffer (overloading the
existing method) makes this clearer.

The new allocateCString methods allocate the given content plus a
null-terminator character, and return a buffer covering both the string and
null-terminator. This makes them suitable for creating c-string content for
jitlink::Blocks.

Existing users of the old allocateString method have been updated to use the
new allocateContent overload.
2023-02-11 12:05:28 -08:00
Lang Hames
3d4e9d5eb0 [ORC] Move ORC-specific object format details into OrcShared.
This allows these details to be shared with JITLink, which is allowed to
depend on the OrcShared library (but not on OrcJIT).
2023-02-11 10:51:38 -08:00
Lang Hames
3507df9c20 [ORC][ORC-RT] Add support for callback-based lookup of JIT'd MachO unwind info.
In LLVM the MachOPlatform class is modified to identify unwind info sections
and the address ranges of the functions these sections cover. These address
ranges are then communicated to the ORC runtime by attaching them to the
register-object-platform-sections allocation action.

In the ORC runtime the unwind-info section addresses are recorded and used to
support lookup of unwind info via the new `findDynamicUnwindSections` function.
At bootstrap time the ORC runtime checks for the presence of new
unwind-info-lookup-registration functions in libunwind (see
https://reviews.llvm.org/D142176), and if available uses them to register the
`findDynamicUnwindSections` function with libunwind to enable callback-based
lookup. If the new unwind-info-lookup-registration functions are not available
then the ORC runtime falls back to using the existing libunwind registration
APIs.

The callback-based scheme is intended to address three shortcomings in the
current registration scheme for JIT'd unwind info on Darwin: (1) Lack of
compact-unwind support, (2) inability to describe the subarchitecture of JIT'd
frames, and (3) lack of efficient address-based lookup data structures in
libunwind.

For more details see the proposed libunwind changes in
https://reviews.llvm.org/D142176.
2023-01-19 22:37:57 -08:00
Lang Hames
217fd59cc5 [ORC] Introduce deferred allocation-actions scheme for MachOPlatform bootstrap.
This patch modifies the MachOPlatform bootstrap process to record allocation
actions for ORC runtime platform support code in a "deferred actions" vector
rather than attaching it to the corresponding LinkGraphs up-front. The deferred
allocation-actions are run after all the platform support code has been loaded
by attaching them to a separate "bootstrap-complete" graph.

This change should allow the mach-o platform support code in the ORC runtime to
use advanced mach-o platform features (e.g. static inits, TLVs), provided that
the support code does not use these features at runtime before the bootstrap
process completes, or after the shutdown process starts. This is a nice
improvement in and of itself but is motivated by specific future plans: we
want to start recording unwind info in the mach-o platform state object*, and
the recording functions will have their own frame info that needs registering.
The deferred allocation-actions scheme allows for this.

* The plan is to add a new unwind-info-lookup path to libunwind to allow it to
  call back to the ORC runtime to find unwind sections. This will simplify the
  implementation of support for JIT'd compact-unwind info.
2023-01-13 16:15:57 -08:00
Lang Hames
cfa5fd4849 [ORC] Tidy up MachOPlatform's references to ORC runtime registration functions.
Use an private struct, RuntimeFunction, to to keep the name and address of each
registration function together, and rename the member variables with their purpose
rather than the full name of the function in the runtime.
2023-01-12 13:33:11 -08:00
Fangrui Song
79e3e65b26 [ExecutionEngine] llvm::Optional => std::optional 2022-12-14 10:18:08 +00:00
Kazu Hirata
0b5ba08013 [Orc] Use std::optional in MachOPlatform.cpp (NFC)
This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
2022-11-26 15:22:05 -08:00
Lang Hames
5f479ee7fc [ORC] Capture JD by value in MachOPlatform::pushInitializersLoop.
The lambda may run after pushInitializersLoop returns.
2022-11-11 16:01:25 -08:00
Lang Hames
d3d9f7caf9 [ORC][JITLink] Move MemoryFlags.h (MemProt, AllocGroup,...) from JITLink to ORC.
Moving these types to OrcShared eliminates the need for the separate
WireProtectionFlags type.
2022-10-03 19:35:34 -07:00
Lang Hames
47e9e58808 [ORC][ORC-RT][MachO] Reset __data and __common sections on library close.
If we want to be able to close and then re-open a library then we need to reset
the data section states when the library is closed. This commit updates
MachOPlatform and the ORC runtime to track __data and __common sections, and
reset the state in MachOPlatformRuntimeState::dlcloseDeinitialize.

This is only a first step to full support -- there are other data sections that
we're not capturing, and we'll probably want a more efficient representation
for the sections (rather than passing their string name over IPC), but this is
a reasonable first step.

This commit also contains a fix to MapperJITLinkMemoryManager that prevents it
from calling OnDeallocated twice in the case of an error.
2022-09-16 13:40:19 -07:00
Kazu Hirata
9606608474 [llvm] Use x.empty() instead of llvm::empty(x) (NFC)
I'm planning to deprecate and eventually remove llvm::empty.

I thought about replacing llvm::empty(x) with std::empty(x), but it
turns out that all uses can be converted to x.empty().  That is, no
use requires the ability of std::empty to accept C arrays and
std::initializer_list.

Differential Revision: https://reviews.llvm.org/D133677
2022-09-12 13:34:35 -07:00
Lang Hames
2bf87a4946 [ORC][MachO] Fix MachOPlatform after 9189a26664b.
Commit 9189a26664b caused llvm-jitlink to create bare JITDylibs to wrap real
dylibs loaded via -preload. This exposed a bug in MachOPlatform where we
assumed that all JITDylibs had been registered with the platform through
MachOPlatform::setupJITDylib (bare JITDylibs are _not_ run through this
function), and errored out where this was not the case.
This bug in MachOPlatform was causing test failures in compilert-rt:

Failed Tests (2):
  ORC-x86_64-darwin :: TestCases/Darwin/x86-64/trivial-objc-methods.S
  ORC-x86_64-darwin :: TestCases/Darwin/x86-64/trivial-swift-types-section.S

This commit fixes the issue by skipping JITDylibs that haven't been registered
with the platform via MachOPlatform::setupJITDylib.
2022-08-17 18:18:48 -07:00
Peter S. Housel
1aa71f8679 [ORC][ORC_RT] Integrate ORC platforms with LLJIT and lli
This change enables integrating orc::LLJIT with the ORCv2
platforms (MachOPlatform and ELFNixPlatform) and the compiler-rt orc
runtime. Changes include:

- Adding SPS wrapper functions for the orc runtime's dlfcn emulation
  functions, allowing initialization and deinitialization to be invoked
  by LLJIT.

- Changing the LLJIT code generation default to add UseInitArray so
  that .init_array constructors are generated for ELF platforms.

- Integrating the ORCv2 Platforms into lli, and adding a
  PlatformSupport implementation to the LLJIT instance used by lli which
  implements initialization and deinitialization by calling the new
  wrapper functions in the runtime.

Reviewed By: lhames

Differential Revision: https://reviews.llvm.org/D126492
2022-06-09 22:47:58 -07:00
Lang Hames
f9aef477eb [ORC][ORC-RT] Rewrite the MachO platform to use allocation actions.
This patch updates the MachO platform (both the ORC MachOPlatform class and the
ORC-Runtime macho_platform.* files) to use allocation actions, rather than EPC
calls, to transfer the initializer information scraped from each linked object.
Interactions between the ORC and ORC-Runtime sides of the platform are
substantially redesigned to accomodate the change.

The high-level changes in this patch are:

1. The MachOPlatform::setupJITDylib method now calls into the runtime to set up
   a dylib name <-> header mapping, and a dylib state object (JITDylibState).

2. The MachOPlatformPlugin builds an allocation action that calls the
   __orc_rt_macho_register_object_platform_sections and
   __orc_rt_macho_deregister_object_platform_sections functions in the runtime
   to register the address ranges for all "interesting" sections in the object
   being allocated (TLS data sections, initializers, language runtime metadata
   sections, etc.).

3. The MachOPlatform::rt_getInitializers method (the entry point in the
   controller for requests from the runtime for initializer information) is
   replaced by MachOPlatform::rt_pushInitializers. The former returned a data
   structure containing the "interesting" section address ranges, but these are
   now handled by __orc_rt_macho_register_object_platform_sections. The new
   rt_pushInitializers method first issues a lookup to trigger materialization
   of the "interesting" sections, then returns the dylib dependence tree rooted
   at the requested dylib for dlopen to consume. (The dylib dependence tree is
   returned by rt_pushInitializers, rather than being handled by some dedicated
   call, because rt_pushInitializers can alter the dependence tree).

The advantage of these changes (beyond the performance advantages of using
allocation actions) is that it moves more information about the materialized
portions of the JITDylib into the executor. This tends to make the runtime
easier to reason about, e.g. the implementation of dlopen in the runtime is now
recursive, rather than relying on recursive calls in the controller to build a
linear data structure for consumption by the runtime. This change can also make
some operations more efficient, e.g. JITDylibs can be dlclosed and then
re-dlopened without having to pull all initializers over from the controller
again.

In addition to the high-level changes, there are some low-level changes to ORC
and the runtime:

* In ORC, at ExecutionSession teardown time JITDylibs are now destroyed in
reverse creation order. This is on the assumption that the ORC runtime will be
loaded into an earlier dylib that will be used by later JITDylibs. This is a
short-term solution to crashes that arose during testing when the runtime was
torn down before its users. Longer term we will likely destroy dylibs in
dependence order.

* toSPSSerializable(Expected<T> E) is updated to explicitly initialize the T
value, allowing it to be used by Ts that have explicit constructors.

* The ORC runtime now (1) attempts to track ref-counts, and (2) distinguishes
not-yet-processed "interesting" sections from previously processed ones. (1)
is necessary for standard dlopen/dlclose emulation. (2) is intended as a step
towards better REPL support -- it should enable future runtime calls that
run only newly registered initializers ("dlopen_more", "dlopen_additions",
...?).
2022-02-08 17:28:13 +11:00
Lang Hames
9eb4939b86 [ORC] Allow JITDylib::getDFSLinkOrder and friends to fail for defunct JITDylibs.
Calls to JITDylib's getDFSLinkOrder and getReverseDFSLinkOrder methods (both
static an non-static versions) are now valid to make on defunct JITDylibs, but
will return an error if any JITDylib in the link order is defunct.

This means that platforms can safely lookup link orders by name in response to
jit-dlopen calls from the ORC runtime, even if the call names a defunct
JITDylib -- the call will just fail with an error.
2022-01-20 17:45:32 +11:00
Lang Hames
ade71641dc [ORC] Add Platform::teardownJITDylib method.
This is a counterpart to Platform::setupJITDylib, and is called when JITDylib
instances are removed (via ExecutionSession::removeJITDylib).

Upcoming MachOPlatform patches will use this to clear per-JITDylib data when
JITDylibs are removed.
2022-01-18 16:27:02 +11:00
Lang Hames
089acf2522 [ORC][JITLink] Merge JITLink AllocActionCall and ORC WrapperFunctionCall.
These types performed identical roles. Merging them simplifies interoperability
between JITLink and ORC APIs (allowing us to address a few FIXMEs).
2022-01-08 16:46:15 +11:00
Lang Hames
118e953b18 Re-apply "[JITLink] Update JITLink to use ExecutorAddr rather... " with fixes.
This re-applies 133f86e95492b2a00b944e070878424cfa73f87c, which was reverted in
c5965a411c635106a47738b8d2e24db822b7416f while I investigated bot failures.

The original failure contained an arithmetic conversion think-o (on line 419 of
EHFrameSupport.cpp) that could cause failures on 32-bit platforms. The issue
should be fixed in this patch.
2022-01-06 17:22:21 +11:00
Lang Hames
c5965a411c Revert "[JITLink] Update JITLink to use ExecutorAddr rather than..."
This reverts commit 133f86e95492b2a00b944e070878424cfa73f87c while I investigate
the bot failures at https://lab.llvm.org/buildbot#builders/186/builds/3370.
2022-01-06 15:20:21 +11:00