11 Commits

Author SHA1 Message Date
Lang Hames
2c8b2dc3f4 [ORC-RT] Rename 'orc_rt_*CWrapper*' types and functions to 'orc_rt_*Wrapper*'.
The orc_rt_ prefix implies C API anyway (the C++ API should use the orc_rc::
namespace), so the 'C' is redundant here.
2025-03-07 14:31:42 +11:00
Lang Hames
69f8923efa Re-apply "[ORC-RT] Replace FnTag arg of WrapperFunction::call..." with fixes.
This reapplies commits 462251b80b7 and 9b67c99dc5b, which were reverted in
53d35c4e86b due to bot failures for the wrapper_function_utils_test.cpp unit
test.
2024-09-10 19:55:31 +10:00
Mikhail Goncharov
53d35c4e86 Revert "[ORC-RT] Replace FnTag arg of WrapperFunction::call with generic dispatch arg."
This reverts commit 462251b80b7ba51dc6c2ef3676cf50ee92867d34.
This reverts commit 9b67c99dc5b0d669a28b714e10e257d3988d1066.

Build fails for compiler-rt/lib/orc/tests/unit/wrapper_function_utils_test.cpp

https://buildkite.com/llvm-project/upstream-bazel/builds/109731#0191da59-6710-4420-92ef-aa6e0355cb2c
2024-09-10 10:19:27 +02:00
Lang Hames
462251b80b [ORC-RT] Replace FnTag arg of WrapperFunction::call with generic dispatch arg.
This decouples function argument serialization / deserialization from the
function call dispatch mechanism. This will eventually allow us to replace the
existing __orc_rt_jit_dispatch function with a system that supports pre-linking
parts of the ORC runtime into the executor.
2024-09-10 15:11:40 +10:00
Lang Hames
3e04ad4283 [ORC-RT] Remove double underscore from the orc_rt namespace.
We should use `orc_rt` as the public C++ API namespace for the ORC runtime and
control symbol visibility to hide implementation details, rather than rely on
the '__' prefix.
2024-09-09 18:04:28 +10:00
Alexandre Ganea
63a3c4cc85 [compiler-rt] Silence warning with MSVC 19.38 (Visual Studio 2022 17.8.3)
This fixes:
```
C:\git\llvm-project\compiler-rt\lib\orc\coff_platform.cpp(512): warning C4189: 'JDState': local variable is initialized but not referenced
```
2024-01-17 07:23:56 -05:00
Lang Hames
34fccfb23c [ORC-RT] Remove the '__' prefix from the ORC runtime's public API.
The '__' prefix should only be used for the parts of the ORC runtime that
implement compiler / loader runtime details (e.g. ORC-RT's __tlv_get_addr
implementations).

This patch only fixes the public API. Future changes will fix internal names.
2023-02-21 18:37:10 -08:00
Lang Hames
9cd28d3f11 [ORC-RT] Update COFF, ELF support after ExecutorAddrDiff change in 4c434831865. 2022-09-15 22:26:36 -07:00
sunho
73c4033987 [ORC][ORC_RT][COFF] Support dynamic VC runtime.
Supports dynamic VC runtime. It implements atexits handling which is required to load msvcrt.lib successfully. (the object file containing atexit symbol somehow resolves to static vc runtim symbols) It also default to dynamic vc runtime which tends to be more robust.

Reviewed By: lhames

Differential Revision: https://reviews.llvm.org/D132525
2022-09-10 15:25:49 +09:00
Martin Storsjö
156136502b [ORC_RT][COFF] Fix cross compilation with mingw headers
Mingw headers are all lowercase, and can be used for cross compilation
from case sensitive file systems.

The official Windows SDK headers aren't self-consistent wrt upper/lower
case, so those headers can't be used on case sensitive systems without
a layer providing case insensitivity anyway.

This matches other includes of windows.h throughout the codebase.
2022-08-14 14:23:25 +03:00
Sunho Kim
9189a26664 [ORC_RT][COFF] Initial platform support for COFF/x86_64.
Initial platform support for COFF/x86_64.

Completed features:
* Statically linked orc runtime.
* Full linking/initialization of static/dynamic vc runtimes and microsoft stl libraries.
* SEH exception handling.
* Full static initializers support
* dlfns
* JIT side symbol lookup/dispatch

Things to note:
* It uses vc runtime libraries found in vc toolchain installations.
* Bootstrapping state is separated because when statically linking orc runtime it needs microsoft stl functions to initialize the orc runtime, but static initializers need to be ran in order to fully initialize stl libraries.
* Process symbols can't be used blidnly on msvc platform; otherwise duplicate definition error gets generated. If process symbols are used, it's destined to get out-of-reach error at some point.
* Atexit currently not handled -- will be handled in the follow-up patches.

Reviewed By: lhames

Differential Revision: https://reviews.llvm.org/D130479
2022-08-13 13:48:40 +09:00