inkwell icon indicating copy to clipboard operation
inkwell copied to clipboard

MCJIT MemoryManager access

Open semoro opened this issue 3 years ago • 1 comments

llvm.stackmap requires to provide custom memory MCJIT memory manager to allow interception of .llvm_stackmaps section Currently, it is not possible due to 3 problems

  1. There are no bindings for the default memory manager for delegation to

  2. Default memory manager implementation aka SectionMemoryManager has no C-exports

  3. There is no access to

    fn LLVMCreateMCJITCompilerForModule(
        OutJIT: *mut LLVMExecutionEngineRef,
        M: LLVMModuleRef,
        Options: *mut LLVMMCJITCompilerOptions,
        SizeOfOptions: ::libc::size_t,
        OutError: *mut *mut ::libc::c_char,
    ) -> LLVMBool
    

    Which allows providing more options than just opt level when creating an execution engine One of those options is MCJMM which is a wrapper for user-created custom memory-manager

semoro avatar Jan 25 '22 05:01 semoro

I also need this feature, I'm using a global variable linking to the stackmap section in static compile mode, which however causing segmentation fault in jited code.

Chronostasys avatar Feb 03 '23 05:02 Chronostasys