https://llvm.org/bugs/show_bug.cgi?id=24028
Bug ID: 24028
Summary: LLVMRunStaticConstructors crashes, FIX/DIFF INCLUDED
Product: libraries
Version: trunk
Hardware: PC
OS: All
Status: NEW
Severity: normal
Priority: P
Component: MCJIT
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
Classification: Unclassified
Created attachment 14549
--> https://llvm.org/bugs/attachment.cgi?id=14549&action=edit
Diff which fixes the issue
The Problem is LLVMRunStaticConstructors might be run before finalizeObject was
called. Here is the patch:
--- ExecutionEngineBindings.cpp 2015-07-04 13:57:32.051159075 +0200
+++ ExecutionEngineBindings.cpp.new 2015-07-04 13:58:23.905707243 +0200
@@ -244,10 +244,12 @@
}
void LLVMRunStaticConstructors(LLVMExecutionEngineRef EE) {
+ unwrap(EE)->finalizeObject();
unwrap(EE)->runStaticConstructorsDestructors(false);
}
void LLVMRunStaticDestructors(LLVMExecutionEngineRef EE) {
+ unwrap(EE)->finalizeObject();
unwrap(EE)->runStaticConstructorsDestructors(true);
}
Even though this patch works, I would like to see/discuss a better binding to
the underlaying ExecutionObject and exposing more of its functionallity, e.g.
addObject etc. and also finalizeObject, meaning the user can take care of
calling finalizeObject himself.
For all the people searching for a workaround, create an empty function or
global, and either call the function or try to get the address of the global.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs