Skip to content

Commit 734d205

Browse files
Mike Palligormunkin
Mike Pall
authored andcommitted
ARM64: Allow building with unwinding disabled.
(cherry-picked from commit 5677985) Prior to this patch, the LuaJIT build with the `-DLUAJIT_NO_UNWIND=1` option enabled failed on ARM64 because of linker relocation error related to dwarf-specific code: | /usr/bin/ld: lj_vm_dyn.o: relocation R_AARCH64_PREL32 against | symbol `lj_err_unwind_dwarf' which may bind externally can not | be used when making a shared object; recompile with -fPIC | lj_vm_dyn.o:(.eh_frame+0x12): dangerous relocation: unsupported | relocation 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 Reviewed-by: Sergey Kaplun <[email protected]> Reviewed-by: Sergey Bronnikov <[email protected]> Signed-off-by: Igor Munkin <[email protected]> (cherry picked from commit 022e3c7)
1 parent dc10bef commit 734d205

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

.github/workflows/exotic-builds-testing.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
BUILDTYPE: [Debug, Release]
3535
ARCH: [ARM64, x86_64]
3636
GC64: [ON, OFF]
37-
FLAVOR: [checkhook, dualnum, gdbjit, nojit]
37+
FLAVOR: [checkhook, dualnum, gdbjit, nojit, nounwind]
3838
include:
3939
- BUILDTYPE: Debug
4040
CMAKEFLAGS: -DCMAKE_BUILD_TYPE=Debug -DLUA_USE_ASSERT=ON -DLUA_USE_APICHECK=ON
@@ -48,6 +48,8 @@ jobs:
4848
FLAVORFLAGS: -DLUAJIT_DISABLE_JIT=ON
4949
- FLAVOR: gdbjit
5050
FLAVORFLAGS: -DLUAJIT_USE_GDBJIT=ON
51+
- FLAVOR: nounwind
52+
FLAVORFLAGS: -DLUAJIT_NO_UNWIND=ON
5153
exclude:
5254
- ARCH: ARM64
5355
GC64: OFF

CMakeLists.txt

+5
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,11 @@ if(LUAJIT_DISABLE_UNWIND_JIT)
202202
AppendFlags(TARGET_C_FLAGS -DLUAJIT_DISABLE_UNWIND_JIT)
203203
endif()
204204

205+
option(LUAJIT_NO_UNWIND "Disable external unwinding.")
206+
if(LUAJIT_NO_UNWIND)
207+
AppendFlags(TARGET_C_FLAGS -DLUAJIT_NO_UNWIND)
208+
endif()
209+
205210
# Disable memory profiler.
206211
option(LUAJIT_DISABLE_MEMPROF "LuaJIT memory profiler support" OFF)
207212
if(LUAJIT_DISABLE_MEMPROF)

src/vm_arm64.dasc

+2
Original file line numberDiff line numberDiff line change
@@ -3915,6 +3915,7 @@ static void emit_asm_debug(BuildCtx *ctx)
39153915
"\t.align 3\n"
39163916
".LEFDE1:\n\n", (int)ctx->codesz - fcofs);
39173917
#endif
3918+
#if !LJ_NO_UNWIND
39183919
fprintf(ctx->fp, "\t.section .eh_frame,\"a\",%%progbits\n");
39193920
fprintf(ctx->fp,
39203921
".Lframe1:\n"
@@ -3982,6 +3983,7 @@ static void emit_asm_debug(BuildCtx *ctx)
39823983
"\t.byte 0x94\n\t.uleb128 4\n" /* offset x20 */
39833984
"\t.align 3\n"
39843985
".LEFDE3:\n\n", (int)ctx->codesz - fcofs);
3986+
#endif
39853987
#endif
39863988
break;
39873989
#if !LJ_NO_UNWIND

0 commit comments

Comments
 (0)