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 3ED05A4CE37; Mon, 18 Mar 2024 16:45:03 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 3ED05A4CE37 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1710769503; bh=doVPwCQ2/YJkGKfsohLisvAkJAATrv5/hBkaJJDiAR4=; 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=VcI7Iaalv+HXYLkOzozGrbCb/BACY0N8/bFt3cnKvxVxaJiPNwljca4KK2mAivJSe IBQGvgfyaTMA34Aa4Z5v5YFs8mKe45f40T3qSYts05u7UFELnzOtuMKXTvckRTJr4L JW9/63BY5N5F5BaVWpUhCWr6hBwieRnYb8CofhRc= Received: from smtp37.i.mail.ru (smtp37.i.mail.ru [95.163.41.78]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id AB66CA4CE33 for ; Mon, 18 Mar 2024 16:45:01 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org AB66CA4CE33 Received: by smtp37.i.mail.ru with esmtpa (envelope-from ) id 1rmDIS-000000065Iu-2GNO; Mon, 18 Mar 2024 16:45:00 +0300 Date: Mon, 18 Mar 2024 16:44:59 +0300 To: Sergey Bronnikov Message-ID: <5fprjxcjy4f4ugliudwqmc5pu4xbv53vdir34hl6gu2vtgjtfe@fqtnkjrf4z4l> References: <1fe5f0ebbd285bd58849be28548bcc8c8c68c2a1.1710416150.git.sergeyb@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1fe5f0ebbd285bd58849be28548bcc8c8c68c2a1.1710416150.git.sergeyb@tarantool.org> X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD987C0EE6E7F0A597D77DAD88DB19A0E871D0E83388B9166C4182A05F53808504043062675D3488C852EB5D77EF37489D102B9FFA7A32F67E4C1C4ECD1B7FED573234C7E1550D41240 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7E50EC9128971FD6EEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006371758572763D318798638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8E227215CC8DE608FCCFD84B7634FF5FA9B098FB6770419A9CC7F00164DA146DAFE8445B8C89999728AA50765F7900637F3E38EE449E3E2AE389733CBF5DBD5E9C8A9BA7A39EFB766F5D81C698A659EA7CC7F00164DA146DA9985D098DBDEAEC8062BEEFFB5F8EA3EF6B57BC7E6449061A352F6E88A58FB86F5D81C698A659EA73AA81AA40904B5D9A18204E546F3947CF8BD4E506CFA3D88C0837EA9F3D197644AD6D5ED66289B523666184CF4C3C14F6136E347CC761E07725E5C173C3A84C3D8561A2FEC730ACEBA3038C0950A5D36B5C8C57E37DE458B330BD67F2E7D9AF16D1867E19FE14079C09775C1D3CA48CFE478A468B35FE7671DD303D21008E298D5E8D9A59859A8B6B372FE9A2E580EFC725E5C173C3A84C3BE90F13D913F449135872C767BF85DA2F004C90652538430E4A6367B16DE6309 X-C1DE0DAB: 0D63561A33F958A5C49168B9DF380F725002B1117B3ED69657D8618B8C12B767E20DC3F561CE4150823CB91A9FED034534781492E4B8EEADAE4FDBF11360AC9BBDAD6C7F3747799A X-C8649E89: 1C3962B70DF3F0ADE00A9FD3E00BEEDF3FED46C3ACD6F73ED3581295AF09D3DF87807E0823442EA2ED31085941D9CD0AF7F820E7B07EA4CF4DECB4F26E928EAB22C5803DD6C35BD15BC62C14F6CE771F6128F91AD50E7A52614F3626C4CAF433E1E51F4E63A658347CC91D6563D0D520488DACBCFB79910341C7013C145A1A67C226CC413062362A913E6812662D5F2A54F6898A6FDCBDC72A617DFBE5FEC2C6383653B6C8D9AE0FD16FCAA6493B703A X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojKEbXFKsUiMmdnUBX/tshRQ== X-Mailru-Sender: 520A125C2F17F0B1A9638AD358559B592D48FA25A27799092EB5D77EF37489D102B9FFA7A32F67E4E2527C969975515CFF9FCECFB8D89CB6C77752E0C033A69E235A20A81F3B0E39AB3C5F247CB2F7F93A5DB60FBEB33A8A0DA7A0AF5A3A8387 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit 2/2] OSX/iOS/ARM64: Fix bytecode embedding in Mach-O object file. 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: Maxim Kokryashkin via Tarantool-patches Reply-To: Maxim Kokryashkin Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Hi, Sergey! Thanks for the patch! Please consider my comments below. On Thu, Mar 14, 2024 at 02:39:51PM +0300, Sergey Bronnikov wrote: > From: sergeyb@tarantool.org > > Thanks to Carlo Cabrera. > > (cherry picked from commit b98b37231bd2dcb79e10b0f974cefd91eb0d7b3a) > > Mach-O FAR object files generated by LuaJIT for arm64 had an incorrect Typo: s/FAR/FAT/ Typo: s/arm64/ARM64/ > format because FFI structure used for generation was wrong: Typo: s/FFI/The FFI/ > `mach_fat_obj` instead of `mach_fat_obj_64`. > > Sergey Bronnikov: > * added the description and a test for the problem Typo: s/a test/the test/ > > Part of tarantool/tarantool#9595 > --- > src/jit/bcsave.lua | 14 +++++++++++++- > ...-fix_generation_of_mach-o_object_files.test.lua | 4 +++- > 2 files changed, 16 insertions(+), 2 deletions(-) > > diff --git a/src/jit/bcsave.lua b/src/jit/bcsave.lua > index 7aec1555..069cf1a3 100644 > --- a/src/jit/bcsave.lua > +++ b/src/jit/bcsave.lua > @@ -491,6 +491,18 @@ typedef struct { > mach_nlist sym_entry; > uint8_t space[4096]; > } mach_fat_obj; > +typedef struct { > + mach_fat_header fat; > + mach_fat_arch fat_arch[2]; > + struct { > + mach_header_64 hdr; > + mach_segment_command_64 seg; > + mach_section_64 sec; > + mach_symtab_command sym; > + } arch[2]; > + mach_nlist_64 sym_entry; > + uint8_t space[4096]; > +} mach_fat_obj_64; > ]] > local symname = '_'..LJBC_PREFIX..ctx.modname > local isfat, is64, align, mobj = false, false, 4, "mach_obj" > @@ -499,7 +511,7 @@ typedef struct { > elseif ctx.arch == "arm" then > isfat, mobj = true, "mach_fat_obj" > elseif ctx.arch == "arm64" then > - is64, align, isfat, mobj = true, 8, true, "mach_fat_obj" > + is64, align, isfat, mobj = true, 8, true, "mach_fat_obj_64" > else > check(ctx.arch == "x86", "unsupported architecture for OSX") > end > diff --git a/test/tarantool-tests/lj-865-fix_generation_of_mach-o_object_files.test.lua b/test/tarantool-tests/lj-865-fix_generation_of_mach-o_object_files.test.lua > index 0519e134..0a11f163 100644 > --- a/test/tarantool-tests/lj-865-fix_generation_of_mach-o_object_files.test.lua > +++ b/test/tarantool-tests/lj-865-fix_generation_of_mach-o_object_files.test.lua > @@ -7,7 +7,7 @@ local test = tap.test('lj-865-fix_generation_of_mach-o_object_files'):skipcond({ > ['Test uses exotic type of loaders (see #9671)'] = _TARANTOOL, > }) > > -test:plan(4) > +test:plan(8) > > -- Test creates an object file in Mach-O format with LuaJIT bytecode > -- and checks validness of the object file fields. > @@ -267,5 +267,7 @@ end > > -- ARM > build_and_check_mach_o(false) > +-- ARM64 > +build_and_check_mach_o(true) These `true/false` should be explained as platform toggle. An even better solution would be to pass the platform name explicitly. > > test:done(true) > -- > 2.34.1 >