diff --git a/CMakeLists.txt b/CMakeLists.txt index 91d81e71831fd913f71cb991e936f4a85fe4de01..c928052fd85044195a91e2616c73ff7292b6d392 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -184,6 +184,9 @@ if (ENABLE_STATIC) add_compile_flags("C;CXX" "-static") endif() +# Compile with builtin libgcc by default. +add_compile_flags("C;CXX;OBJC;OBJCXX" "-static-libgcc") + ## ## Third-Party libraries ## diff --git a/connector/c/tnt/CMakeLists.txt b/connector/c/tnt/CMakeLists.txt index 8fbc77f23a3d493e004de59e8e07be26212a0c09..faa8d65cdd29393e677734fec19c022deb5fef1f 100644 --- a/connector/c/tnt/CMakeLists.txt +++ b/connector/c/tnt/CMakeLists.txt @@ -44,8 +44,11 @@ set (tnt_sources # Here we manage to build static/dynamic libraries ourselves, # do not use the top level settings. +string(REPLACE "-static-libgcc" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") string(REPLACE "-static" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") +set (tnt_cflags "${tnt_cflags} -static-libgcc") + # # Static library # diff --git a/connector/c/tntnet/CMakeLists.txt b/connector/c/tntnet/CMakeLists.txt index adb4e17a751f319681b7b0713cce37463423e194..46e22f7813fc61f9a9f184bc722482c05addce7b 100644 --- a/connector/c/tntnet/CMakeLists.txt +++ b/connector/c/tntnet/CMakeLists.txt @@ -35,8 +35,11 @@ set (tntnet_sources # Here we manage to build static/dynamic libraries ourselves, # do not use the top level settings. +string(REPLACE "-static-libgcc" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") string(REPLACE "-static" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") +set (tnt_cflags "${tnt_cflags} -static-libgcc") + # # Static library # diff --git a/connector/c/tntrpl/CMakeLists.txt b/connector/c/tntrpl/CMakeLists.txt index 5e1db84aa75087812ee95b3a29506e8dbdf1bcae..7dc2794ffd174443bf732ca8cad52426dff9a98a 100644 --- a/connector/c/tntrpl/CMakeLists.txt +++ b/connector/c/tntrpl/CMakeLists.txt @@ -32,8 +32,11 @@ set (tntrpl_sources tnt_log.c tnt_dir.c tnt_xlog.c tnt_snapshot.c tnt_rpl.c # Here we manage to build static/dynamic libraries ourselves, # do not use the top level settings. +string(REPLACE "-static-libgcc" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") string(REPLACE "-static" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") +set (tnt_cflags "${tnt_cflags} -static-libgcc") + # # Static library # diff --git a/connector/c/tntsql/CMakeLists.txt b/connector/c/tntsql/CMakeLists.txt index f88c3838d1fefc045b4bfd71b42e4a3aa372fd5e..655e4e3c371a00f31f62619e374d422afa9a2fcc 100644 --- a/connector/c/tntsql/CMakeLists.txt +++ b/connector/c/tntsql/CMakeLists.txt @@ -34,8 +34,11 @@ set (tntsql_sources # Here we manage to build static/dynamic libraries ourselves, # do not use the top level settings. +string(REPLACE "-static-libgcc" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") string(REPLACE "-static" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") +set (tnt_cflags "${tnt_cflags} -static-libgcc") + # # Static library #