1414# See the License for the specific language governing permissions and
1515# limitations under the License.
1616#
17- # Build client-cpp in manylinux2014 and verify max required GLIBC symbol <= 2.17.
17+ # Build client-cpp in manylinux2014 with devtoolset (new libstdc++ ABI) and verify
18+ # max required GLIBC symbol <= 2.17.
1819set -euxo pipefail
1920
2021MACHINE=$( uname -m)
6162export PATH=" ${CMAKE_DIR} /bin:${JAVA_HOME} /bin:${PATH} "
6263export JAVA_HOME
6364
65+ # Default container gcc is 4.8 (old libstdc++ ABI). Use devtoolset for GCC 10 + CXX11 ABI.
66+ DEVTOOLSET_ENABLED=false
67+ for ds in 10 9 8; do
68+ if [[ -f " /opt/rh/devtoolset-${ds} /enable" ]]; then
69+ # shellcheck disable=SC1090
70+ source " /opt/rh/devtoolset-${ds} /enable"
71+ echo " Using devtoolset-${ds} "
72+ DEVTOOLSET_ENABLED=true
73+ break
74+ fi
75+ done
76+ if [[ " ${DEVTOOLSET_ENABLED} " != true ]]; then
77+ echo " WARNING: no devtoolset found; build may use old libstdc++ ABI" >&2
78+ fi
79+
80+ export CC=gcc
81+ export CXX=g++
82+ export CXXFLAGS=" ${CXXFLAGS:- } -D_GLIBCXX_USE_CXX11_ABI=1"
83+ export CFLAGS=" ${CFLAGS:- } -D_GLIBCXX_USE_CXX11_ABI=1"
84+
6485gcc --version
86+ g++ --version
6587cmake --version
6688java -version
6789
@@ -73,6 +95,13 @@ cd "${GITHUB_WORKSPACE:?GITHUB_WORKSPACE is not set}"
7395SO=" iotdb-client/client-cpp/target/install/lib/libiotdb_session.so"
7496test -f " ${SO} "
7597
98+ echo " === Verify libstdc++ CXX11 ABI in libiotdb_session.so ==="
99+ if ! nm -C " ${SO} " | grep -q ' __cxx11' ; then
100+ echo " ERROR: libiotdb_session.so does not contain std::__cxx11 symbols (old ABI?)" >&2
101+ exit 1
102+ fi
103+ nm -C " ${SO} " | grep ' Session::Session' | head -3 || true
104+
76105echo " === Build host glibc ==="
77106ldd --version 2>&1 | sed -n ' 1p'
78107
0 commit comments