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

Alexander Turenko alexander.turenko at tarantool.org
Thu Apr 23 13:52:02 MSK 2020


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 <alexander.turenko at tarantool.org>

> ---
> 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 ()


More information about the Tarantool-patches mailing list