cyx-6 commented on PR #254:
URL: https://github.com/apache/tvm-ffi/pull/254#issuecomment-4124919052
> A high-level question is: you used a InitFiniPlugin to handle the
ctors/dtors of the loaded object files. And there are some *Platform in the
orc_rt (or compiler_rt) will register the handling of ctors/dtors. Maybe add
some documentation to explain this (like why on MSVC, we can't depends on the c
runtime library, etc). Is it possible to remove the plugin when the orc_rt has
better support towards the ctors/dtors?
@yaoyaoding here are the status of three platforms
- macOS: MachOPlatform (via orc_rt) handles __mod_init_func/__mod_term_func
and __cxa_atexit natively. We delegate to jit_->initialize()/deinitialize() —
no InitFiniPlugin needed.
- Windows: COFFPlatform is unusable (requires MSVC CRT symbols like
_CxxThrowException, RTTI vtables — stalled in LLVM for 2+ years). Our plugin
handles .CRT$XC*/.CRT$XT* sections.
- Linux: ELFNixPlatform not handles ctor/dtor well, before this commit
https://github.com/llvm/llvm-project/pull/175981. Would be return to
ELFNixPlatform once new llvm release contains this patch commit. So
InitFiniPlugin is still needed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]