From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp52.i.mail.ru (smtp52.i.mail.ru [94.100.177.112]) (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 9198D4696C3 for ; Thu, 23 Apr 2020 14:37:33 +0300 (MSK) References: <41a1decbbad25ee4b080052e64f65d1c4206c426.1587490798.git.lvasiliev@tarantool.org> <20200423105202.megr2ezi4upvjale@tkn_work_nb> From: lvasiliev Message-ID: Date: Thu, 23 Apr 2020 14:37:32 +0300 MIME-Version: 1.0 In-Reply-To: <20200423105202.megr2ezi4upvjale@tkn_work_nb> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Tarantool-patches] [PATCH] Add a check whether glibc is used List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Turenko Cc: tarantool-patches@dev.tarantool.org On 23.04.2020 13:52, Alexander Turenko wrote: > LGTM. > > Several minor comments are below. > >> Add a check whether glibc is used > > Please, add 'build' prefix. > > On Tue, Apr 21, 2020 at 08:44:57PM +0300, Leonid Vasiliev wrote: >> The cbus hang test uses glibc pthread mutex implementation details. >> Therefore, it should not compile in case of using another library. > > Reviewed-by: Alexander Turenko > >> --- >> Now the compilation for alpine 3.5 is broken. > > It worth to include certain motivation right into the commit message: > fix compilation on Alpine 3.5 is this case. > >> >> https://github.com/tarantool/tarantool/tree/lvasiliev/gh-noticket-glibc-check > > I would check it on '-full-ci' branch just in case. > >> >> 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) > > On my system the macro is defined in features.h. > >> +if (GLIBC_USED) >> add_executable(cbus_hang.test cbus_hang.c) >> target_link_libraries(cbus_hang.test core unit stat) >> endif () Updated. diff --git a/test/unit/CMakeLists.txt b/test/unit/CMakeLists.txt index 699cd8c..84eb066 100644 --- a/test/unit/CMakeLists.txt +++ b/test/unit/CMakeLists.txt @@ -105,7 +105,7 @@ add_executable(cbus.test cbus.c) target_link_libraries(cbus.test core unit stat) include(CheckSymbolExists) -check_symbol_exists(__GLIBC__ stdio.h GLIBC_USED) +check_symbol_exists(__GLIBC__ features.h GLIBC_USED) if (GLIBC_USED) add_executable(cbus_hang.test cbus_hang.c) target_link_libraries(cbus_hang.test core unit stat) Message: commit 7afdd51bf559a27565302067a078996139fec4b8 Author: Leonid Vasiliev Date: Tue Apr 21 19:16:17 2020 +0300 build: fix compilation on Alpine 3.5 The cbus hang test uses glibc pthread mutex implementation details. The reason why mutex implementation details is used: "For the bug reproducing the canceled thread must be canceled during processing cpipe_flush_cb. We need to synchronize the main thread and the canceled worker thread for that. So, thread synchronization has been realized by means of endpoint's mutex internal field(__data.__lock)." Therefore, it should not compile in case of using another library.