Remove static link to libstdc++ to avoid conflicts (#493)
(cherry picked from commit 639786f5ba579f7755f4220459bd613d89561617)
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 @@
"${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 (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 @@
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 @@
%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