This is an automated email from the ASF dual-hosted git repository. xyz pushed a commit to branch branch-3.7 in repository https://gitbox.apache.org/repos/asf/pulsar-client-cpp.git
commit dba2752ce39d5d386e0008e64b3e0537e825fb10 Author: Yunze Xu <[email protected]> AuthorDate: Mon Jun 23 17:45:20 2025 +0800 Remove static link to libstdc++ to avoid conflicts (#493) (cherry picked from commit 639786f5ba579f7755f4220459bd613d89561617) --- lib/CMakeLists.txt | 5 ----- pkg/deb/build-deb.sh | 2 +- pkg/rpm/SPECS/pulsar-client.spec | 1 - 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 21b308c..e34555d 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -76,7 +76,6 @@ target_include_directories(PULSAR_OBJECT_LIB PUBLIC "${CMAKE_SOURCE_DIR}/include" "${CMAKE_BINARY_DIR}/include") -option(LINK_STATIC_GCC_CXX "Link statically to libgcc and libstdc++" OFF) include(CheckCXXSymbolExists) if (BUILD_DYNAMIC_LIB) add_library(pulsarShared SHARED $<TARGET_OBJECTS:PULSAR_OBJECT_LIB>) @@ -94,10 +93,6 @@ if (BUILD_DYNAMIC_LIB) if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") target_link_options(pulsarShared PRIVATE -Wl,-Bsymbolic) endif () - check_cxx_symbol_exists(__GLIBCXX__ iostream GLIBCXX) - if (GLIBCXX AND LINK_STATIC_GCC_CXX) - target_link_libraries(pulsarShared PUBLIC -static-libgcc -static-libstdc++) - endif () endif() check_cxx_symbol_exists(getauxval sys/auxv.h HAVE_AUXV_GETAUXVAL) diff --git a/pkg/deb/build-deb.sh b/pkg/deb/build-deb.sh index 1dabb9f..8415056 100755 --- a/pkg/deb/build-deb.sh +++ b/pkg/deb/build-deb.sh @@ -41,7 +41,7 @@ pushd $CPP_DIR export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH chmod +x $(find . -name "*.sh") -cmake . -DBUILD_TESTS=OFF -DBUILD_PERF_TOOLS=OFF -DLINK_STATIC=ON -DLINK_STATIC_GCC_CXX=ON +cmake . -DBUILD_TESTS=OFF -DBUILD_PERF_TOOLS=OFF -DLINK_STATIC=ON make -j 3 popd diff --git a/pkg/rpm/SPECS/pulsar-client.spec b/pkg/rpm/SPECS/pulsar-client.spec index 41a2e58..425eec5 100644 --- a/pkg/rpm/SPECS/pulsar-client.spec +++ b/pkg/rpm/SPECS/pulsar-client.spec @@ -55,7 +55,6 @@ static library. %build git clone https://github.com/microsoft/vcpkg.git cmake -B build -DINTEGRATE_VCPKG=ON -DCMAKE_BUILD_TYPE=Release \ - -DLINK_STATIC_GCC_CXX=ON \ -DBUILD_TESTS=OFF -DBUILD_DYNAMIC_LIB=ON -DBUILD_STATIC_LIB=ON cmake --build build -j8 ./build-support/merge_archives_vcpkg.sh $PWD/build
