Skip to content

Commit 4ce2b13

Browse files
Mike PallBuristan
authored andcommitted
macOS: Workaround for buggy XCode 15.0 - 15.2 linker.
Thanks to Carlo Cabrera. (cherry picked from commit b2915e9) The previous commit removes emitting the `.subsections_via_symbols` [1][2] 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 [2]: https://github.com/aidansteele/osx-abi-macho-file-format-reference Sergey Kaplun: * added the description for the problem Part of tarantool/tarantool#11691 Reviewed-by: Sergey Bronnikov <[email protected]> Signed-off-by: Sergey Kaplun <[email protected]>
1 parent 94083a5 commit 4ce2b13

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/host/buildvm_asm.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,10 @@ void emit_asm(BuildCtx *ctx)
347347
fprintf(ctx->fp, "\t.ident \"%s\"\n", ctx->dasm_ident);
348348
break;
349349
case BUILD_machasm:
350+
#if defined(__apple_build_version__) && __apple_build_version__ >= 15000000 && __apple_build_version__ < 15000300
351+
/* Workaround for XCode 15.0 - 15.2. */
352+
fprintf(ctx->fp, "\t.subsections_via_symbols\n");
353+
#endif
350354
fprintf(ctx->fp,
351355
"\t.cstring\n"
352356
"\t.ascii \"%s\\0\"\n", ctx->dasm_ident);

0 commit comments

Comments
 (0)