[Tarantool-patches] [PATCH] Add a check whether glibc is used

Leonid Vasiliev lvasiliev at tarantool.org
Tue Apr 21 20:44:57 MSK 2020


The cbus hang test uses glibc pthread mutex implementation details.
Therefore, it should not compile in case of using another library.
---
Now the compilation for alpine 3.5 is broken.

https://github.com/tarantool/tarantool/tree/lvasiliev/gh-noticket-glibc-check

 test/unit/CMakeLists.txt | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/test/unit/CMakeLists.txt b/test/unit/CMakeLists.txt
index 24586c2..699cd8c 100644
--- a/test/unit/CMakeLists.txt
+++ b/test/unit/CMakeLists.txt
@@ -104,7 +104,9 @@ target_link_libraries(cbus_stress.test core stat)
 add_executable(cbus.test cbus.c)
 target_link_libraries(cbus.test core unit stat)
 
-if (${CMAKE_HOST_SYSTEM_NAME} MATCHES "Linux")
+include(CheckSymbolExists)
+check_symbol_exists(__GLIBC__ stdio.h GLIBC_USED)
+if (GLIBC_USED)
     add_executable(cbus_hang.test cbus_hang.c)
     target_link_libraries(cbus_hang.test core unit stat)
 endif ()
-- 
2.7.4



More information about the Tarantool-patches mailing list