Skip to content

Commit

Permalink
[ORC] Add visibility macros to functions needed by lli and jitlink
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
fsfod committed Oct 22, 2024
1 parent 8673d0e commit 3aee95e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#define LLVM_EXECUTIONENGINE_ORC_TARGETPROCESS_JITLOADERGDB_H

#include "llvm/ExecutionEngine/Orc/Shared/WrapperFunctionUtils.h"
#include "llvm/Support/Compiler.h"
#include <cstdint>

// Keep in sync with gdb/gdb/jit.h
Expand Down Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,16 @@
#define LLVM_EXECUTIONENGINE_ORC_TARGETPROCESS_JITLOADERPERF_H

#include "llvm/ExecutionEngine/Orc/Shared/WrapperFunctionUtils.h"
#include "llvm/Support/Compiler.h"
#include <cstdint>

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
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,16 @@
#define LLVM_EXECUTIONENGINE_ORC_TARGETPROCESS_JITLOADERVTUNE_H

#include "llvm/ExecutionEngine/Orc/Shared/WrapperFunctionUtils.h"
#include "llvm/Support/Compiler.h"
#include <cstdint>

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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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

0 comments on commit 3aee95e

Please sign in to comment.