* [Tarantool-patches] [PATCH luajit] ARM64: Allow building with unwinding disabled.
@ 2023-12-11 11:26 Maksim Kokryashkin via Tarantool-patches
2023-12-12 9:38 ` Sergey Kaplun via Tarantool-patches
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Maksim Kokryashkin via Tarantool-patches @ 2023-12-11 11:26 UTC (permalink / raw)
To: tarantool-patches, sergeyb, skaplun, m.kokryashkin
From: Mike Pall <mike>
(cherry-picked from commit 5677985dc1f19cf0a67112f4365c7fb79237fa16)
Prior to this patch, the LuaJIT build with the
`-DLUAJIT_NO_UNWIND=1` option enabled failed on ARM64 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
---
Branch: https://github.com/tarantool/luajit/tree/fckxorg/lj-866-allow-building-with-unwinding-disabled
PR: https://github.com/tarantool/tarantool/pull/9463
Issues: https://github.com/tarantool/tarantool/issues/9145
https://github.com/LuaJIT/LuaJIT/issues/866
.github/workflows/exotic-builds-testing.yml | 4 +++-
CMakeLists.txt | 5 +++++
src/vm_arm64.dasc | 2 ++
3 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/.github/workflows/exotic-builds-testing.yml b/.github/workflows/exotic-builds-testing.yml
index 7c57d238..a9ba5fd5 100644
--- a/.github/workflows/exotic-builds-testing.yml
+++ b/.github/workflows/exotic-builds-testing.yml
@@ -34,7 +34,7 @@ jobs:
BUILDTYPE: [Debug, Release]
ARCH: [ARM64, x86_64]
GC64: [ON, OFF]
- FLAVOR: [checkhook, dualnum, gdbjit, nojit]
+ FLAVOR: [checkhook, dualnum, gdbjit, nojit, nounwind]
include:
- BUILDTYPE: Debug
CMAKEFLAGS: -DCMAKE_BUILD_TYPE=Debug -DLUA_USE_ASSERT=ON -DLUA_USE_APICHECK=ON
@@ -48,6 +48,8 @@ jobs:
FLAVORFLAGS: -DLUAJIT_DISABLE_JIT=ON
- FLAVOR: gdbjit
FLAVORFLAGS: -DLUAJIT_USE_GDBJIT=ON
+ - FLAVOR: nounwind
+ FLAVORFLAGS: -DLUAJIT_NO_UNWIND=ON
exclude:
- ARCH: ARM64
GC64: OFF
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7ef10f2f..7f5e2afb 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -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)
diff --git a/src/vm_arm64.dasc b/src/vm_arm64.dasc
index 0a12b5b7..1cf1ea51 100644
--- a/src/vm_arm64.dasc
+++ b/src/vm_arm64.dasc
@@ -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"
@@ -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
--
2.39.3 (Apple Git-145)
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Tarantool-patches] [PATCH luajit] ARM64: Allow building with unwinding disabled.
2023-12-11 11:26 [Tarantool-patches] [PATCH luajit] ARM64: Allow building with unwinding disabled Maksim Kokryashkin via Tarantool-patches
@ 2023-12-12 9:38 ` Sergey Kaplun via Tarantool-patches
2023-12-29 13:40 ` Sergey Bronnikov via Tarantool-patches
2024-02-15 13:41 ` Igor Munkin via Tarantool-patches
2 siblings, 0 replies; 6+ messages in thread
From: Sergey Kaplun via Tarantool-patches @ 2023-12-12 9:38 UTC (permalink / raw)
To: Maksim Kokryashkin; +Cc: tarantool-patches
Hi, Maxim!
Thanks for the patch!
LGTM!
--
Best regards,
Sergey Kaplun
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Tarantool-patches] [PATCH luajit] ARM64: Allow building with unwinding disabled.
2023-12-11 11:26 [Tarantool-patches] [PATCH luajit] ARM64: Allow building with unwinding disabled Maksim Kokryashkin via Tarantool-patches
2023-12-12 9:38 ` Sergey Kaplun via Tarantool-patches
@ 2023-12-29 13:40 ` Sergey Bronnikov via Tarantool-patches
2024-01-09 14:18 ` Maxim Kokryashkin via Tarantool-patches
2024-02-15 13:41 ` Igor Munkin via Tarantool-patches
2 siblings, 1 reply; 6+ messages in thread
From: Sergey Bronnikov via Tarantool-patches @ 2023-12-29 13:40 UTC (permalink / raw)
To: Maksim Kokryashkin, tarantool-patches, skaplun, m.kokryashkin
Hello, Max!
thanks for the patch! LGTM with a minor comment
On 12/11/23 14:26, Maksim Kokryashkin wrote:
> From: Mike Pall <mike>
>
> (cherry-picked from commit 5677985dc1f19cf0a67112f4365c7fb79237fa16)
>
> Prior to this patch, the LuaJIT build with the
> `-DLUAJIT_NO_UNWIND=1` option enabled failed on ARM64 because of
> linker relocation errors related to dwarf-specific code. This
probably it is worth adding an error message produced by linker.
Feel free to ignore.
<snipped>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Tarantool-patches] [PATCH luajit] ARM64: Allow building with unwinding disabled.
2023-12-29 13:40 ` Sergey Bronnikov via Tarantool-patches
@ 2024-01-09 14:18 ` Maxim Kokryashkin via Tarantool-patches
2024-01-16 9:47 ` Sergey Bronnikov via Tarantool-patches
0 siblings, 1 reply; 6+ messages in thread
From: Maxim Kokryashkin via Tarantool-patches @ 2024-01-09 14:18 UTC (permalink / raw)
To: Sergey Bronnikov; +Cc: Maksim Kokryashkin, tarantool-patches
Hi, Sergey!
Thanks for the review!
On Fri, Dec 29, 2023 at 04:40:23PM +0300, Sergey Bronnikov wrote:
> Hello, Max!
>
> thanks for the patch! LGTM with a minor comment
>
> On 12/11/23 14:26, Maksim Kokryashkin wrote:
> > From: Mike Pall <mike>
> >
> > (cherry-picked from commit 5677985dc1f19cf0a67112f4365c7fb79237fa16)
> >
> > Prior to this patch, the LuaJIT build with the
> > `-DLUAJIT_NO_UNWIND=1` option enabled failed on ARM64 because of
> > linker relocation errors related to dwarf-specific code. This
>
> probably it is worth adding an error message produced by linker.
>
> Feel free to ignore.
Added. Here is the new commit message:
===
ARM64: Allow building with unwinding disabled.
(cherry-picked from commit 5677985dc1f19cf0a67112f4365c7fb79237fa16)
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
===
>
>
> <snipped>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Tarantool-patches] [PATCH luajit] ARM64: Allow building with unwinding disabled.
2024-01-09 14:18 ` Maxim Kokryashkin via Tarantool-patches
@ 2024-01-16 9:47 ` Sergey Bronnikov via Tarantool-patches
0 siblings, 0 replies; 6+ messages in thread
From: Sergey Bronnikov via Tarantool-patches @ 2024-01-16 9:47 UTC (permalink / raw)
To: Maxim Kokryashkin; +Cc: Maksim Kokryashkin, tarantool-patches
Max, thanks for correction! LGTM as I said before
On 1/9/24 17:18, Maxim Kokryashkin wrote:
> Hi, Sergey!
> Thanks for the review!
> On Fri, Dec 29, 2023 at 04:40:23PM +0300, Sergey Bronnikov wrote:
>> Hello, Max!
>>
>> thanks for the patch! LGTM with a minor comment
>>
>> On 12/11/23 14:26, Maksim Kokryashkin wrote:
>>> From: Mike Pall <mike>
>>>
>>> (cherry-picked from commit 5677985dc1f19cf0a67112f4365c7fb79237fa16)
>>>
>>> Prior to this patch, the LuaJIT build with the
>>> `-DLUAJIT_NO_UNWIND=1` option enabled failed on ARM64 because of
>>> linker relocation errors related to dwarf-specific code. This
>> probably it is worth adding an error message produced by linker.
>>
>> Feel free to ignore.
> Added. Here is the new commit message:
> ===
> ARM64: Allow building with unwinding disabled.
>
> (cherry-picked from commit 5677985dc1f19cf0a67112f4365c7fb79237fa16)
>
> 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
> ===
>>
>> <snipped>
>>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Tarantool-patches] [PATCH luajit] ARM64: Allow building with unwinding disabled.
2023-12-11 11:26 [Tarantool-patches] [PATCH luajit] ARM64: Allow building with unwinding disabled Maksim Kokryashkin via Tarantool-patches
2023-12-12 9:38 ` Sergey Kaplun via Tarantool-patches
2023-12-29 13:40 ` Sergey Bronnikov via Tarantool-patches
@ 2024-02-15 13:41 ` Igor Munkin via Tarantool-patches
2 siblings, 0 replies; 6+ messages in thread
From: Igor Munkin via Tarantool-patches @ 2024-02-15 13:41 UTC (permalink / raw)
To: Maksim Kokryashkin; +Cc: tarantool-patches
Max,
I've checked the patchset into all long-term branches in
tarantool/luajit and bumped a new version in master and release/3.0.
On 11.12.23, Maksim Kokryashkin via Tarantool-patches wrote:
> From: Mike Pall <mike>
>
> (cherry-picked from commit 5677985dc1f19cf0a67112f4365c7fb79237fa16)
>
> Prior to this patch, the LuaJIT build with the
> `-DLUAJIT_NO_UNWIND=1` option enabled failed on ARM64 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
> ---
> Branch: https://github.com/tarantool/luajit/tree/fckxorg/lj-866-allow-building-with-unwinding-disabled
> PR: https://github.com/tarantool/tarantool/pull/9463
> Issues: https://github.com/tarantool/tarantool/issues/9145
> https://github.com/LuaJIT/LuaJIT/issues/866
>
> .github/workflows/exotic-builds-testing.yml | 4 +++-
> CMakeLists.txt | 5 +++++
> src/vm_arm64.dasc | 2 ++
> 3 files changed, 10 insertions(+), 1 deletion(-)
>
<snipped>
> --
> 2.39.3 (Apple Git-145)
>
--
Best regards,
IM
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2024-02-15 13:52 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-11 11:26 [Tarantool-patches] [PATCH luajit] ARM64: Allow building with unwinding disabled Maksim Kokryashkin via Tarantool-patches
2023-12-12 9:38 ` Sergey Kaplun via Tarantool-patches
2023-12-29 13:40 ` Sergey Bronnikov via Tarantool-patches
2024-01-09 14:18 ` Maxim Kokryashkin via Tarantool-patches
2024-01-16 9:47 ` Sergey Bronnikov via Tarantool-patches
2024-02-15 13:41 ` Igor Munkin via Tarantool-patches
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox