aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-jitlink/llvm-jitlink.cpp
AgeCommit message (Collapse)AuthorFilesLines
2021-09-28[llvm-jitlink] Add a -slab-page-size option to override process page size.Lang Hames1-1/+61
The slab allocator is frequently used in -noexec tests where we want a consistent memory layout. In this context we also want to set the effective page size, rather than using the page size of the host process, since not all systems use the same page size. The -slab-page-size option allows us to set the page size for such tests. The -slab-page-size option will also be honored in exec mode when using the slab allocator, but will trigger an error if the requested size is not a multiple of the actual process page size. This option was motivated by test failures on a ppc64 bot that was returning zero from sys::Process::getPageSize(), so it also contains a check for errors and zero results from that function if the -slab-page-size option is absent. Existing slab allocator tests will be updated to use this option in a follow-up commit so that we can point the failing bot at this commit and observe errors associated with sys::Process::getPageSize().
2021-09-27clang-formatLang Hames1-7/+6
2021-09-27[llvm-jitlink] Add more information about allocation failures.Lang Hames1-1/+6
Slab allocator failures will now report requested size and remaining capacity.
2021-09-27[ORC] Switch from JITTargetAddress to ExecutorAddr for EPC-call APIs.Lang Hames1-8/+8
Part of the ongoing move to ExecutorAddr.
2021-09-12Re-apply bb27e456435 and 5629afea910 with fixes.Lang Hames1-56/+6
This reapplies bb27e4564355243e479cab40885d6e0f7f640572 (SimpleRemoteEPC support) and 2269a941a450a0d395161cfb792be58870b2875b (#include <mutex> fix) with further fixes to support building with LLVM_ENABLE_THREADS=Off.
2021-09-11Revert 5629afea910 and bb27e456435 while I look into bot failures.Lang Hames1-6/+56
This reverts commit 5629afea9109d3b72064cbe70e1ca91ffb9dc0a2 ("[ORC] Add missing include."), and bb27e4564355243e479cab40885d6e0f7f640572 ("[ORC] Add SimpleRemoteEPC: ExecutorProcessControl over SPS + abstract transport."). The SimpleRemoteEPC patch currently assumes availability of threads, and needs to be rewritten with LLVM_ENABLE_THREADS guards.
2021-09-11[ORC] Add SimpleRemoteEPC: ExecutorProcessControl over SPS + abstract transport.Lang Hames1-56/+6
SimpleRemoteEPC is an ExecutorProcessControl implementation (with corresponding new server class) that uses ORC SimplePackedSerialization (SPS) to serialize and deserialize EPC-messages to/from byte-buffers. The byte-buffers are sent and received via a new SimpleRemoteEPCTransport interface that can be implemented to run SimpleRemoteEPC over whatever underlying transport system (IPC, RPC, network sockets, etc.) best suits your use case. The SimpleRemoteEPCServer class provides executor-side support. It uses a customizable SimpleRemoteEPCServer::Dispatcher object to dispatch wrapper function calls to prevent the RPC thread from being blocked (a problem in some earlier remote-JIT server implementations). Almost all functionality (beyond the bare basics needed to bootstrap) is implemented as wrapper functions to keep the implementation simple and uniform. Compared to previous remote JIT utilities (OrcRemoteTarget*, OrcRPCExecutorProcessControl), more consideration has been given to disconnection and error handling behavior: Graceful disconnection is now always initiated by the ORC side of the connection, and failure at either end (or in the transport) will result in Errors being delivered to both ends to enable controlled tear-down of the JIT and Executor (in the Executor's case this means "as controlled as the JIT'd code allows"). The introduction of SimpleRemoteEPC will allow us to remove other remote-JIT support from ORC (including the legacy OrcRemoteTarget* code used by lli, and the OrcRPCExecutorProcessControl and OrcRPCEPCServer classes), and then remove ORC RPC itself. The llvm-jitlink and llvm-jitlink-executor tools have been updated to use SimpleRemoteEPC over file descriptors. Future commits will move lli and other tools and example code to this system, and remove ORC RPC.
2021-08-27[ORC][ORC-RT] Reapply "Introduce ELF/*nix Platform and runtime..." with fixes.Lang Hames1-0/+9
This reapplies e256445bfff, which was reverted in 45ac5f54418 due to bot errors (e.g. https://lab.llvm.org/buildbot/#/builders/112/builds/8599). The issue that caused the bot failure was fixed in 2e6a4fce356.
2021-08-18Revert "[ORC-RT][ORC] Introduce ELF/*nix Platform and runtime support."Lang Hames1-9/+0
This reverts commit e256445bfff12013c3c4ad97da4aa69d25b175b5. This commit broke some of the bots (see e.g. https://lab.llvm.org/buildbot/#/builders/112/builds/8599). Reverting while I investigate.
2021-08-18[ORC-RT][ORC] Introduce ELF/*nix Platform and runtime support.Lang Hames1-0/+9
This change adds support to ORCv2 and the Orc runtime library for static initializers, C++ static destructors, and exception handler registration for ELF-based platforms, at present Linux and FreeBSD on x86_64. It is based on the MachO platform and runtime support introduced in bb5f97e3ad1. Patch by Peter Housel. Thanks very much Peter! Reviewed By: lhames Differential Revision: https://reviews.llvm.org/D108081
2021-08-05[llvm-jitlink] Don't try to guess the ORC runtime path.Lang Hames1-60/+8
ORC-runtime regression tests will now explicitly specify the runtime path.
2021-07-27[ORC] Require ExecutorProcessControl when constructing an ExecutionSession.Lang Hames1-23/+26
Wrapper function call and dispatch handler helpers are moved to ExecutionSession, and existing EPC-based tools are re-written to take an ExecutionSession argument instead. Requiring an ExecutorProcessControl instance simplifies existing EPC based utilities (which only need to take an ES now), and should encourage more utilities to use the EPC interface. It also simplifies process termination, since the session can automatically call ExecutorProcessControl::disconnect (previously this had to be done manually, and carefully ordered with the rest of JIT tear-down to work correctly).
2021-07-27[llvm-jitlink] Don't hardcode LLVM version number into the runtime path.Lang Hames1-1/+5
This should unbreak builders that were failing due to different patch numbers.
2021-07-21[llvm][tools] Hide more unrelated LLVM tool optionsTimm Bäder1-25/+34
Differential Revision: https://reviews.llvm.org/D106366
2021-07-19[ORC] Add missing std::move.Lang Hames1-1/+1
This should fix the build failure at https://lab.llvm.org/buildbot/#/builders/58/builds/11428.
2021-07-19[ORC][ORC-RT] Introduce ORC-runtime based MachO-Platform.Lang Hames1-52/+179
Adds support for MachO static initializers/deinitializers and eh-frame registration via the ORC runtime. This commit introduces cooperative support code into the ORC runtime and ORC LLVM libraries (especially the MachOPlatform class) to support macho runtime features for JIT'd code. This commit introduces support for static initializers, static destructors (via cxa_atexit interposition), and eh-frame registration. Near-future commits will add support for MachO native thread-local variables, and language runtime registration (e.g. for Objective-C and Swift). The llvm-jitlink tool is updated to use the ORC runtime where available, and regression tests for the new MachOPlatform support are added to compiler-rt. Notable changes on the ORC runtime side: 1. The new macho_platform.h / macho_platform.cpp files contain the bulk of the runtime-side support. This includes eh-frame registration; jit versions of dlopen, dlsym, and dlclose; a cxa_atexit interpose to record static destructors, and an '__orc_rt_macho_run_program' function that defines running a JIT'd MachO program in terms of the jit- dlopen/dlsym/dlclose functions. 2. Replaces JITTargetAddress (and casting operations) with ExecutorAddress (copied from LLVM) to improve type-safety of address management. 3. Adds serialization support for ExecutorAddress and unordered_map types to the runtime-side Simple Packed Serialization code. 4. Adds orc-runtime regression tests to ensure that static initializers and cxa-atexit interposes work as expected. Notable changes on the LLVM side: 1. The MachOPlatform class is updated to: 1.1. Load the ORC runtime into the ExecutionSession. 1.2. Set up standard aliases for macho-specific runtime functions. E.g. ___cxa_atexit -> ___orc_rt_macho_cxa_atexit. 1.3. Install the MachOPlatformPlugin to scrape LinkGraphs for information needed to support MachO features (e.g. eh-frames, mod-inits), and communicate this information to the runtime. 1.4. Provide entry-points that the runtime can call to request initializers, perform symbol lookup, and request deinitialiers (the latter is implemented as an empty placeholder as macho object deinits are rarely used). 1.5. Create a MachO header object for each JITDylib (defining the __mh_header and __dso_handle symbols). 2. The llvm-jitlink tool (and llvm-jitlink-executor) are updated to use the runtime when available. 3. A `lookupInitSymbolsAsync` method is added to the Platform base class. This can be used to issue an async lookup for initializer symbols. The existing `lookupInitSymbols` method is retained (the GenericIRPlatform code is still using it), but is deprecated and will be removed soon. 4. JIT-dispatch support code is added to ExecutorProcessControl. The JIT-dispatch system allows handlers in the JIT process to be associated with 'tag' symbols in the executor, and allows the executor to make remote procedure calls back to the JIT process (via __orc_rt_jit_dispatch) using those tags. The primary use case is ORC runtime code that needs to call bakc to handlers in orc::Platform subclasses. E.g. __orc_rt_macho_jit_dlopen calling back to MachOPlatform::rt_getInitializers using __orc_rt_macho_get_initializers_tag. (The system is generic however, and could be used by non-runtime code). The new ExecutorProcessControl::JITDispatchInfo struct provides the address (in the executor) of the jit-dispatch function and a jit-dispatch context object, and implementations of the dispatch function are added to SelfExecutorProcessControl and OrcRPCExecutorProcessControl. 5. OrcRPCTPCServer is updated to support JIT-dispatch calls over ORC-RPC. 6. Serialization support for StringMap is added to the LLVM-side Simple Packed Serialization code. 7. A JITLink::allocateBuffer operation is introduced to allocate writable memory attached to the graph. This is used by the MachO header synthesis code, and will be generically useful for other clients who want to create new graph content from scratch.
2021-07-01[ORC] Rename TargetProcessControl to ExecutorProcessControl. NFC.Lang Hames1-38/+39
This is a first step towards consistently using the term 'executor' for the process that executes JIT'd code. I've opted for 'executor' as the preferred term over 'target' as target is already heavily overloaded ("the target machine for the executor" is much clearer than "the target machine for the target").
2021-06-25[llvm] Rename StringRef _lower() method calls to _insensitive()Martin Storsjö1-3/+3
This is a mechanical change. This actually also renames the similarly named methods in the SmallString class, however these methods don't seem to be used outside of the llvm subproject, so this doesn't break building of the rest of the monorepo.
2021-05-23[MC] Refactor MCObjectFileInfo initialization and allow targets to create ↵Philipp Krones1-2/+1
MCObjectFileInfo This makes it possible for targets to define their own MCObjectFileInfo. This MCObjectFileInfo is then used to determine things like section alignment. This is a follow up to D101462 and prepares for the RISCV backend defining the text section alignment depending on the enabled extensions. Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D101921
2021-05-05[MC] Untangle MCContext and MCObjectFileInfoPhilipp Krones1-1/+2
This untangles the MCContext and the MCObjectFileInfo. There is a circular dependency between MCContext and MCObjectFileInfo. Currently this dependency also exists during construction: You can't contruct a MOFI without a MCContext without constructing the MCContext with a dummy version of that MOFI first. This removes this dependency during construction. In a perfect world, MCObjectFileInfo wouldn't depend on MCContext at all, but only be stored in the MCContext, like other MC information. This is future work. This also shifts/adds more information to the MCContext making it more available to the different targets. Namely: - TargetTriple - ObjectFileType - SubtargetInfo Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D101462
2021-04-21[Support] Don't include VirtualFileSystem.h in CommandLine.hNico Weber1-0/+1
CommandLine.h is indirectly included in ~50% of TUs when building clang, and VirtualFileSystem.h is large. (Already remarked by jhenderson on D70769.) No behavior change. Differential Revision: https://reviews.llvm.org/D100957
2021-03-31[llvm-jitlink] Fix -Wunused-function on WindowsArthur Eubanks1-7/+2
Reviewed By: sgraenitz Differential Revision: https://reviews.llvm.org/D99604
2021-03-30[JITLink] Switch from StringRef to ArrayRef<char>, add some generic x86-64 utilsLang Hames1-3/+4
Adds utilities for creating anonymous pointers and jump stubs to x86_64.h. These are used by the GOT and Stubs builder, but may also be used by pass writers who want to create pointer stubs for indirection. This patch also switches the underlying type for LinkGraph content from StringRef to ArrayRef<char>. This avoids any confusion when working with buffers that contain null bytes in the middle like, for example, a newly added null pointer content array. ;)
2021-03-22[llvm-jitlink] Fix Windows build after 4a8161fe40ccStefan Gränitz1-0/+7
2021-03-22[llvm-jitlink] Add diagnostic output and port executor to getaddrinfo(3) as wellStefan Gränitz1-49/+59
Add diagnostic output for TCP connections on both sides, llvm-jitlink and llvm-jitlink-executor. Port the executor to use getaddrinfo(3) as well. This makes the code more symmetric and seems to be the recommended way for implementing the server side. Reviewed By: rzurob Differential Revision: https://reviews.llvm.org/D98581
2021-03-22[llvm-jitlink] Fix use of getaddrinfo(3) when connecting remote executor via ↵Stefan Gränitz1-13/+13
TCP socket Since llvm-jitlink moved from gethostbyname to getaddrinfo in D95477, it seems to no longer connect to llvm-jitlink-executor via TCP. I can reproduce this behavior on both, Debian 10 and macOS 10.15.7: ``` > llvm-jitlink-executor listen=localhost:10819 -- > llvm-jitlink --oop-executor-connect=localhost:10819 /path/to/obj.o Failed to resolve localhost:10819 ``` Reviewed By: rzurob Differential Revision: https://reviews.llvm.org/D98579
2021-03-19[llvm-jitlink] Scan input files for first object to determine triple.Lang Hames1-5/+16
The previous logic would crash if the first input file was an archive rather than an object.
2021-03-12[JITLink][ORC] Make the LinkGraph available to modifyPassConfig.Lang Hames1-2/+2
This makes the target triple, graph name, and full graph content available when making decisions about how to populate the linker pass pipeline. Also updates the LLJITWithObjectLinkingLayerPlugin example to show more API use, including use of the API changes in this patch.
2021-03-03Revert "hack to unbreak check-llvm on win after D97335" in attempt for ↵Stefan Gränitz1-3/+2
actual fix This reverts commit 900f076113302e26e1939541b546b0075e3e9721 and attempts an actual fix: All failing tests for llvm-jitlink use the `-noexec` flag. The inputs they operate on are not meant for execution on the host system. Looking e.g. at the MachO_test_harness_harnesss.s test, llvm-mc generates input machine code with "x86_64-apple-macosx10.9". My previous attempt in bbdb4c8c9bcef0e8db751630accc04ad874f54e7 disabled the debug support plugin for Windows targets, but what we would actually want is to disable it on Windows HOSTS. With the new patch here, I don't do exactly that, but instead follow the approach for the EH frame plugin and include the `-noexec` flag in the condition. It should have the desired effect when it comes to the test suite. It appears a little workaround'ish, but should work reliably for now. I will discuss the issue with Lang and see if we can do better. Thanks @thakis again for the temporary fix.
2021-03-02[llvm-jitlink] Prevent missing symbols from JITLoaderGDB with MSVC manglingStefan Gränitz1-2/+3
The issue came up on builder clang-x64-windows-msvc after 5182a7901a5d83dfd15021d01e8a1899910130ec
2021-03-02[Orc] Add JITLink debug support plugin for ELF x86-64Stefan Gränitz1-0/+13
Add a new ObjectLinkingLayer plugin `DebugObjectManagerPlugin` and infrastructure to handle creation of `DebugObject`s as well as their registration in OrcTargetProcess. The current implementation only covers ELF on x86-64, but the infrastructure is not limited to that. The journey starts with a new `LinkGraph` / `JITLinkContext` pair being created for a `MaterializationResponsibility` in ORC's `ObjectLinkingLayer`. It sends a `notifyMaterializing()` notification, which is forwarded to all registered plugins. The `DebugObjectManagerPlugin` aims to create a `DebugObject` form the provided target triple and object buffer. (Future implementations might create `DebugObject`s from a `LinkGraph` in other ways.) On success it will track it as the pending `DebugObject` for the `MaterializationResponsibility`. This patch only implements the `ELFDebugObject` for `x86-64` targets. It follows the RuntimeDyld approach for debug object setup: it captures a copy of the input object, parses all section headers and prepares to patch their load-address fields with their final addresses in target memory. It instructs the plugin to report the section load-addresses once they are available. The plugin overrides `modifyPassConfig()` and installs a JITLink post-allocation pass to capture them. Once JITLink emitted the finalized executable, the plugin emits and registers the `DebugObject`. For emission it requests a new `JITLinkMemoryManager::Allocation` with a single read-only segment, copies the object with patched section load-addresses over to working memory and triggers finalization to target memory. For registration, it notifies the `DebugObjectRegistrar` provided in the constructor and stores the previously pending`DebugObject` as registered for the corresponding MaterializationResponsibility. The `DebugObjectRegistrar` registers the `DebugObject` with the target process. `llvm-jitlink` uses the `TPCDebugObjectRegistrar`, which calls `llvm_orc_registerJITLoaderGDBWrapper()` in the target process via `TargetProcessControl` to emit a `jit_code_entry` compatible with the GDB JIT interface [1]. So far the implementation only supports registration and no removal. It appears to me that it wouldn't raise any new design questions, so I left this as an addition for the near future. [1] https://sourceware.org/gdb/current/onlinedocs/gdb/JIT-Interface.html Reviewed By: lhames Differential Revision: https://reviews.llvm.org/D97335
2021-01-29[llvm-jitlink] Replace use of deprecated gethostbyname by getaddrinfo.Rafik Zurob1-4/+24
This patch replaces use of deprecated gethostbyname by getaddrinfo. Author: Rafik Zurob Reviewed By: lhames Differential Revision: https://reviews.llvm.org/D95477
2021-01-17[llvm] Use llvm::sort (NFC)Kazu Hirata1-12/+11
2020-12-30[ORC] Move Orc RPC code into Shared, rename some RPC types.Lang Hames1-5/+5
Moves all headers from Orc/RPC to Orc/Shared, and from the llvm::orc::rpc namespace into llvm::orc::shared. Also renames RPCTypeName to SerializationTypeName and Function to RPCFunction. In addition to being a more reasonable home for this code, this will make it easier for the upcoming Orc runtime to re-use the Serialization system for creating and parsing wrapper-function binary blobs.
2020-12-14Re-apply 8904ee8ac7e with missing header included this time.Lang Hames1-1/+1
2020-12-13Revert "[JITLink] Add JITLinkDylib type, thread through JITLinkMemoryManager ↵Nico Weber1-1/+1
APIs." This reverts commit 8904ee8ac7ebcc50a60de0914abc6862e28b6664. Didn't `git add` llvm/ExecutionEngine/JITLink/JITLinkDylib.h and hence doesn't build anywhere.
2020-12-14[JITLink] Add JITLinkDylib type, thread through JITLinkMemoryManager APIs.Lang Hames1-1/+1
JITLinkDylib represents a target dylib for a JITLink link. By representing this explicitly we can: - Enable JITLinkMemoryManagers to manage allocations on a per-dylib basis (e.g by maintaining a seperate allocation pool for each JITLinkDylib). - Enable new features and diagnostics that require information about the target dylib (not implemented in this patch).
2020-11-25[ORC] Remove a superfluous semicolon, silencing GCC warnings. NFC.Martin Storsjö1-1/+1
2020-11-13[ORC] Break up OrcJIT library, add Orc-RPC based remote TargetProcessControlLang Hames1-35/+249
implementation. This patch aims to improve support for out-of-process JITing using OrcV2. It introduces two new class templates, OrcRPCTargetProcessControlBase and OrcRPCTPCServer, which together implement the TargetProcessControl API by forwarding operations to an execution process via an Orc-RPC Endpoint. These utilities are used to implement out-of-process JITing from llvm-jitlink to a new llvm-jitlink-executor tool. This patch also breaks the OrcJIT library into three parts: -- OrcTargetProcess: Contains code needed by the JIT execution process. -- OrcShared: Contains code needed by the JIT execution and compiler processes -- OrcJIT: Everything else. This break-up allows JIT executor processes to link against OrcTargetProcess and OrcShared only, without having to link in all of OrcJIT. Clients executing JIT'd code in-process should start linking against OrcTargetProcess as well as OrcJIT. In the near future these changes will enable: -- Removal of the OrcRemoteTargetClient/OrcRemoteTargetServer class templates which provided similar functionality in OrcV1. -- Restoration of Chapter 5 of the Building-A-JIT tutorial series, which will serve as a simple usage example for these APIs. -- Implementation of lazy, cross-target compilation in lli's -jit-kind=orc-lazy mode.
2020-10-19[ORC] Update Symbol Lookup / DefinitionGenerator system.Lang Hames1-1/+1
This patch moves definition generation out from the session lock, instead running it under a per-dylib generator lock. It also makes the DefinitionGenerator::tryToGenerate method optionally asynchronous: Generators are handed an opaque LookupState object which can be captured to stop/restart the lookup process. The new scheme provides the following benefits and guarantees: (1) Queries that do not need to attempt definition generation (because all requested symbols matched against existing definitions in the JITDylib) can proceed without being blocked by any running definition generators. (2) Definition generators can capture the LookupState to continue their work asynchronously. This allows generators to run for an arbitrary amount of time without blocking a thread. Definition generators that do not need to run asynchronously can return without capturing the LookupState to eliminate unnecessary recursion and improve lookup performance. (3) Definition generators still do not need to worry about concurrency or re-entrance: Since they are still run under a (per-dylib) lock, generators will never be re-entered concurrently, or given overlapping symbol sets to generate. Finally, the new system distinguishes between symbols that are candidates for generation (generation candidates) and symbols that failed to match for a query (due to symbol visibility). This fixes a bug where an unresolved symbol could trigger generation of a duplicate definition for an existing hidden symbol.
2020-10-19[ORC] Move DefinitionGenerator out of JITDylib.Lang Hames1-1/+1
This will make it easier to implement asynchronous definition generators.
2020-10-18[ORC] Add support for resource tracking/removal (removable code).Lang Hames1-7/+21
This patch introduces new APIs to support resource tracking and removal in Orc. It is intended as a thread-safe generalization of the removeModule concept from OrcV1. Clients can now create ResourceTracker objects (using JITDylib::createResourceTracker) to track resources for each MaterializationUnit (code, data, aliases, absolute symbols, etc.) added to the JIT. Every MaterializationUnit will be associated with a ResourceTracker, and ResourceTrackers can be re-used for multiple MaterializationUnits. Each JITDylib has a default ResourceTracker that will be used for MaterializationUnits added to that JITDylib if no ResourceTracker is explicitly specified. Two operations can be performed on ResourceTrackers: transferTo and remove. The transferTo operation transfers tracking of the resources to a different ResourceTracker object, allowing ResourceTrackers to be merged to reduce administrative overhead (the source tracker is invalidated in the process). The remove operation removes all resources associated with a ResourceTracker, including any symbols defined by MaterializationUnits associated with the tracker, and also invalidates the tracker. These operations are thread safe, and should work regardless of the the state of the MaterializationUnits. In the case of resource transfer any existing resources associated with the source tracker will be transferred to the destination tracker, and all future resources for those units will be automatically associated with the destination tracker. In the case of resource removal all already-allocated resources will be deallocated, any if any program representations associated with the tracker have not been compiled yet they will be destroyed. If any program representations are currently being compiled then they will be prevented from completing: their MaterializationResponsibility will return errors on any attempt to update the JIT state. Clients (usually Layer writers) wishing to track resources can implement the ResourceManager API to receive notifications when ResourceTrackers are transferred or removed. The MaterializationResponsibility::withResourceKeyDo method can be used to create associations between the key for a ResourceTracker and an allocated resource in a thread-safe way. RTDyldObjectLinkingLayer and ObjectLinkingLayer are updated to use the ResourceManager API to enable tracking and removal of memory allocated by the JIT linker. The new JITDylib::clear method can be used to trigger removal of every ResourceTracker associated with the JITDylib (note that this will only remove resources for the JITDylib, it does not run static destructors). This patch includes unit tests showing basic usage. A follow-up patch will update the Kaleidoscope and BuildingAJIT tutorial series to OrcV2 and will use this API to release code associated with anonymous expressions.
2020-09-26Internalize functions from various tools. NFCFangrui Song1-8/+9
And internalize some classes if I noticed them:)
2020-09-04[ORC] Fix some bugs in TPCDynamicLibrarySearchGenerator, use in llvm-jitlink.Lang Hames1-9/+3
TPCDynamicLibrarySearchGenerator was generating errors on missing symbols, but that doesn't fit the DefinitionGenerator contract: A symbol that isn't generated by a particular generator should not cause an error. This commit fixes the error by using SymbolLookupFlags::WeaklyReferencedSymbol for all elements of the lookup, and switches llvm-jitlink to use TPCDynamicLibrarySearchGenerator.
2020-08-26[ORC][JITLink] Switch to unique ownership for EHFrameRegistrars.Lang Hames1-1/+1
This will make stateful registrars (e.g. a future TargetProcessControl based registrar) easier to deal with.
2020-08-13Re-apply "[llvm-jitlink] Don't demote unreferenced definitions in -harness mode"Lang Hames1-9/+4
This reapplies commit e137b550587a85b0d9c9c539edc79de0122b6946 with fixes for the broken test case: Non-global symbols should only be skipped after checking that they're not referenced by the harness.
2020-08-13Revert "[llvm-jitlink] Don't demote unreferenced definitions in -harness mode."Lang Hames1-4/+9
This reverts commit e137b550587a85b0d9c9c539edc79de0122b6946. This commit broke a test case. Reverting while I investigate.
2020-08-13[llvm-jitlink] Don't demote unreferenced definitions in -harness mode.Lang Hames1-9/+4
Demoting unreferenced externals is unsafe if multiple interdependent test objects are used, including objects loaded from archives.
2020-08-10[llvm-jitlink] Update llvm-jitlink to use TargetProcessControl.Lang Hames1-15/+23
2020-08-03[llvm-jitlink] Add support for static archives and MachO universal archives.Lang Hames1-6/+15
Archives can now be specified as input files the same way that object files are. Archives will always be linked after all objects (regardless of the relative order of the inputs) but before any dynamic libraries or process symbols. This patch also relaxes matching for slice triples in StaticLibraryDefinitionGenerator in order to support this feature: Vendors need not match if the source vendor is unknown.