tqchen opened a new pull request, #19817:
URL: https://github.com/apache/tvm/pull/19817

   This PR bumps the tvm-ffi submodule and applies `-Wl,--exclude-libs,ALL` to 
TVM shared library targets through `tvm_configure_target_library`. This avoids 
exporting symbols pulled in from static archives such as 
`libstdc++_nonshared.a` and prevents downstream libraries from accidentally 
binding to those private definitions.
   
   The TVM-side helper is local to `cmake/utils/Library.cmake` so the behavior 
is available to early-created targets before `3rdparty/tvm-ffi` is added as a 
subdirectory. This covers the core shared libraries and runtime module DSOs 
that use `tvm_configure_target_library`, including `libtvm_compiler.so`, 
`libtvm_runtime.so`, `libtvm_runtime_extra.so`, and `libtvm_runtime_*` backends.
   
   Validation:
   - `cmake -S . -B build-hide-static-symbols-probe -G Ninja 
-DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=/usr/bin/gcc 
-DCMAKE_CXX_COMPILER=/usr/bin/g++ 
-DCMAKE_C_COMPILER_LAUNCHER=/opt/rust/bin/sccache 
-DCMAKE_CXX_COMPILER_LAUNCHER=/opt/rust/bin/sccache -DUSE_LLVM=OFF 
-DUSE_CUDA=OFF -DUSE_OPENCL=ON -DUSE_VULKAN=ON -DUSE_ROCM=OFF -DUSE_METAL=OFF 
-DUSE_HEXAGON=OFF`
   - Generated `build.ninja` contains `-Wl,--exclude-libs,ALL` for 
`libtvm_compiler.so`, `libtvm_runtime.so`, `libtvm_runtime_extra.so`, 
`libtvm_runtime_opencl.so`, and `libtvm_runtime_vulkan.so`
   - `ninja -C build-hide-static-symbols-probe tvm_runtime tvm_runtime_extra 
tvm_runtime_opencl tvm_runtime_vulkan`
   - `ninja -C build-hide-static-symbols-probe tvm_compiler`
   - `nm -D --defined-only` / `readelf -Ws` probe found no defined dynamic 
libbacktrace or static-libstdc++ nonshared probe symbols in 
`libtvm_compiler.so`, `libtvm_runtime.so`, `libtvm_runtime_opencl.so`, or 
`libtvm_runtime_vulkan.so`; remaining CXXABI/libstdc++ matches are undefined 
imports.
   - `pre-commit run --files cmake/utils/Library.cmake`
   - `git diff --check`


-- 
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]

Reply via email to