From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <lvasiliev@tarantool.org>
Received: from smtp41.i.mail.ru (smtp41.i.mail.ru [94.100.177.101])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (No client certificate requested)
 by dev.tarantool.org (Postfix) with ESMTPS id 18BD04696C3
 for <tarantool-patches@dev.tarantool.org>;
 Tue, 21 Apr 2020 20:44:59 +0300 (MSK)
From: Leonid Vasiliev <lvasiliev@tarantool.org>
Date: Tue, 21 Apr 2020 20:44:57 +0300
Message-Id: <41a1decbbad25ee4b080052e64f65d1c4206c426.1587490798.git.lvasiliev@tarantool.org>
Subject: [Tarantool-patches] [PATCH] Add a check whether glibc is used
List-Id: Tarantool development patches <tarantool-patches.dev.tarantool.org>
List-Unsubscribe: <https://lists.tarantool.org/mailman/options/tarantool-patches>, 
 <mailto:tarantool-patches-request@dev.tarantool.org?subject=unsubscribe>
List-Archive: <https://lists.tarantool.org/pipermail/tarantool-patches/>
List-Post: <mailto:tarantool-patches@dev.tarantool.org>
List-Help: <mailto:tarantool-patches-request@dev.tarantool.org?subject=help>
List-Subscribe: <https://lists.tarantool.org/mailman/listinfo/tarantool-patches>, 
 <mailto:tarantool-patches-request@dev.tarantool.org?subject=subscribe>
To: gorcunov@gmail.com, alexander.turenko@tarantool.org
Cc: tarantool-patches@dev.tarantool.org

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