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 65D929E7E58; Tue, 19 Mar 2024 11:22:24 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 65D929E7E58 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1710836544; bh=yjD7pkoFITEMHdI9KLzKuByHftQpgX+Lh+64upa+5aY=; 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=s6PVhRWJ1Zbgg6Uh7PwIv6tBzf94H64SebCwcCxLahkUFPsz2fJCVGqki//HwLBdq 72BYgWrJ8cy1wOYKQpCXnLMxvwtQMybmtMHEGcZoYNeN9eUHm9UKLIufQgIraY9KEP lstYIvAS7h8Dl5YNeA8IH8mpeFGq4ooqKz5AJsxU= Received: from smtp38.i.mail.ru (smtp38.i.mail.ru [95.163.41.79]) (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 5383C6B9F21 for ; Tue, 19 Mar 2024 11:22:23 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 5383C6B9F21 Received: by smtp38.i.mail.ru with esmtpa (envelope-from ) id 1rmUjk-0000000Gj9M-3nKd; Tue, 19 Mar 2024 11:22:22 +0300 Message-ID: Date: Tue, 19 Mar 2024 11:22:20 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: Maxim Kokryashkin , Sergey Bronnikov References: <1fe5f0ebbd285bd58849be28548bcc8c8c68c2a1.1710416150.git.sergeyb@tarantool.org> <5fprjxcjy4f4ugliudwqmc5pu4xbv53vdir34hl6gu2vtgjtfe@fqtnkjrf4z4l> In-Reply-To: <5fprjxcjy4f4ugliudwqmc5pu4xbv53vdir34hl6gu2vtgjtfe@fqtnkjrf4z4l> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD987C0EE6E7F0A597DDF776407DD463AED7AC1984F64828CE8182A05F5380850409194FECFC04A6F99479CDAE959BF64245E1408399429E73512676347BA7B58623EAE9E3EF2B3B1F1 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7956F10FFCC7409BAEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637F97367C191A19EB28638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8D316006D7913F988B8CAF68030C87AAF11DB7E59254D65B8CC7F00164DA146DAFE8445B8C89999728AA50765F7900637CAEE156C82D3D7D9389733CBF5DBD5E9C8A9BA7A39EFB766F5D81C698A659EA7CC7F00164DA146DA9985D098DBDEAEC8062BEEFFB5F8EA3EF6B57BC7E6449061A352F6E88A58FB86F5D81C698A659EA73AA81AA40904B5D9A18204E546F3947C4E7D9683544204AFBA3038C0950A5D36C8A9BA7A39EFB766D91E3A1F190DE8FDBA3038C0950A5D36D5E8D9A59859A8B67C48477FF724415E3AA81AA40904B5D99C9F4D5AE37F343AD1F44FA8B9022EA23BBE47FD9DD3FB595F5C1EE8F4F765FC5FC25ED3FCEC3375E2021AF6380DFAD18AA50765F7900637F09814068C508CC822CA9DD8327EE4930A3850AC1BE2E735F3CCD8A865B74A75C4224003CC83647689D4C264860C145E X-C1DE0DAB: 0D63561A33F958A5CAF2E7D7EC57896E5002B1117B3ED69605CC0488A5946DAE0E58516B1639A14B823CB91A9FED034534781492E4B8EEAD14747542773C033FBDAD6C7F3747799A X-C8649E89: 1C3962B70DF3F0ADE00A9FD3E00BEEDF3FED46C3ACD6F73ED3581295AF09D3DF87807E0823442EA2ED31085941D9CD0AF7F820E7B07EA4CF1C1CF1F4DF0C81DEE8C80888A618589756F445E759644EC205B5ADACC7ECB5EB6BD4E2D2DF3D4047E1E51F4E63A65834D10DDF7866FE77A350ADDE1EDDE29B7C04DD0C35288ED20CC226CC413062362A913E6812662D5F2AB9AF64DB4688768036DF5FE9C0001AF333F2C28C22F508233FCF178C6DD14203 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojipsw8XZ5OujrSpAHT7M7XQ== X-Mailru-Sender: 520A125C2F17F0B1E52FEF5D219D614059F4136C60235FEA34DC9FA1E689480DED037EB657A555E30152A3D17938EB451EB5A0BCEC6A560B3DDE9B364B0DF289BE2DA36745F2EEB5CEBA01FB949A1F1EEAB4BC95F72C04283CDA0F3B3F5B9367 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: Sergey Bronnikov via Tarantool-patches Reply-To: Sergey Bronnikov Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Max, thanks for review. See my comments below. Changes force-pushed. On 3/18/24 16:44, Maxim Kokryashkin wrote: > 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/ Fixed. >> format because FFI structure used for generation was wrong: > Typo: s/FFI/The FFI/ Fixed. >> `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/ Fixed. >> 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. Why comment above is not sufficient? >> test:done(true) >> -- >> 2.34.1 >>