From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id 205336F3C4; Tue, 11 May 2021 01:30:53 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 205336F3C4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1620685853; bh=k6kq8o80/xZ8kTLF0CmfrfzyXmAsAk3f5ZEo07ZvRks=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=Q6Eb6Mff3KepCjL0RX8vQ3Cwr8G1BrzCQ20hT/nePBcXHDl/k4/Wsm/jhLVe92xh3 y+G4KYCMNf5uJdPoXaCc/md2/CQnjFiOhXxHEQdQyYN1okF8IBdAQwzBLowwTNxfuy kT0JENAT7xzXQJ+yaEqXap5nKyc7THTJ4MP72wUw= Received: from smtpng2.m.smailru.net (smtpng2.m.smailru.net [94.100.179.3]) (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 E4C286F3C4 for ; Tue, 11 May 2021 01:30:21 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org E4C286F3C4 Received: by smtpng2.m.smailru.net with esmtpa (envelope-from ) id 1lgEPs-0001ky-U0; Tue, 11 May 2021 01:30:21 +0300 To: Sergey Ostanevich , Sergey Kaplun Date: Tue, 11 May 2021 01:09:05 +0300 Message-Id: <4dd97d6fbfb470d41e9ef5ad12492a0def664b2b.1620678384.git.imun@tarantool.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD95978C26455E69BE0B2C7F7C3B0039F1303CE517DE434612D182A05F538085040B2D405C1FC69A86216B9AEB662A485010BD07B6E64030B58F84ADC8798891E68 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7BB17EE3498E810FEEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006373D332FFE8BBF4EB58638F802B75D45FF914D58D5BE9E6BC1A93B80C6DEB9DEE97C6FB206A91F05B2BE65EAF985D825B3C5AE5A15A8CCA656AA867293B0326636D2E47CDBA5A96583C09775C1D3CA48CF53FA85A707D24CADCC7F00164DA146DAFE8445B8C89999729449624AB7ADAF37F6B57BC7E64490611E7FA7ABCAF51C92176DF2183F8FC7C0B27420F9988F54058941B15DA834481F9449624AB7ADAF372E808ACE2090B5E14AD6D5ED66289B5259CC434672EE63711DD303D21008E298D5E8D9A59859A8B6B372FE9A2E580EFC725E5C173C3A84C30E7A8B1B1FD51AB935872C767BF85DA2F004C90652538430E4A6367B16DE6309 X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A2AD77751E876CB595E8F7B195E1C978315B91A4E0F07C724BD5EE6400B98F466E X-C1DE0DAB: C20DE7B7AB408E4181F030C43753B8186998911F362727C414F749A5E30D975C08CF033E463A508818E98C40A0BC8FDDCBEEB26042215A5F9C2B6934AE262D3EE7EAB7254005DCED7532B743992DF240BDC6A1CF3F042BAD6DF99611D93F60EF0417BEADF48D1460699F904B3F4130E343918A1A30D5E7FCCB5012B2E24CD356 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34128DEC38EFF4BE5ABEE85CD89F40C3E1D6C901E15CA3FBA06E602BC77560BA246B0C8BDA70427F041D7E09C32AA3244C16F36FAFF8E5F0DF769365D257D31FF0B038C9161EF167A1927AC6DF5659F194 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojW8rfvRc3+ArXOmkg5tcnPw== X-Mailru-Sender: 689FA8AB762F73936BC43F508A063822208BBB7F535298D50CB5E47177448C98A7C8D0F45F857DBFE9F1EFEE2F478337FB559BB5D741EB964C8C2C849690F8E70A04DAD6CC59E33667EA787935ED9F1B X-Mras: Ok Subject: [Tarantool-patches] [PATCH luajit 1/3] build: pass sysroot to MacOS SDK X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Igor Munkin via Tarantool-patches Reply-To: Igor Munkin Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" There were issues with configuring LuaJIT on Apple machines, since CMake auxiliary routine fails to locate system headers (e.g. assert.h in case when LUA_USE_ASSERT is enabled). As a result platform detection fails and LuaJIT configuration ends with the fatal error. This patch adds the necessary flags to help the routine to find the required system headers. Relates to tarantool/tarantool#5629 Needed for tarantool/tarantool#5983 Follows up tarantool/tarantool#4862 Signed-off-by: Igor Munkin --- CMakeLists.txt | 9 +++++++++ cmake/LuaJITUtils.cmake | 7 ++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5348e043..110a989f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -114,6 +114,15 @@ if(LUAJIT_ENABLE_WARNINGS) ) endif() +# Set sysroot settings on OSX to find SDK with the system headers. +# XXX: Obviously, there is no need in this setup if everything is +# already set via CMAKE_C_FLAGS or in parent project build system. +if(CMAKE_OSX_SYSROOT AND CMAKE_C_SYSROOT_FLAG AND + NOT "${CMAKE_C_FLAGS}" MATCHES "${CMAKE_C_SYSROOT_FLAG} ${CMAKE_OSX_SYSROOT}" +) + AppendFlags(CMAKE_C_FLAGS "${CMAKE_C_SYSROOT_FLAG} ${CMAKE_OSX_SYSROOT}") +endif() + # Auxiliary flags for main targets (libraries, binaries). AppendFlags(TARGET_C_FLAGS -D_FILE_OFFSET_BITS=64 diff --git a/cmake/LuaJITUtils.cmake b/cmake/LuaJITUtils.cmake index d9f8b12a..8ff26a6a 100644 --- a/cmake/LuaJITUtils.cmake +++ b/cmake/LuaJITUtils.cmake @@ -1,8 +1,13 @@ function(LuaJITTestArch outvar strflags) + # XXX: Compiler flags are also required in this routine. It can + # use e.g. external headers, which location is specified either + # implicitly (within CMake machinery) or explicitly (manually by + # configuration options). + set(TESTARCH_C_FLAGS "${CMAKE_C_FLAGS} ${strflags}") # XXX: simply splits the COMMAND argument by # spaces with no further parsing. At the same time GCC is bad in # argument handling, so let's help it a bit. - separate_arguments(TESTARCH_C_FLAGS UNIX_COMMAND ${strflags}) + separate_arguments(TESTARCH_C_FLAGS UNIX_COMMAND ${TESTARCH_C_FLAGS}) # TODO: It would be nice to drop a few words, why do we use this # approach instead of CMAKE_HOST_SYSTEM_PROCESSOR variable. execute_process( -- 2.25.0