From 3aee95e8ddbca710636036d3c37f0eaf621f5957 Mon Sep 17 00:00:00 2001 From: Thomas Fransham Date: Tue, 22 Oct 2024 06:04:42 +0100 Subject: [PATCH] [ORC] Add visibility macros to functions needed by lli and jitlink Annotating these symbols will fix missing symbols errors for lli and llvm-jitlink when when the LLVM is built as shared library on windows with explicit symbol visibility macros enabled. This is part of the work to enable LLVM_BUILD_LLVM_DYLIB and plugins on window. --- .../llvm/ExecutionEngine/Orc/TargetProcess/JITLoaderGDB.h | 5 +++-- .../llvm/ExecutionEngine/Orc/TargetProcess/JITLoaderPerf.h | 7 ++++--- .../ExecutionEngine/Orc/TargetProcess/JITLoaderVTune.h | 7 ++++--- .../ExecutionEngine/Orc/TargetProcess/RegisterEHFrames.h | 5 +++-- 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/JITLoaderGDB.h b/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/JITLoaderGDB.h index 9f91a64e95ce99..1563d13468988f 100644 --- a/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/JITLoaderGDB.h +++ b/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/JITLoaderGDB.h @@ -14,6 +14,7 @@ #define LLVM_EXECUTIONENGINE_ORC_TARGETPROCESS_JITLOADERGDB_H #include "llvm/ExecutionEngine/Orc/Shared/WrapperFunctionUtils.h" +#include "llvm/Support/Compiler.h" #include // Keep in sync with gdb/gdb/jit.h @@ -42,10 +43,10 @@ struct jit_descriptor { }; } -extern "C" llvm::orc::shared::CWrapperFunctionResult +extern "C" LLVM_ABI llvm::orc::shared::CWrapperFunctionResult llvm_orc_registerJITLoaderGDBWrapper(const char *Data, uint64_t Size); -extern "C" llvm::orc::shared::CWrapperFunctionResult +extern "C" LLVM_ABI llvm::orc::shared::CWrapperFunctionResult llvm_orc_registerJITLoaderGDBAllocAction(const char *Data, size_t Size); #endif // LLVM_EXECUTIONENGINE_ORC_TARGETPROCESS_JITLOADERGDB_H diff --git a/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/JITLoaderPerf.h b/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/JITLoaderPerf.h index 1d8e33f8013b9f..aa9951a23b99e6 100644 --- a/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/JITLoaderPerf.h +++ b/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/JITLoaderPerf.h @@ -14,15 +14,16 @@ #define LLVM_EXECUTIONENGINE_ORC_TARGETPROCESS_JITLOADERPERF_H #include "llvm/ExecutionEngine/Orc/Shared/WrapperFunctionUtils.h" +#include "llvm/Support/Compiler.h" #include -extern "C" llvm::orc::shared::CWrapperFunctionResult +extern "C" LLVM_ABI llvm::orc::shared::CWrapperFunctionResult llvm_orc_registerJITLoaderPerfImpl(const char *Data, uint64_t Size); -extern "C" llvm::orc::shared::CWrapperFunctionResult +extern "C" LLVM_ABI llvm::orc::shared::CWrapperFunctionResult llvm_orc_registerJITLoaderPerfStart(const char *Data, uint64_t Size); -extern "C" llvm::orc::shared::CWrapperFunctionResult +extern "C" LLVM_ABI llvm::orc::shared::CWrapperFunctionResult llvm_orc_registerJITLoaderPerfEnd(const char *Data, uint64_t Size); #endif // LLVM_EXECUTIONENGINE_ORC_TARGETPROCESS_JITLOADERPERF_H \ No newline at end of file diff --git a/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/JITLoaderVTune.h b/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/JITLoaderVTune.h index afb7df592faf27..63a0d7325d5ad6 100644 --- a/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/JITLoaderVTune.h +++ b/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/JITLoaderVTune.h @@ -15,15 +15,16 @@ #define LLVM_EXECUTIONENGINE_ORC_TARGETPROCESS_JITLOADERVTUNE_H #include "llvm/ExecutionEngine/Orc/Shared/WrapperFunctionUtils.h" +#include "llvm/Support/Compiler.h" #include -extern "C" llvm::orc::shared::CWrapperFunctionResult +extern "C" LLVM_ABI llvm::orc::shared::CWrapperFunctionResult llvm_orc_registerVTuneImpl(const char *Data, uint64_t Size); -extern "C" llvm::orc::shared::CWrapperFunctionResult +extern "C" LLVM_ABI llvm::orc::shared::CWrapperFunctionResult llvm_orc_unregisterVTuneImpl(const char *Data, uint64_t Size); -extern "C" llvm::orc::shared::CWrapperFunctionResult +extern "C" LLVM_ABI llvm::orc::shared::CWrapperFunctionResult llvm_orc_test_registerVTuneImpl(const char *Data, uint64_t Size); #endif // LLVM_EXECUTIONENGINE_ORC_TARGETPROCESS_JITLOADERVTUNE_H diff --git a/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/RegisterEHFrames.h b/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/RegisterEHFrames.h index 04790afa6e3163..d375f6034616a5 100644 --- a/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/RegisterEHFrames.h +++ b/llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/RegisterEHFrames.h @@ -17,6 +17,7 @@ #define LLVM_EXECUTIONENGINE_ORC_TARGETPROCESS_REGISTEREHFRAMES_H #include "llvm/ExecutionEngine/Orc/Shared/WrapperFunctionUtils.h" +#include "llvm/Support/Compiler.h" #include "llvm/Support/Error.h" namespace llvm { @@ -33,10 +34,10 @@ Error deregisterEHFrameSection(const void *EHFrameSectionAddr, } // end namespace orc } // end namespace llvm -extern "C" llvm::orc::shared::CWrapperFunctionResult +extern "C" LLVM_ABI llvm::orc::shared::CWrapperFunctionResult llvm_orc_registerEHFrameSectionWrapper(const char *Data, uint64_t Size); -extern "C" llvm::orc::shared::CWrapperFunctionResult +extern "C" LLVM_ABI llvm::orc::shared::CWrapperFunctionResult llvm_orc_deregisterEHFrameSectionWrapper(const char *Data, uint64_t Size); #endif // LLVM_EXECUTIONENGINE_ORC_TARGETPROCESS_REGISTEREHFRAMES_H