From bac1f4ecb5ba5e5e3c55ac3669f4d4e325e62bd9 Mon Sep 17 00:00:00 2001 From: praveenbingo Date: Fri, 23 Nov 2018 11:02:49 +0000 Subject: [PATCH] ARROW-3860: [Gandiva][C++] Link std c++ statically. Restores linking statically to std c++, so that it can be safely packaged for other similar environments. --- cpp/src/gandiva/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cpp/src/gandiva/CMakeLists.txt b/cpp/src/gandiva/CMakeLists.txt index 515802a46cf9..a03178b378bf 100644 --- a/cpp/src/gandiva/CMakeLists.txt +++ b/cpp/src/gandiva/CMakeLists.txt @@ -74,6 +74,10 @@ set(GANDIVA_STATIC_LINK_LIBS LLVM::LLVM_INTERFACE ${RE2_LIBRARY}) +if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX) + set (CMAKE_SHARED_LINKER_FLAGS "-static-libstdc++ -static-libgcc") +endif() + ADD_ARROW_LIB(gandiva SOURCES ${SRC_FILES} OUTPUTS GANDIVA_LIBRARIES