cyx-6 opened a new pull request, #807: URL: https://github.com/apache/tvm-ffi/pull/807
## Why `tvm_ffi_orcjit` currently reopens its shared library with `RTLD_GLOBAL`. This publishes symbols pulled from static LLVM and runtime archives into the host process. Besides the very large Mach-O export surface, those definitions can interpose with another LLVM copy loaded by an application. Linux has an additional wrinkle: RHEL-family compiler drivers supplement dynamic `libstdc++.so.6` with `libstdc++_nonshared.a`. The embedded ORC runtime can reference one of those archive-only helpers, which is why simply localizing every archive symbol previously broke JIT materialization. ## What changed - rely on `TVM_FFI_STATIC_INIT_BLOCK` registration and keep the addon under the TVM-FFI loader local scope - restrict the ELF and Mach-O dynamic API to `TVMFFIOrcJITInitialize` - discover `libstdc++_nonshared.a` through the configured C++ compiler at build time, embed it in Linux wheels, and attach it as a private ORC static-library generator before platform bootstrap - retain `LIBSTDCXX_NONSHARED_PATH` as a CMake override for unusual toolchains; no compiler or archive path is required at runtime - add regression tests for both the process-global scope and the binary export surface This is intended to make the ORC addon coexist safely with host frameworks carrying their own LLVM while preserving manylinux C++ runtime resolution. ## Validation - repository ASF header and file-type checks - Python syntax compilation - pinned Ruff, clang-format, and cmake-format checks - full cibuildwheel matrix pending on this PR -- 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]
