[Tarantool-patches] [PATCH luajit 2/3] macOS: Workaround for buggy XCode 15.0 - 15.2 linker.

Sergey Kaplun skaplun at tarantool.org
Mon Nov 24 23:26:37 MSK 2025


From: Mike Pall <mike>

Thanks to Carlo Cabrera.

(cherry picked from commit b2915e9ab55b999429b4d1931097064c4e17de53)

The previous commit removes emitting the `.subsections_via_symbols` [1]
directive for macOS. Nevertheless, the aforementioned Xcode linker
versions produce incorrect code for the VM without this directive.

As a fix for old versions of macOS, this patch adds emitting this
directive in the buildvm.

[1]: https://reviews.llvm.org/D79926

Sergey Kaplun:
* added the description for the problem

Part of tarantool/tarantool#11691
---
 src/host/buildvm_asm.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/host/buildvm_asm.c b/src/host/buildvm_asm.c
index 43595b31..fc09d71a 100644
--- a/src/host/buildvm_asm.c
+++ b/src/host/buildvm_asm.c
@@ -347,6 +347,10 @@ void emit_asm(BuildCtx *ctx)
     fprintf(ctx->fp, "\t.ident \"%s\"\n", ctx->dasm_ident);
     break;
   case BUILD_machasm:
+#if defined(__apple_build_version__) && __apple_build_version__ >= 15000000 && __apple_build_version__ < 15000300
+    /* Workaround for XCode 15.0 - 15.2. */
+    fprintf(ctx->fp, "\t.subsections_via_symbols\n");
+#endif
     fprintf(ctx->fp,
       "\t.cstring\n"
       "\t.ascii \"%s\\0\"\n", ctx->dasm_ident);
-- 
2.51.2



More information about the Tarantool-patches mailing list