Skip to content

Commit 3eb2624

Browse files
committed
Fix glibc217 C++ client ABI build
1 parent 77d41e9 commit 3eb2624

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

.github/scripts/package-client-cpp-manylinux-glibc217.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,20 @@ esac
3737

3838
PACKAGE_CLASSIFIER="${PACKAGE_CLASSIFIER:-${DEFAULT_CLASSIFIER}}"
3939

40+
# manylinux2014 is glibc 2.17 based, but its system GCC may be too old to
41+
# provide libstdc++'s dual ABI. Use the newest available devtoolset so
42+
# _GLIBCXX_USE_CXX11_ABI=1 produces std::__cxx11 symbols.
43+
for devtoolset in devtoolset-12 devtoolset-11 devtoolset-10 devtoolset-9 devtoolset-8 devtoolset-7; do
44+
if [[ -f "/opt/rh/${devtoolset}/enable" ]]; then
45+
# shellcheck disable=SC1090
46+
set +u
47+
source "/opt/rh/${devtoolset}/enable"
48+
set -u
49+
echo "Enabled ${devtoolset}"
50+
break
51+
fi
52+
done
53+
4054
CMAKE_VERSION=3.28.4
4155
CMAKE_DIR="/opt/cmake-${CMAKE_VERSION}"
4256
if [[ ! -x "${CMAKE_DIR}/bin/cmake" ]]; then
@@ -62,6 +76,12 @@ export PATH="${CMAKE_DIR}/bin:${JAVA_HOME}/bin:${PATH}"
6276
export JAVA_HOME
6377

6478
gcc --version
79+
c++ --version
80+
gcc_major=$(gcc -dumpversion | cut -d. -f1)
81+
if (( gcc_major < 5 )); then
82+
echo "ERROR: GCC >= 5 is required for _GLIBCXX_USE_CXX11_ABI=1; got $(gcc -dumpversion)"
83+
exit 1
84+
fi
6585
cmake --version
6686
java -version
6787

0 commit comments

Comments
 (0)