From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Mon, 8 Oct 2018 16:14:00 +0300 From: Alexander Turenko Subject: Re: [PATCH] cmake: fix sync_file_range detection Message-ID: <20181008131400.bst6ysnrpsbhfkrj@tkn_work_nb> References: <20181008030408.fp4hatginitn5pmm@tkn_work_nb> <20181008080012.fsjfvatwyqnjnhw3@esperanza> <20181008092358.jg44ykl26gek27wl@tkn_work_nb> <20181008103009.s6mespmbs4qmxr64@esperanza> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20181008103009.s6mespmbs4qmxr64@esperanza> To: Vladimir Davydov Cc: tarantool-patches@freelists.org List-ID: On Mon, Oct 08, 2018 at 01:30:09PM +0300, Vladimir Davydov wrote: > On Mon, Oct 08, 2018 at 12:23:58PM +0300, Alexander Turenko wrote: > > On Mon, Oct 08, 2018 at 11:00:12AM +0300, Vladimir Davydov wrote: > > > On Mon, Oct 08, 2018 at 06:04:08AM +0300, Alexander Turenko wrote: > > > > On Sat, Oct 06, 2018 at 05:51:48PM +0300, Vladimir Davydov wrote: > > > > > sync_file_range is declared only if _GNU_SOURCE macro is defined. > > > > > Also, in order to be used in a source file, HAVE_SYNC_FILE_RANGE > > > > > must be present in config.h.cmake. > > > > > > > > > > Fixes commit caae99e5eaa0 ("Refactor xlog writer"). > > > > > --- > > > > > https://github.com/tarantool/tarantool/commits/dv/cmake-fix-gnu-symbol-detection > > > > > > > > > > CMakeLists.txt | 2 ++ > > > > > src/trivia/config.h.cmake | 1 + > > > > > 2 files changed, 3 insertions(+) > > > > > > > > > > diff --git a/CMakeLists.txt b/CMakeLists.txt > > > > > index bf68d187..b26d2abf 100644 > > > > > --- a/CMakeLists.txt > > > > > +++ b/CMakeLists.txt > > > > > @@ -69,6 +69,8 @@ include(cmake/profile.cmake) > > > > > include(cmake/module.cmake) > > > > > include(cmake/thread.cmake) > > > > > > > > > > +list(APPEND CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE) > > > > > + > > > > > > > > cmake/os.cmake already has `add_definitions("-D_GNU_SOURCE")`, is that > > > > not sufficient? > > > > > > Looks like not. I checked - sync_page_range isn't used on Linux without > > > this patch. > > > > It looks similar to the cmake issue [1]. > > > > Maybe it is better to set CMAKE_REQUIRED_DEFINITIONS in sync with > > add_definitions (in os.cmake), what do you think? > > I don't think so. We typically set CMAKE_REQUIRED_* before checking for > symbols. Now I see. Okay. > > BTW, I should have probably used set() instead of list(APPEND). Other places use set(), yep. I would use it for consistency. The patch is LGTM (w/ set() or list(), does not matter much). WBR, Alexander Turenko.