This is an automated email from the ASF dual-hosted git repository.

philo-he pushed a commit to branch branch-1.7
in repository https://gitbox.apache.org/repos/asf/gluten.git

commit 15f5a5cb48b5af00a3ad67d5cd0ba18dbc917690
Author: jackylee <[email protected]>
AuthorDate: Mon Jul 20 11:51:26 2026 +0800

    [VL][CI] Quick Fix Spark 4.1 CI crash: isolate libgluten's bundled 
libstdc++ (#12557)
---
 cpp/core/CMakeLists.txt | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/cpp/core/CMakeLists.txt b/cpp/core/CMakeLists.txt
index 9530d603f5..a3461103d2 100644
--- a/cpp/core/CMakeLists.txt
+++ b/cpp/core/CMakeLists.txt
@@ -162,6 +162,27 @@ add_dependencies(gluten jni_proto)
 if(NOT CMAKE_SYSTEM_NAME MATCHES "Darwin")
   target_link_options(
     gluten PRIVATE 
-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/symbols.map)
+  # libgluten statically links libstdc++/libgcc (see 
dev/vcpkg/toolchain.cmake's
+  # -static-libstdc++ -static-libgcc). The version script above has no "local:
+  # *" catch-all (it must keep Arrow/substrait/etc. exported for libvelox to
+  # resolve against), so by default the bundled gcc-13 C++ runtime symbols also
+  # stay in libgluten's dynamic symbol table -- and the std::locale::id objects
+  # that index the facet table are emitted as STB_GNU_UNIQUE. When another
+  # libstdc++ is already loaded in the process (the system gcc-11 
libstdc++.so.6
+  # pulled in by the JVM inside the centos-9 image), the loader collapses those
+  # unique ids into one process-wide definition; libgluten then indexes its
+  # gcc-13 facet table with the system id value, reads a bogus num_put/codecvt
+  # facet pointer, and crashes with SIGSEGV during Velox backend initialization
+  # (do_unshift, si_addr=0x30). -Bsymbolic does not help because STB_GNU_UNIQUE
+  # overrides it. --exclude-libs demotes the symbols coming from the named C++
+  # runtime archives to STB_LOCAL, dropping them from the dynamic symbol table
+  # entirely (this also clears their STB_GNU_UNIQUE binding) so they can 
neither
+  # interpose nor be interposed -- the same isolation libvelox already gets 
from
+  # its "local: *" map. Symbols from the other static deps (Arrow, substrait,
+  # ...) come from different archives and stay exported.
+  target_link_options(
+    gluten PRIVATE -Wl,--exclude-libs,libstdc++.a -Wl,--exclude-libs,libgcc.a
+    -Wl,--exclude-libs,libgcc_eh.a)
 endif()
 
 if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.0)


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to