Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MCJIT MemoryManager access #296

Open
semoro opened this issue Jan 25, 2022 · 1 comment · May be fixed by #566
Open

MCJIT MemoryManager access #296

semoro opened this issue Jan 25, 2022 · 1 comment · May be fixed by #566
Milestone

Comments

@semoro
Copy link

semoro commented Jan 25, 2022

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 added a commit to ss220-space/inkwell that referenced this issue Jan 25, 2022
@Chronostasys
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants