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 B64E3350B8; Thu, 1 Dec 2022 11:55:32 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org B64E3350B8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1669884932; bh=lN8kGBGauG+hc6Cernua6RbYLQwVm9i2IKCD6+JQDh4=; h=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=S8ojCOs5oRTfZC7IeYEVjZdW5nDk1ZsvfDPEsaXqWcE+8v5fYdjQqvrBmLNcEk5ER pPIX1B/wbHnTe9L/fAzUOTz47ztUzHk8FC1ino9rYUbfrC/5418AQT9Fa6Zl7NPSsz wRC54Xe9mnsAnCWE6vExglufKjpX7MT9Z/YN3ToY= Received: from smtp52.i.mail.ru (smtp52.i.mail.ru [94.100.177.112]) (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 5FCC8350B8 for ; Thu, 1 Dec 2022 11:55:31 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 5FCC8350B8 Received: by smtp52.i.mail.ru with esmtpa (envelope-from ) id 1p0fLu-0006PB-Az; Thu, 01 Dec 2022 11:55:30 +0300 Date: Thu, 1 Dec 2022 11:52:18 +0300 To: Maxim Kokryashkin Message-ID: References: <20221028092638.11506-1-max.kokryashkin@gmail.com> <20221028092638.11506-9-max.kokryashkin@gmail.com> <1669814478.236264054@f547.i.mail.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1669814478.236264054@f547.i.mail.ru> X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD9F70D9A593BA47E2A8FC9DFB589E7951389C2999C6E40C397182A05F538085040F91793C52C02343525732CBB3BF8DA044CC8899B83D84F7ED93353B83006181B X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE79FF7180C05A1FF7CEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637DD81BB19E5DE3F6B8638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D806A10EA52328CD2AD4C588C669D324AD117882F4460429724CE54428C33FAD305F5C1EE8F4F765FC8883BAB8B32E402CA471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F44604297287769387670735200AC5B80A05675ACDCB629EEF1311BF91D2E47CDBA5A96583BA9C0B312567BB2376E601842F6C81A19E625A9149C048EED76C6ED7039589DECAA9C333723BB66AD8FC6C240DEA7642DBF02ECDB25306B2B78CF848AE20165D0A6AB1C7CE11FEE367F1C1C3ABB44F3A03F1AB874ED89028C4224003CC836476E2F48590F00D11D6E2021AF6380DFAD1A18204E546F3947CB11811A4A51E3B096D1867E19FE1407959CC434672EE6371089D37D7C0E48F6C8AA50765F79006373AFABB501D265F08EFF80C71ABB335746BA297DBC24807EABDAD6C7F3747799A X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34BD150993ED26DDF4E060017920AF787DC0A52651396070611DC1A0E226B441BE81111A5F28DE12541D7E09C32AA3244C59C33DA22282BBCF9DA3F5C882E703B88580396430872480927AC6DF5659F194 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojWg9qwXN3O9URrHAymr8BFw== X-Mailru-Sender: F6248FDC0389C5118060C76C4E47A9E011090A3B70C9710F55A6C2CAA3CDCF7CB7CBEF92542CD7C88B0A2698F12F5C9EC77752E0C033A69E86920BD37369036789A8C6A0E60D2BB63A5DB60FBEB33A8A0DA7A0AF5A3A8387 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit v4 8/8] OSX/ARM64: Fix external unwinding. 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: Sergey Kaplun via Tarantool-patches Reply-To: Sergey Kaplun Cc: Maksim Kokryashkin , tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Hi, thanks for the explanations! LGTM, then. On 30.11.22, Maxim Kokryashkin wrote: > > Hi! > Thanks for the review! >   > >  > >>Hi, Maksim! > >> > >>Thanks for the patch! > >> > >>LGTM, but I have a bunch of questions to clarify it. > >> > >>On 28.10.22, Maksim Kokryashkin wrote: > >>> Contributed by Edmund Kapusniak. For more info, > >>> see #698 and #757. > >>> > >>> (cherry picked from commit c38747b626b978555324504ec29a110f6b04902f) > >>> > >>> To allow compiler generate compact unwind info generation > >>> for Mach-O, fp must point to the saved fp, and the frame > >>> must be specified relative to fp+16. > >> > >>Is there any link to documentation or source code to inspect this > >>behaviour? > >Unfortunately, there are no official docs for that. However, there is > >a community effort to create one here[1]. Also, this header file from > >the Apple’s sources is quite useful. Added both of them to commit > >message for those who will get the masculine urge to dive into this. Meh, not much info about it in the mentioned doc. I suppose that aarch64 ABI requires to save fp and lr by analog with arm arch. See the following comment for arm (unfortunately, there is no such comment for aarch64). https://github.com/gcc-mirror/gcc/blob/master/gcc/config/arm/arm.h#L812 But I'm still struggling to find some relative docs about it. > >> > >>> ELF unwind info has > >>> been updated to also use fp+16 rather than sp+CFRAME_SIZE. > >> > >>> Offset to pointer to personality routine specified as @GOT-. rather > >>> than @GOTPCREL. > >> > >>Does it mean that we use incorrect encoded offset (I see encoding for > >>offset is still the same) for our personality routine? > >>If so, maybe the other changes are just refactoring? > >No, that is not correct. Offset has changed, because any  > >`func@GOT` expression is translated into offset. > >Moreover, I doubt it is possible to fill in offset to GOT by hand. > >What goes after the pointer to the personality routine > >is LSDA, according to the Apple’s source[2]. @GOTPCREL and @GOT > >are interchangeable most of the time, except for the cases when signed > >32-bit RIP references are not enough for you, which seems to be the case here. So, GOTPCREL allows you to "recalculate" reference to a function to 32-bit value and use it? Do I get the idea correct? > >> > >>> > >>> Re-enabled LUAJIT_UNWIND_EXTERNAL by default on OSX. > >>> > >>> Maxim Kokryashkin: > >>> * added the description for the issue and the test > >>> > >>> Resolves tarantool/tarantool#6096 > >>> Part of tarantool/tarantool#7230 > >>> --- > >[1]:  https://faultlore.com/blah/compact-unwinding/#unwinding-tables-dwarf-cfi > >[2]:  https://opensource.apple.com/source/libunwind/libunwind-35.3/include/mach-o/compact_unwind_encoding.h > >-- > >Best regards, > >Maxim Kokryashkin > >  -- Best regards, Sergey Kaplun