Skip to content

Commit

Permalink
ARM64: Allow building with unwinding disabled.
Browse files Browse the repository at this point in the history
(cherry-picked from commit 5677985)

Prior to this patch, the LuaJIT build with the
`-DLUAJIT_NO_UNWIND=1` option enabled failed because of linker
relocation errors related to dwarf-specific code. This patch
disables emission of the `.eh_frame` section for builds without
unwinding to solve the issue.

The `LUAJIT_NO_UNWIND` build option is added to CMakeLists.txt.
This patch adds this build flavor to our exotic builds workflow.

Maxim Kokryashkin:
* added the description for the problem

Part of tarantool/tarantool#9145
  • Loading branch information
Mike Pall authored and mkokryashkin committed Dec 11, 2023
1 parent 2ab0419 commit a468414
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,11 @@ if(LUAJIT_DISABLE_UNWIND_JIT)
AppendFlags(TARGET_C_FLAGS -DLUAJIT_DISABLE_UNWIND_JIT)
endif()

option(LUAJIT_NO_UNWIND "Disable external unwinding.")
if(LUAJIT_NO_UNWIND)
AppendFlags(TARGET_C_FLAGS -DLUAJIT_NO_UNWIND)
endif()

# Disable memory profiler.
option(LUAJIT_DISABLE_MEMPROF "LuaJIT memory profiler support" OFF)
if(LUAJIT_DISABLE_MEMPROF)
Expand Down
2 changes: 2 additions & 0 deletions src/vm_arm64.dasc
Original file line number Diff line number Diff line change
Expand Up @@ -3915,6 +3915,7 @@ static void emit_asm_debug(BuildCtx *ctx)
"\t.align 3\n"
".LEFDE1:\n\n", (int)ctx->codesz - fcofs);
#endif
#if !LJ_NO_UNWIND
fprintf(ctx->fp, "\t.section .eh_frame,\"a\",%%progbits\n");
fprintf(ctx->fp,
".Lframe1:\n"
Expand Down Expand Up @@ -3982,6 +3983,7 @@ static void emit_asm_debug(BuildCtx *ctx)
"\t.byte 0x94\n\t.uleb128 4\n" /* offset x20 */
"\t.align 3\n"
".LEFDE3:\n\n", (int)ctx->codesz - fcofs);
#endif
#endif
break;
#if !LJ_NO_UNWIND
Expand Down

0 comments on commit a468414

Please sign in to comment.