Skip to content

Commit d3897d2

Browse files
lhameststellar
authored andcommitted
[ORC] Ensure that llvm_orc_registerJITLoaderGDBAllocAction is linked into tools.
Add a reference to llvm_orc_registerJITLoaderGDBAllocAction from the linkComponents function in the lli, llvm-jitlink, and llvm-jitlink-executor tools. This ensures that llvm_orc_registerJITLoaderGDBAllocAction is not dead-stripped in optimized builds, which may cause failures in these tools. The llvm_orc_registerJITLoaderGDBAllocAction function was originally added with MachO debugging support in 69be352, but that patch failed to update the linkComponents functions. http://llvm.org/PR56817 (cherry picked from commit b5f76d8)
1 parent b329330 commit d3897d2

File tree

4 files changed

+9
-3
lines changed

4 files changed

+9
-3
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,7 @@
1919
extern "C" llvm::orc::shared::CWrapperFunctionResult
2020
llvm_orc_registerJITLoaderGDBWrapper(const char *Data, uint64_t Size);
2121

22+
extern "C" llvm::orc::shared::CWrapperFunctionResult
23+
llvm_orc_registerJITLoaderGDBAllocAction(const char *Data, size_t Size);
24+
2225
#endif // LLVM_EXECUTIONENGINE_ORC_TARGETPROCESS_JITLOADERGDB_H

llvm/tools/lli/lli.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,8 @@ namespace {
291291
LLVM_ATTRIBUTE_USED void linkComponents() {
292292
errs() << (void *)&llvm_orc_registerEHFrameSectionWrapper
293293
<< (void *)&llvm_orc_deregisterEHFrameSectionWrapper
294-
<< (void *)&llvm_orc_registerJITLoaderGDBWrapper;
294+
<< (void *)&llvm_orc_registerJITLoaderGDBWrapper
295+
<< (void *)&llvm_orc_registerJITLoaderGDBAllocAction;
295296
}
296297

297298
//===----------------------------------------------------------------------===//

llvm/tools/llvm-jitlink/llvm-jitlink-executor/llvm-jitlink-executor.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ ExitOnError ExitOnErr;
3939
LLVM_ATTRIBUTE_USED void linkComponents() {
4040
errs() << (void *)&llvm_orc_registerEHFrameSectionWrapper
4141
<< (void *)&llvm_orc_deregisterEHFrameSectionWrapper
42-
<< (void *)&llvm_orc_registerJITLoaderGDBWrapper;
42+
<< (void *)&llvm_orc_registerJITLoaderGDBWrapper
43+
<< (void *)&llvm_orc_registerJITLoaderGDBAllocAction;
4344
}
4445

4546
void printErrorAndExit(Twine ErrMsg) {

llvm/tools/llvm-jitlink/llvm-jitlink.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,8 @@ static ExitOnError ExitOnErr;
233233
static LLVM_ATTRIBUTE_USED void linkComponents() {
234234
errs() << (void *)&llvm_orc_registerEHFrameSectionWrapper
235235
<< (void *)&llvm_orc_deregisterEHFrameSectionWrapper
236-
<< (void *)&llvm_orc_registerJITLoaderGDBWrapper;
236+
<< (void *)&llvm_orc_registerJITLoaderGDBWrapper
237+
<< (void *)&llvm_orc_registerJITLoaderGDBAllocAction;
237238
}
238239

239240
static bool UseTestResultOverride = false;

0 commit comments

Comments
 (0)