Skip to content

Commit 80b9764

Browse files
committed
Fix conflicts with other python libraries due to static link to libstdc++ (#244)
Fixes #242 Fixes #243 Fixes #245 Add a patch to avoid linking to libgcc and libstdc++. (cherry picked from commit 4a4ac3f)
1 parent f245126 commit 80b9764

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

pkg/build-wheel-inside-docker.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
set -e -x
2222

2323
cd /pulsar-client-python
24+
ROOT_DIR=$PWD
2425
source build-support/dep-url.sh
2526

2627
# Build cpp wheels
@@ -46,6 +47,9 @@ if [ $CPP_BINARY_TYPE == "rpm" ]; then
4647
cd ..
4748
./bootstrap-vcpkg.sh
4849
cd ..
50+
if [ $PULSAR_CPP_VERSION == "3.7.0" ]; then
51+
patch lib/CMakeLists.txt $ROOT_DIR/pkg/manylinux2014/pulsar-client-cpp-3.7.0.patch
52+
fi
4953
cmake -B build-cpp -DINTEGRATE_VCPKG=ON -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=OFF -DBUILD_DYNAMIC_LIB=ON -DBUILD_STATIC_LIB=ON
5054
cmake --build build-cpp -j8 --target install
5155
cd ..
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
--- lib/CMakeLists.txt
2+
+++ lib/CMakeLists.txt
3+
@@ -93,10 +93,6 @@
4+
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
5+
target_link_options(pulsarShared PRIVATE -Wl,-Bsymbolic)
6+
endif ()
7+
- check_cxx_symbol_exists(__GLIBCXX__ iostream GLIBCXX)
8+
- if (GLIBCXX)
9+
- target_link_libraries(pulsarShared PUBLIC -static-libgcc -static-libstdc++)
10+
- endif ()
11+
endif()
12+
13+
check_cxx_symbol_exists(getauxval sys/auxv.h HAVE_AUXV_GETAUXVAL)

0 commit comments

Comments
 (0)