Skip to content

Commit

Permalink
Fix conflicts with other python libraries due to static link to libst…
Browse files Browse the repository at this point in the history
…dc++ (#244)

Fixes #242
Fixes #243
Fixes #245

Add a patch to avoid linking to libgcc and libstdc++.
  • Loading branch information
BewareMyPower authored Feb 8, 2025
1 parent 508a4c3 commit 4a4ac3f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/build-wheel-inside-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
set -e -x

cd /pulsar-client-python
ROOT_DIR=$PWD
source build-support/dep-url.sh

# Build cpp wheels
Expand All @@ -46,6 +47,9 @@ if [ $CPP_BINARY_TYPE == "rpm" ]; then
cd ..
./bootstrap-vcpkg.sh
cd ..
if [ $PULSAR_CPP_VERSION == "3.7.0" ]; then
patch lib/CMakeLists.txt $ROOT_DIR/pkg/manylinux2014/pulsar-client-cpp-3.7.0.patch
fi
cmake -B build-cpp -DINTEGRATE_VCPKG=ON -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=OFF -DBUILD_DYNAMIC_LIB=ON -DBUILD_STATIC_LIB=ON
cmake --build build-cpp -j8 --target install
cd ..
Expand Down
13 changes: 13 additions & 0 deletions pkg/manylinux2014/pulsar-client-cpp-3.7.0.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
--- lib/CMakeLists.txt
+++ lib/CMakeLists.txt
@@ -93,10 +93,6 @@
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
target_link_options(pulsarShared PRIVATE -Wl,-Bsymbolic)
endif ()
- check_cxx_symbol_exists(__GLIBCXX__ iostream GLIBCXX)
- if (GLIBCXX)
- target_link_libraries(pulsarShared PUBLIC -static-libgcc -static-libstdc++)
- endif ()
endif()

check_cxx_symbol_exists(getauxval sys/auxv.h HAVE_AUXV_GETAUXVAL)

0 comments on commit 4a4ac3f

Please sign in to comment.