Skip to content

Commit f3da15a

Browse files
committed
[ORCJIT][CI] Fix orcjit wheel ABI skew and drop over-broad --exclude-libs
The orcjit CI job built the wheel against PyPI apache-tvm-ffi while the test step reinstalled the in-tree dev core; once the core's Optional/Variant ABI diverged from the last release this mismatch segfaulted the JIT and produced bogus type indices. Build the wheel against the in-tree core via CIBW_BEFORE_BUILD + --no-build-isolation so build-ABI == test-ABI. Also drop -Wl,--exclude-libs,ALL: with -static-libstdc++ it localized the libstdc++ symbols liborc_rt resolves from the process, so on a statically linked (manylinux) core the ELFNix platform failed to bootstrap and every ExecutionSession() threw.
1 parent e9c4350 commit f3da15a

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

.github/actions/build-orcjit-wheel/action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,10 @@ runs:
102102
CIBW_ENVIRONMENT: LLVM_PREFIX=/opt/llvm
103103
CIBW_ENVIRONMENT_WINDOWS: LLVM_PREFIX="C:/opt/llvm"
104104
CIBW_CONTAINER_ENGINE: "docker; create_args: --volume /opt/llvm:/opt/llvm"
105+
# Build against the in-tree core (not PyPI) so the addon's tvm_ffi ABI
106+
# matches the core the tests reinstall; a mismatch segfaults the JIT.
107+
CIBW_BEFORE_BUILD: pip install "scikit-build-core>=0.10.0" cmake ninja "{project}"
108+
CIBW_BUILD_FRONTEND: "pip; args: --no-build-isolation"
105109
CIBW_TEST_REQUIRES: pytest pytest-xdist ninja
106110
CIBW_TEST_COMMAND: >-
107111
pip install --force-reinstall {project} &&

addons/tvm_ffi_orcjit/CMakeLists.txt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -152,12 +152,8 @@ elseif (UNIX AND NOT WIN32)
152152
target_link_options(tvm_ffi_orcjit PRIVATE -static-libstdc++ -static-libgcc)
153153
endif ()
154154

155-
# ---- Hide symbols from statically-linked archives (LLVM, zlib, zstd, libstdc++) ----
156-
if (CMAKE_SYSTEM_NAME MATCHES "Linux|Android|FreeBSD|NetBSD|OpenBSD" AND CMAKE_CXX_COMPILER_ID
157-
MATCHES "GNU|Clang"
158-
)
159-
target_link_options(tvm_ffi_orcjit PRIVATE "-Wl,--exclude-libs,ALL")
160-
endif ()
155+
# NOTE: do not add -Wl,--exclude-libs,ALL here; it localizes the static libstdc++ symbols that
156+
# liborc_rt resolves from the process, breaking the JIT.
161157

162158
# ---- Find and bundle liborc_rt ----
163159
# Platform notes:

0 commit comments

Comments
 (0)