Skip to content

Commit 1fe64fe

Browse files
authored
[ORC] Add visibility macros to functions needed by lli and jitlink (#113271)
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.
1 parent af872d5 commit 1fe64fe

File tree

4 files changed

+14
-10
lines changed

4 files changed

+14
-10
lines changed

llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/JITLoaderGDB.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#define LLVM_EXECUTIONENGINE_ORC_TARGETPROCESS_JITLOADERGDB_H
1515

1616
#include "llvm/ExecutionEngine/Orc/Shared/WrapperFunctionUtils.h"
17+
#include "llvm/Support/Compiler.h"
1718
#include <cstdint>
1819

1920
// Keep in sync with gdb/gdb/jit.h
@@ -42,10 +43,10 @@ struct jit_descriptor {
4243
};
4344
}
4445

45-
extern "C" llvm::orc::shared::CWrapperFunctionResult
46+
extern "C" LLVM_ABI llvm::orc::shared::CWrapperFunctionResult
4647
llvm_orc_registerJITLoaderGDBWrapper(const char *Data, uint64_t Size);
4748

48-
extern "C" llvm::orc::shared::CWrapperFunctionResult
49+
extern "C" LLVM_ABI llvm::orc::shared::CWrapperFunctionResult
4950
llvm_orc_registerJITLoaderGDBAllocAction(const char *Data, size_t Size);
5051

5152
#endif // LLVM_EXECUTIONENGINE_ORC_TARGETPROCESS_JITLOADERGDB_H

llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/JITLoaderPerf.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,16 @@
1414
#define LLVM_EXECUTIONENGINE_ORC_TARGETPROCESS_JITLOADERPERF_H
1515

1616
#include "llvm/ExecutionEngine/Orc/Shared/WrapperFunctionUtils.h"
17+
#include "llvm/Support/Compiler.h"
1718
#include <cstdint>
1819

19-
extern "C" llvm::orc::shared::CWrapperFunctionResult
20+
extern "C" LLVM_ABI llvm::orc::shared::CWrapperFunctionResult
2021
llvm_orc_registerJITLoaderPerfImpl(const char *Data, uint64_t Size);
2122

22-
extern "C" llvm::orc::shared::CWrapperFunctionResult
23+
extern "C" LLVM_ABI llvm::orc::shared::CWrapperFunctionResult
2324
llvm_orc_registerJITLoaderPerfStart(const char *Data, uint64_t Size);
2425

25-
extern "C" llvm::orc::shared::CWrapperFunctionResult
26+
extern "C" LLVM_ABI llvm::orc::shared::CWrapperFunctionResult
2627
llvm_orc_registerJITLoaderPerfEnd(const char *Data, uint64_t Size);
2728

2829
#endif // LLVM_EXECUTIONENGINE_ORC_TARGETPROCESS_JITLOADERPERF_H

llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/JITLoaderVTune.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,16 @@
1515
#define LLVM_EXECUTIONENGINE_ORC_TARGETPROCESS_JITLOADERVTUNE_H
1616

1717
#include "llvm/ExecutionEngine/Orc/Shared/WrapperFunctionUtils.h"
18+
#include "llvm/Support/Compiler.h"
1819
#include <cstdint>
1920

20-
extern "C" llvm::orc::shared::CWrapperFunctionResult
21+
extern "C" LLVM_ABI llvm::orc::shared::CWrapperFunctionResult
2122
llvm_orc_registerVTuneImpl(const char *Data, uint64_t Size);
2223

23-
extern "C" llvm::orc::shared::CWrapperFunctionResult
24+
extern "C" LLVM_ABI llvm::orc::shared::CWrapperFunctionResult
2425
llvm_orc_unregisterVTuneImpl(const char *Data, uint64_t Size);
2526

26-
extern "C" llvm::orc::shared::CWrapperFunctionResult
27+
extern "C" LLVM_ABI llvm::orc::shared::CWrapperFunctionResult
2728
llvm_orc_test_registerVTuneImpl(const char *Data, uint64_t Size);
2829

2930
#endif // LLVM_EXECUTIONENGINE_ORC_TARGETPROCESS_JITLOADERVTUNE_H

llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/RegisterEHFrames.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#define LLVM_EXECUTIONENGINE_ORC_TARGETPROCESS_REGISTEREHFRAMES_H
1818

1919
#include "llvm/ExecutionEngine/Orc/Shared/WrapperFunctionUtils.h"
20+
#include "llvm/Support/Compiler.h"
2021
#include "llvm/Support/Error.h"
2122

2223
namespace llvm {
@@ -33,10 +34,10 @@ Error deregisterEHFrameSection(const void *EHFrameSectionAddr,
3334
} // end namespace orc
3435
} // end namespace llvm
3536

36-
extern "C" llvm::orc::shared::CWrapperFunctionResult
37+
extern "C" LLVM_ABI llvm::orc::shared::CWrapperFunctionResult
3738
llvm_orc_registerEHFrameSectionWrapper(const char *Data, uint64_t Size);
3839

39-
extern "C" llvm::orc::shared::CWrapperFunctionResult
40+
extern "C" LLVM_ABI llvm::orc::shared::CWrapperFunctionResult
4041
llvm_orc_deregisterEHFrameSectionWrapper(const char *Data, uint64_t Size);
4142

4243
#endif // LLVM_EXECUTIONENGINE_ORC_TARGETPROCESS_REGISTEREHFRAMES_H

0 commit comments

Comments
 (0)