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 CC5826F87A; Wed, 28 Apr 2021 02:08:11 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org CC5826F87A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1619564891; bh=PMNy9LhcquMVXzbVFS41woyJmqyy3wcw6H9T8ciyPX0=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=TBbiI32XW9BaiUADu/RJjL9bp/67qixGb82yBgxeN5JGba3F+bTi9TCNjGgcou564 HcdnJphXxs7T/79di1bN56bzyg8Xgd+7S8oB5/Nl7v1/UzLbW3rvDh19pyQDseTKRe Imkqc4TAivAbIwm4XjkSIt+NbvOxPdpW4alyFVDI= 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 8ADBA6F87A for ; Wed, 28 Apr 2021 02:08:10 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 8ADBA6F87A Received: by smtpng2.m.smailru.net with esmtpa (envelope-from ) id 1lbWoK-0004sS-Iu; Wed, 28 Apr 2021 02:08:09 +0300 To: Sergey Ostanevich , Sergey Kaplun Date: Wed, 28 Apr 2021 01:46:57 +0300 Message-Id: <5465d7bc81f04842dcdb65f222db381036c0659c.1619561872.git.imun@tarantool.org> X-Mailer: git-send-email 2.25.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD9ECFD8CE5F0594010E9FD8A050EF271A331F4FC8E58F6D291182A05F5380850406E37F39BBCC7DC112026989FE724A6A40AA16CE936ABF28139EC2475824770BB X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE78E88BD1CA827EF00C2099A533E45F2D0395957E7521B51C2CFCAF695D4D8E9FCEA1F7E6F0F101C6778DA827A17800CE7B9115C1E69829868EA1F7E6F0F101C67CDEEF6D7F21E0D1D9295C2E9FA3191EE1B59CA4C82EFA658180171E43056E9347DE68B8DBB99F1E6F6B57BC7E64490618DEB871D839B73339E8FC8737B5C224901F8F2FECC0250C8CC7F00164DA146DAFE8445B8C89999729449624AB7ADAF37F6B57BC7E64490611E7FA7ABCAF51C92176DF2183F8FC7C0EF2A066DDA19BA868941B15DA834481F9449624AB7ADAF372E808ACE2090B5E14AD6D5ED66289B5259CC434672EE63711DD303D21008E298D5E8D9A59859A8B6B372FE9A2E580EFC725E5C173C3A84C30584FF81F342DA0735872C767BF85DA2F004C90652538430E4A6367B16DE6309 X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A2AD77751E876CB595E8F7B195E1C97831DC992D4AD0EF90EDF58DDC17270A414D X-C1DE0DAB: C20DE7B7AB408E4181F030C43753B8186998911F362727C4C7A0BC55FA0FE5FC1FA79B7F5C44F8556785F3BA115B644E6143144CFF983B6DB1881A6453793CE9C32612AADDFBE06191A5E952AFEBA5A49510FB958DCE06DB6ED91DBE5ABE359A3485EE9140A7D39D1B2EFE7B39F7738393EDB24507CE13387DFF0A840B692CF8 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D3498910055B812BD9C2EDE9E591B0BF7B7AE8B8089BC211F614EAEE4B580C2EF6A7471804EFE6104371D7E09C32AA3244CEED97F9F34AE846BC389E856E5552CD18A6D4CC6FBFAC2518D5DD81C2BAB7D1D X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojbL9S8ysBdXgL0oYmQ7IoOjN+W37TSFMb X-Mailru-Sender: 689FA8AB762F73936BC43F508A06382297761F31514D2BE873FB2CC232D59A78A7C8D0F45F857DBFE9F1EFEE2F478337FB559BB5D741EB964C8C2C849690F8E70A04DAD6CC59E33667EA787935ED9F1B X-Mras: Ok Subject: [Tarantool-patches] [PATCH] build: fix linker flags for executable on MacOS 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" This patch fixes inaccuracy in Tarantool build configuration introduced by commit 07c83aab5c066ca75c149112b331b4dbb81b3f38 ('build: adjust LuaJIT build system'). All those MacOS-related tweaks for __PAGEZERO size and preferred load address for the bundle are necessary only for builds with 32-bit GC area on 64-bit host. The only case fitting these conditions is x86_64 with no LUAJIT_ENABLE_GC64. All other 64-bit builds use 64-bit GC area unconditionally. Part of #5983 Needed for #5629 Follows up #4862 Signed-off-by: Igor Munkin --- This patch partially fixes the build on M1. I tested it on tntmac07 alongside with the changes Nikita made for libcoro[1]. As a result Tarantool has been successfully built, but fails to start. CI looks to be OK[2] except the known problems with ASAN[3]. Issue: https://github.com/tarantool/tarantool/issues/5983 Branch: https://github.com/tarantool/tarantool/tree/imun/gh-5983-fix-build-on-m1 [1]: https://github.com/tarantool/tarantool/commit/309ce38 [2]: https://github.com/tarantool/tarantool/commit/5465d7b [3]: https://github.com/tarantool/tarantool/issues/6031 cmake/luajit.cmake | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/cmake/luajit.cmake b/cmake/luajit.cmake index 3d37164e8..9390d0dfd 100644 --- a/cmake/luajit.cmake +++ b/cmake/luajit.cmake @@ -73,11 +73,21 @@ if(ENABLE_ASAN) add_definitions(-DLUAJIT_USE_ASAN=1) endif() -if(TARGET_OS_DARWIN) - # Necessary to make LuaJIT (and Tarantool) work on Darwin, see - # http://luajit.org/install.html. - set(CMAKE_EXE_LINKER_FLAGS - "${CMAKE_EXE_LINKER_FLAGS} -pagezero_size 10000 -image_base 100000000") +if(TARGET_OS_DARWIN AND NOT LUAJIT_ENABLE_GC64) + # XXX: This is not the best idea to build LuaJIT on MacOS + # with GC64 disabled. But nobody will stop you from this. + # You are warned. For more info see the following issue. + # https://github.com/tarantool/tarantool/issues/2643 + message(WARNING "LUAJIT_ENABLE_GC64 is disabled for MacOS. " + "See #2643, why this is not a good idea.") + # XXX: Necessary to make LuaJIT (and hence Tarantool) work on + # Darwin/x86_64, see the following links for more info: + # * http://luajit.org/install.html#embed + # * https://github.com/tarantool/luajit/blob/789820a/cmake/SetTargetFlags.cmake + if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") + set(CMAKE_EXE_LINKER_FLAGS + "${CMAKE_EXE_LINKER_FLAGS} -pagezero_size 10000 -image_base 100000000") + endif() endif() # Define the locations for LuaJIT sources and artefacts. -- 2.25.0