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 6F4366F3C4; Tue, 11 May 2021 01:31:23 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 6F4366F3C4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1620685883; bh=NuL+qyqyEkyIfZFT9xXnqxfq2+T+MncoO16JRll2UgU=; 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=FOBw3fdl4RLhqv7h2m1xYerU2asnau/j3uCtgVWE4x4hcyPUgcG+t37AZPz6tfqV7 PKauJ5GLVfCXAMg1Kk6PCWzdz3khGnk2UPx82JN9UFyuxnIgkpuo6Nlmdw0JRa9aUU wG88+LbSZorUL+e2SjkpLTE8x32YNyUIHVDdbN58= 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 44A976F3F3 for ; Tue, 11 May 2021 01:30:22 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 44A976F3F3 Received: by smtpng2.m.smailru.net with esmtpa (envelope-from ) id 1lgEPt-0001ky-Cr; Tue, 11 May 2021 01:30:21 +0300 To: Sergey Ostanevich , Sergey Kaplun Date: Tue, 11 May 2021 01:09:06 +0300 Message-Id: X-Mailer: git-send-email 2.25.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD95978C26455E69BE0BB6090B4F8997C21AA3492AFA30115D5182A05F53808504044A2D9C161296DFB8D7382CA72CD6F9201DCF66363CB1A30F84ADC8798891E68 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7BA0D57D3459E5640EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006379108F895B68B2FFD8638F802B75D45FF914D58D5BE9E6BC1A93B80C6DEB9DEE97C6FB206A91F05B2503A3F5EC6A964C678A2D5B03EDE92708E320D419CB56618D2E47CDBA5A96583C09775C1D3CA48CFE97D2AE7161E217F117882F4460429724CE54428C33FAD30A8DF7F3B2552694AC26CFBAC0749D213D2E47CDBA5A9658378DA827A17800CE7820CF4CC0E318EFB9FA2833FD35BB23DF004C906525384302BEBFE083D3B9BA71A620F70A64A45A98AA50765F79006372E808ACE2090B5E1725E5C173C3A84C3C5EA940A35A165FF2DBA43225CD8A89F616AD31D0D18CD5CCE5475246E174218B5C8C57E37DE458BEDA766A37F9254B7 X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A2AD77751E876CB595E8F7B195E1C978315B91A4E0F07C724BD5EE6400B98F466E X-C1DE0DAB: C20DE7B7AB408E4181F030C43753B8186998911F362727C414F749A5E30D975C08CF033E463A5088A1B308DBBB285C4BE2D186F8B76E0B549C2B6934AE262D3EE7EAB7254005DCED7532B743992DF240BDC6A1CF3F042BAD6DF99611D93F60EF0417BEADF48D1460699F904B3F4130E343918A1A30D5E7FCCB5012B2E24CD356 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D340CB2836B82369449114D7772997B657DDD80D9D1E8295EB84DF55EF7D27EB5DA8228A3ACA4F5C4701D7E09C32AA3244CFA29B0447CAC8672F78B1BB934AB56873A76366E8A9DE7CA927AC6DF5659F194 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojW8rfvRc3+ArXOmkg5tcnPw== X-Mailru-Sender: 689FA8AB762F73936BC43F508A0638222641E87556EFE8B4BFC998CE1DCD7305A7C8D0F45F857DBFE9F1EFEE2F478337FB559BB5D741EB964C8C2C849690F8E70A04DAD6CC59E33667EA787935ED9F1B X-Mras: Ok Subject: [Tarantool-patches] [PATCH luajit 2/3] OSX/iOS: Handle iOS simulator and ARM64 Macs. 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" From: Mike Pall (cherry picked from commit 2e2fb8f6b5118e1a7996b76600c6ee98bfd5f203) After Apple released Macs working on ARM64, the previous recipe in lj_arch.h for detecting various Apple platforms is not valid anymore. Fortunately, there is a system header (i.e. TargetConditionals.h), provided by SDK with the proper defines to be set. Starting from this patch, LuaJIT identifies Apple hosts via this header. Since testing machinery assumes that LuaJIT is built with JIT support being enabled unconditionally, a smoke test for it is also added alongside with this patch. Igor Munkin: * added the description and the test for the problem * backported the original patch to tarantool/luajit repo Part of tarantool/tarantool#5629 Relates to tarantool/tarantool#5983 Signed-off-by: Igor Munkin --- src/lj_arch.h | 8 +++++++- .../gh-5983-jit-library-smoke-tests.test.lua | 11 +++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 test/tarantool-tests/gh-5983-jit-library-smoke-tests.test.lua diff --git a/src/lj_arch.h b/src/lj_arch.h index d8676e92..5bf0afb8 100644 --- a/src/lj_arch.h +++ b/src/lj_arch.h @@ -69,6 +69,7 @@ #elif defined(__linux__) #define LUAJIT_OS LUAJIT_OS_LINUX #elif defined(__MACH__) && defined(__APPLE__) +#include "TargetConditionals.h" #define LUAJIT_OS LUAJIT_OS_OSX #elif (defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || \ defined(__NetBSD__) || defined(__OpenBSD__) || \ @@ -103,10 +104,15 @@ #define LJ_TARGET_WINDOWS (LUAJIT_OS == LUAJIT_OS_WINDOWS) #define LJ_TARGET_LINUX (LUAJIT_OS == LUAJIT_OS_LINUX) #define LJ_TARGET_OSX (LUAJIT_OS == LUAJIT_OS_OSX) -#define LJ_TARGET_IOS (LJ_TARGET_OSX && (LUAJIT_TARGET == LUAJIT_ARCH_ARM || LUAJIT_TARGET == LUAJIT_ARCH_ARM64)) #define LJ_TARGET_POSIX (LUAJIT_OS > LUAJIT_OS_WINDOWS) #define LJ_TARGET_DLOPEN LJ_TARGET_POSIX +#if TARGET_OS_IPHONE +#define LJ_TARGET_IOS 1 +#else +#define LJ_TARGET_IOS 0 +#endif + #ifdef __CELLOS_LV2__ #define LJ_TARGET_PS3 1 #define LJ_TARGET_CONSOLE 1 diff --git a/test/tarantool-tests/gh-5983-jit-library-smoke-tests.test.lua b/test/tarantool-tests/gh-5983-jit-library-smoke-tests.test.lua new file mode 100644 index 00000000..b23dd712 --- /dev/null +++ b/test/tarantool-tests/gh-5983-jit-library-smoke-tests.test.lua @@ -0,0 +1,11 @@ +local tap = require('tap') + +local test = tap.test('gh-5983-jit-library-smoke-tests') +test:plan(1) + +-- Just check whether LuaJIT is built with JIT support. Otherwise, +-- raises an error that is handled via and passed +-- as a second argument to the assertion. +test:ok(pcall(jit.on)) + +os.exit(test:check() and 0 or 1) -- 2.25.0