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 719B16F3C8; Tue, 4 Oct 2022 19:05:49 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 719B16F3C8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1664899549; bh=WflEfqcspHDN4tTPwNf/n26p27FjHMEjyJp7pBNKG3s=; h=In-Reply-To:Date:References:To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=RkVokMdE+wMEhFQSZj8Ih1RqKBgccZBoHNO3qgnDMEx7Q38s/aAKAg7ywuBGXJ1Vc JdEpnuCvoLS/dX8YXIqSEInrxrFVeulTjLO9VAQVggPZybnjNxU4dSpIy0hgOW3ZJZ lp12cH22vjL/GX5gdtSEKqBENV0PxUxss3PvJ5I4= Received: from smtp48.i.mail.ru (smtp48.i.mail.ru [94.100.177.108]) (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 B604A6F3C8 for ; Tue, 4 Oct 2022 19:05:47 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org B604A6F3C8 Received: by smtp48.i.mail.ru with esmtpa (envelope-from ) id 1ofkQU-0006Rj-Qv; Tue, 04 Oct 2022 19:05:47 +0300 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) In-Reply-To: <89c957b12c29392821dfbeee284da3cda93700d1.1664207262.git.max.kokryashkin@gmail.com> Date: Tue, 4 Oct 2022 19:05:46 +0300 Content-Transfer-Encoding: quoted-printable Message-Id: References: <89c957b12c29392821dfbeee284da3cda93700d1.1664207262.git.max.kokryashkin@gmail.com> To: Maksim Kokryashkin X-Mailer: Apple Mail (2.3696.120.41.1.1) X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD9EA63AAA3C7549E8E144CDE0E140B4DB600E5C3CE52A5591A00894C459B0CD1B9D7963F78F35E9DF21A86DA8F10190FEAFE53AD2CF6EE04E6AE9C07854FFBA0A0 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE70240200614025CBBC2099A533E45F2D0395957E7521B51C2CFCAF695D4D8E9FCEA1F7E6F0F101C6778DA827A17800CE7180ADF26E81B0C77EA1F7E6F0F101C6723150C8DA25C47586E58E00D9D99D84E1BDDB23E98D2D38B8859CA687ABA27BA52011CB418B81878F1741C1F2D0E016DCC7F00164DA146DAFE8445B8C89999728AA50765F79006378022902977F5E319389733CBF5DBD5E9C8A9BA7A39EFB766F5D81C698A659EA7CC7F00164DA146DA9985D098DBDEAEC8B861051D4BA689FCF6B57BC7E6449061A352F6E88A58FB86F5D81C698A659EA73AA81AA40904B5D9A18204E546F3947C50C865FA6708688F2D242C3BD2E3F4C64AD6D5ED66289B52698AB9A7B718F8C46E0066C2D8992A16725E5C173C3A84C3BFFF513DCDB8CC61BA3038C0950A5D36B5C8C57E37DE458B330BD67F2E7D9AF16D1867E19FE14079C09775C1D3CA48CF17B107DEF921CE791DD303D21008E298D5E8D9A59859A8B6B372FE9A2E580EFC725E5C173C3A84C39472471D10B198B935872C767BF85DA2F004C90652538430E4A6367B16DE6309 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34738A88CA0C70A55889E0C220547F717E1802683CC1E51745E82FF07A6E0C4343A521498E698F0D071D7E09C32AA3244C36FBB6E4858327475CF887D779E70F9E60759606DA2E136AFACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojoN03fZs/02P1BYlHDuoPsw== X-Mailru-Sender: 5AA3D5B9D8C486465A7E7C48E78B605DBE76E447E87578B341F5FE71FE28761ACA71892AC981DD5F60D8632BEC246C7D55B4A2144138A8805FC805B5969CB4993EE16157CC7DAB4272D6B4FCE48DF648AE208404248635DF X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit 6/6] 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: sergos via Tarantool-patches Reply-To: sergos Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Hi! Thanks for the patch! Ok, so you=E2=80=99re re-enable the generation back. Then in 5/6 message = I would like to see a mention that the disabling is just for the history match, will be = superseded with the following (this) patch. Also, I did=E2=80=99t get the point behind the test: what will be it=E2=80= =99s behavior with unwind info generation turned off - which will be the behavior of luajit before = this patch? Regards, Sergos > On 26 Sep 2022, at 18:55, Maksim Kokryashkin = wrote: >=20 > Contributed by Edmund Kapusniak. For more info, > see LuaJIT/LuaJIT#698 and LuaJIT/LuaJIT#757. >=20 > (cherry picked from commit c38747b626b978555324504ec29a110f6b04902f) >=20 > 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. ELF unwind info has > been updated to also use fp+16 rather than sp+CFRAME_SIZE. >=20 > Offset to pointer to personality routine specified as @GOT-. rather > than @GOTPCREL. >=20 > Re-enabled LUAJIT_UNWIND_EXTERNAL by default on OSX. >=20 > Maxim Kokryashkin: > * added the description for the issue and the test >=20 > Resolves tarantool/tarantool#6096 > Needed for tarantool/tarantool#7230 > --- > cmake/SetTargetFlags.cmake | 4 +- > src/Makefile.original | 5 +- > src/vm_arm64.dasc | 89 ++++++++----------- > ...-6096-external-unwinding-on-arm64.test.lua | 13 +++ > 4 files changed, 54 insertions(+), 57 deletions(-) > create mode 100644 = test/tarantool-tests/gh-6096-external-unwinding-on-arm64.test.lua >=20 > diff --git a/cmake/SetTargetFlags.cmake b/cmake/SetTargetFlags.cmake > index d99e1f9a..a5a3407f 100644 > --- a/cmake/SetTargetFlags.cmake > +++ b/cmake/SetTargetFlags.cmake > @@ -16,9 +16,7 @@ LuaJITTestArch(TESTARCH "${TARGET_C_FLAGS}") > LuaJITArch(LUAJIT_ARCH "${TESTARCH}") >=20 > if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") > - if(NOT LUAJIT_ARCH STREQUAL "arm64") > - AppendFlags(TARGET_C_FLAGS -DLUAJIT_UNWIND_EXTERNAL) > - endif() > + AppendFlags(TARGET_C_FLAGS -DLUAJIT_UNWIND_EXTERNAL) > else() > string(FIND ${TARGET_C_FLAGS} "LJ_NO_UNWIND 1" UNWIND_POS) > if(UNWIND_POS EQUAL -1) > diff --git a/src/Makefile.original b/src/Makefile.original > index 5826a56a..d1373b40 100644 > --- a/src/Makefile.original > +++ b/src/Makefile.original > @@ -325,10 +325,7 @@ ifeq (Darwin,$(TARGET_SYS)) > export MACOSX_DEPLOYMENT_TARGET=3D10.4 > endif > TARGET_STRIP+=3D -x > - # Ext. unwinding is broken on OSX/ARM64 until someone finds a fix. = See #698. > - ifneq (arm64,$(TARGET_LJARCH)) > - TARGET_XCFLAGS+=3D -DLUAJIT_UNWIND_EXTERNAL > - endif > + TARGET_XCFLAGS+=3D -DLUAJIT_UNWIND_EXTERNAL > TARGET_XSHLDFLAGS=3D -dynamiclib -single_module -undefined = dynamic_lookup -fPIC > TARGET_DYNXLDOPTS=3D > TARGET_XSHLDFLAGS+=3D -install_name $(TARGET_DYLIBPATH) = -compatibility_version $(MAJVER).$(MINVER) -current_version = $(MAJVER).$(MINVER).$(RELVER) > diff --git a/src/vm_arm64.dasc b/src/vm_arm64.dasc > index ccfa72bd..f517a808 100644 > --- a/src/vm_arm64.dasc > +++ b/src/vm_arm64.dasc > @@ -81,8 +81,7 @@ > | > |.define CFRAME_SPACE, 208 > |//----- 16 byte aligned, <-- sp entering interpreter > -|.define SAVE_LR, [sp, #200] > -|.define SAVE_FP, [sp, #192] > +|.define SAVE_FP_LR_, 192 > |.define SAVE_GPR_, 112 // 112+10*8: 64 bit GPR saves > |.define SAVE_FPR_, 48 // 48+8*8: 64 bit FPR saves > |// Unused [sp, #44] // 32 bit values > @@ -108,8 +107,8 @@ > | > |.macro saveregs > | sub sp, sp, # CFRAME_SPACE > -| stp fp, lr, SAVE_FP > -| add fp, sp, #0 > +| stp fp, lr, [sp, # SAVE_FP_LR_] > +| add fp, sp, # SAVE_FP_LR_ > | stp x20, x19, [sp, # SAVE_GPR_+(27-19)*8] > | save_ 21, 22, 8, 9 > | save_ 23, 24, 10, 11 > @@ -122,7 +121,7 @@ > | rest_ 23, 24, 10, 11 > | rest_ 25, 26, 12, 13 > | rest_ 27, 28, 14, 15 > -| ldp fp, lr, SAVE_FP > +| ldp fp, lr, [sp, # SAVE_FP_LR_] > | add sp, sp, # CFRAME_SPACE > |.endmacro > | > @@ -504,8 +503,9 @@ static void build_subroutines(BuildCtx *ctx) > | ldr GL, L->glref // Setup pointer to = global state. > | mov BASE, CARG2 > | str CARG1, SAVE_PC // Any value outside of bytecode = is ok. > - | str RC, SAVE_CFRAME > - | str fp, L->cframe // Add our C frame to = cframe chain. > + | add TMP0, sp, #0 > + | str RC, SAVE_CFRAME > + | str TMP0, L->cframe // Add our C frame to cframe = chain. > | > |3: // Entry point for vm_cpcall/vm_resume (BASE =3D base, PC =3D = ftype). > | str L, GL->cur_L > @@ -540,8 +540,9 @@ static void build_subroutines(BuildCtx *ctx) > | sub RA, RA, RB // Compute -savestack(L, = L->top). > | str RAw, SAVE_NRES // Neg. delta means cframe w/o = frame. > | str wzr, SAVE_ERRF // No error function. > - | str RC, SAVE_CFRAME > - | str fp, L->cframe // Add our C frame to = cframe chain. > + | add TMP0, sp, #0 > + | str RC, SAVE_CFRAME > + | str TMP0, L->cframe // Add our C frame to cframe = chain. > | str L, GL->cur_L > | blr CARG4 // (lua_State *L, lua_CFunction = func, void *ud) > | mov BASE, CRET1 > @@ -2129,14 +2130,14 @@ static void build_subroutines(BuildCtx *ctx) > | .type CCSTATE, CCallState, x19 > | stp x20, CCSTATE, [sp, #-32]! > | stp fp, lr, [sp, #16] > - | add fp, sp, #0 > + | add fp, sp, #16 > | mov CCSTATE, x0 > | ldr TMP0w, CCSTATE:x0->spadj > | ldrb TMP1w, CCSTATE->nsp > | add TMP2, CCSTATE, #offsetof(CCallState, stack) > | subs TMP1, TMP1, #1 > | ldr TMP3, CCSTATE->func > - | sub sp, fp, TMP0 > + | sub sp, sp, TMP0 > | bmi >2 > |1: // Copy stack slots > | ldr TMP0, [TMP2, TMP1, lsl #3] > @@ -2154,7 +2155,7 @@ static void build_subroutines(BuildCtx *ctx) > | ldp d6, d7, CCSTATE->fpr[6] > | ldr x8, CCSTATE->retp > | blr TMP3 > - | mov sp, fp > + | sub sp, fp, #16 > | stp x0, x1, CCSTATE->gpr[0] > | stp d0, d1, CCSTATE->fpr[0] > | stp d2, d3, CCSTATE->fpr[2] > @@ -3879,7 +3880,7 @@ static void emit_asm_debug(BuildCtx *ctx) > "\t.uleb128 0x1\n" > "\t.sleb128 -8\n" > "\t.byte 30\n" /* Return address is in = lr. */ > - "\t.byte 0xc\n\t.uleb128 31\n\t.uleb128 0\n" /* def_cfa sp */ > + "\t.byte 0xc\n\t.uleb128 29\n\t.uleb128 16\n" /* def_cfa fp 16 = */ > "\t.align 3\n" > ".LECIE0:\n\n"); > fprintf(ctx->fp, > @@ -3889,10 +3890,9 @@ static void emit_asm_debug(BuildCtx *ctx) > "\t.long .Lframe0\n" > "\t.quad .Lbegin\n" > "\t.quad %d\n" > - "\t.byte 0xe\n\t.uleb128 %d\n" /* def_cfa_offset */ > "\t.byte 0x9e\n\t.uleb128 1\n" /* offset lr */ > "\t.byte 0x9d\n\t.uleb128 2\n", /* offset fp */ > - fcofs, CFRAME_SIZE); > + fcofs); > for (i =3D 19; i <=3D 28; i++) /* offset x19-x28 */ > fprintf(ctx->fp, "\t.byte 0x%x\n\t.uleb128 %d\n", 0x80+i, = i+(3-19)); > for (i =3D 8; i <=3D 15; i++) /* offset d8-d15 */ > @@ -3909,12 +3909,10 @@ static void emit_asm_debug(BuildCtx *ctx) > "\t.long .Lframe0\n" > "\t.quad lj_vm_ffi_call\n" > "\t.quad %d\n" > - "\t.byte 0xe\n\t.uleb128 32\n" /* def_cfa_offset */ > "\t.byte 0x9e\n\t.uleb128 1\n" /* offset lr */ > "\t.byte 0x9d\n\t.uleb128 2\n" /* offset fp */ > "\t.byte 0x93\n\t.uleb128 3\n" /* offset x19 */ > "\t.byte 0x94\n\t.uleb128 4\n" /* offset x20 */ > - "\t.byte 0xd\n\t.uleb128 0x1d\n" /* def_cfa_register fp = */ > "\t.align 3\n" > ".LEFDE1:\n\n", (int)ctx->codesz - fcofs); > #endif > @@ -3933,7 +3931,7 @@ static void emit_asm_debug(BuildCtx *ctx) > "\t.byte 0x1b\n" /* pcrel|sdata4 */ > "\t.long lj_err_unwind_dwarf-.\n" > "\t.byte 0x1b\n" /* pcrel|sdata4 */ > - "\t.byte 0xc\n\t.uleb128 31\n\t.uleb128 0\n" /* def_cfa sp */ > + "\t.byte 0xc\n\t.uleb128 29\n\t.uleb128 16\n" /* def_cfa fp 16 = */ > "\t.align 3\n" > ".LECIE1:\n\n"); > fprintf(ctx->fp, > @@ -3944,10 +3942,9 @@ static void emit_asm_debug(BuildCtx *ctx) > "\t.long .Lbegin-.\n" > "\t.long %d\n" > "\t.uleb128 0\n" /* augmentation length = */ > - "\t.byte 0xe\n\t.uleb128 %d\n" /* def_cfa_offset */ > "\t.byte 0x9e\n\t.uleb128 1\n" /* offset lr */ > "\t.byte 0x9d\n\t.uleb128 2\n", /* offset fp */ > - fcofs, CFRAME_SIZE); > + fcofs); > for (i =3D 19; i <=3D 28; i++) /* offset x19-x28 */ > fprintf(ctx->fp, "\t.byte 0x%x\n\t.uleb128 %d\n", 0x80+i, = i+(3-19)); > for (i =3D 8; i <=3D 15; i++) /* offset d8-d15 */ > @@ -3969,7 +3966,7 @@ static void emit_asm_debug(BuildCtx *ctx) > "\t.byte 30\n" /* Return address is in = lr. */ > "\t.uleb128 1\n" /* augmentation length = */ > "\t.byte 0x1b\n" /* pcrel|sdata4 */ > - "\t.byte 0xc\n\t.uleb128 31\n\t.uleb128 0\n" /* def_cfa sp */ > + "\t.byte 0xc\n\t.uleb128 29\n\t.uleb128 16\n" /* def_cfa fp 16 = */ > "\t.align 3\n" > ".LECIE2:\n\n"); > fprintf(ctx->fp, > @@ -3980,18 +3977,15 @@ static void emit_asm_debug(BuildCtx *ctx) > "\t.long lj_vm_ffi_call-.\n" > "\t.long %d\n" > "\t.uleb128 0\n" /* augmentation length = */ > - "\t.byte 0xe\n\t.uleb128 32\n" /* def_cfa_offset */ > "\t.byte 0x9e\n\t.uleb128 1\n" /* offset lr */ > "\t.byte 0x9d\n\t.uleb128 2\n" /* offset fp */ > "\t.byte 0x93\n\t.uleb128 3\n" /* offset x19 */ > "\t.byte 0x94\n\t.uleb128 4\n" /* offset x20 */ > - "\t.byte 0xd\n\t.uleb128 0x1d\n" /* def_cfa_register fp = */ > "\t.align 3\n" > ".LEFDE3:\n\n", (int)ctx->codesz - fcofs); > #endif > break; > - /* Disabled until someone finds a fix. See #698. */ > -#if !LJ_NO_UNWIND && 0 > +#if !LJ_NO_UNWIND > case BUILD_machasm: { > #if LJ_HASFFI > int fcsize =3D 0; > @@ -4006,14 +4000,14 @@ static void emit_asm_debug(BuildCtx *ctx) > "\t.long 0\n" > "\t.byte 0x1\n" > "\t.ascii \"zPR\\0\"\n" > - "\t.byte 0x1\n" > - "\t.byte 128-8\n" > + "\t.uleb128 0x1\n" > + "\t.sleb128 -8\n" > "\t.byte 30\n" /* Return address is in = lr. */ > - "\t.byte 6\n" /* augmentation length = */ > + "\t.uleb128 6\n" /* augmentation length = */ > "\t.byte 0x9b\n" /* indirect|pcrel|sdata4 = */ > - "\t.long _lj_err_unwind_dwarf@GOTPCREL\n" > + "\t.long _lj_err_unwind_dwarf@GOT-.\n" > "\t.byte 0x1b\n" /* pcrel|sdata4 */ > - "\t.byte 0xc\n\t.byte 31\n\t.byte 0\n" /* def_cfa sp */ > + "\t.byte 0xc\n\t.uleb128 29\n\t.uleb128 16\n" /* def_cfa fp 16 = */ > "\t.align 3\n" > "LECIEX:\n\n"); > for (j =3D 0; j < ctx->nsym; j++) { > @@ -4024,7 +4018,6 @@ static void emit_asm_debug(BuildCtx *ctx) > if (!strcmp(name, "_lj_vm_ffi_call")) { fcsize =3D size; = continue; } > #endif > fprintf(ctx->fp, > - "%s.eh:\n" > "LSFDE%d:\n" > "\t.set L$set$%d,LEFDE%d-LASFDE%d\n" > "\t.long L$set$%d\n" > @@ -4032,15 +4025,14 @@ static void emit_asm_debug(BuildCtx *ctx) > "\t.long LASFDE%d-EH_frame1\n" > "\t.long %s-.\n" > "\t.long %d\n" > - "\t.byte 0\n" /* augmentation length = */ > - "\t.byte 0xe\n\t.byte %d\n\t.byte 1\n" /* def_cfa_offset */ > - "\t.byte 0x9e\n\t.byte 1\n" /* offset lr */ > - "\t.byte 0x9d\n\t.byte 2\n", /* offset fp */ > - name, j, j, j, j, j, j, j, name, size, CFRAME_SIZE); > + "\t.uleb128 0\n" /* augmentation length = */ > + "\t.byte 0x9e\n\t.uleb128 1\n" /* offset lr */ > + "\t.byte 0x9d\n\t.uleb128 2\n", /* offset fp */ > + j, j, j, j, j, j, j, name, size); > for (i =3D 19; i <=3D 28; i++) /* offset x19-x28 */ > - fprintf(ctx->fp, "\t.byte 0x%x\n\t.byte %d\n", 0x80+i, = i+(3-19)); > + fprintf(ctx->fp, "\t.byte 0x%x\n\t.uleb128 %d\n", 0x80+i, = i+(3-19)); > for (i =3D 8; i <=3D 15; i++) /* offset d8-d15 */ > - fprintf(ctx->fp, "\t.byte 5\n\t.byte 0x%x\n\t.byte %d\n", > + fprintf(ctx->fp, "\t.byte 5\n\t.uleb128 0x%x\n\t.uleb128 %d\n", > 64+i, i+(3+(28-19+1)-8)); > fprintf(ctx->fp, > "\t.align 3\n" > @@ -4056,16 +4048,15 @@ static void emit_asm_debug(BuildCtx *ctx) > "\t.long 0\n" > "\t.byte 0x1\n" > "\t.ascii \"zR\\0\"\n" > - "\t.byte 0x1\n" > - "\t.byte 128-8\n" > + "\t.uleb128 0x1\n" > + "\t.sleb128 -8\n" > "\t.byte 30\n" /* Return address is in = lr. */ > - "\t.byte 1\n" /* augmentation length = */ > + "\t.uleb128 1\n" /* augmentation length = */ > "\t.byte 0x1b\n" /* pcrel|sdata4 */ > - "\t.byte 0xc\n\t.byte 31\n\t.byte 0\n" /* def_cfa sp */ > + "\t.byte 0xc\n\t.uleb128 29\n\t.uleb128 16\n" /* def_cfa fp 16 = */ > "\t.align 3\n" > "LECIEY:\n\n"); > fprintf(ctx->fp, > - "_lj_vm_ffi_call.eh:\n" > "LSFDEY:\n" > "\t.set L$set$yy,LEFDEY-LASFDEY\n" > "\t.long L$set$yy\n" > @@ -4073,13 +4064,11 @@ static void emit_asm_debug(BuildCtx *ctx) > "\t.long LASFDEY-EH_frame2\n" > "\t.long _lj_vm_ffi_call-.\n" > "\t.long %d\n" > - "\t.byte 0\n" /* augmentation length = */ > - "\t.byte 0xe\n\t.byte 32\n" /* def_cfa_offset */ > - "\t.byte 0x9e\n\t.byte 1\n" /* offset lr */ > - "\t.byte 0x9d\n\t.byte 2\n" /* offset fp */ > - "\t.byte 0x93\n\t.byte 3\n" /* offset x19 */ > - "\t.byte 0x94\n\t.byte 4\n" /* offset x20 */ > - "\t.byte 0xd\n\t.uleb128 0x1d\n" /* def_cfa_register fp = */ > + "\t.uleb128 0\n" /* augmentation length = */ > + "\t.byte 0x9e\n\t.uleb128 1\n" /* offset lr */ > + "\t.byte 0x9d\n\t.uleb128 2\n" /* offset fp */ > + "\t.byte 0x93\n\t.uleb128 3\n" /* offset x19 */ > + "\t.byte 0x94\n\t.uleb128 4\n" /* offset x20 */ > "\t.align 3\n" > "LEFDEY:\n\n", fcsize); > } > diff --git = a/test/tarantool-tests/gh-6096-external-unwinding-on-arm64.test.lua = b/test/tarantool-tests/gh-6096-external-unwinding-on-arm64.test.lua > new file mode 100644 > index 00000000..cdeea441 > --- /dev/null > +++ = b/test/tarantool-tests/gh-6096-external-unwinding-on-arm64.test.lua > @@ -0,0 +1,13 @@ > +local tap =3D require('tap') > + > +-- Test file to check correctnes of external unwinding > +-- in LuaJIT. > +-- See also https://github.com/LuaJIT/LuaJIT/issues/698, > +-- https://github.com/LuaJIT/LuaJIT/pull/757. > +local test =3D tap.test('gh-6096-external-unwinding-on-arm64') > +test:plan(1) > + > +local res =3D pcall(require, 'not-existing-module') > +test:ok(res =3D=3D false, 'successful unwinding in pcall') > + > +os.exit(test:check() and 0 or 1) > --=20 > 2.32.1 (Apple Git-133) >=20