<!DOCTYPE html>
<html data-lt-installed="true">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body style="padding-bottom: 1px;">
    <p>Hi, Sergey,</p>
    <p>thanks for the patch! LGTM with a minor comment.</p>
    <p>Sergey</p>
    <div class="moz-cite-prefix">On 11/24/25 23:26, Sergey Kaplun wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:0d0437d54ff1d6878afe5ec627c795b3b1c9bf8e.1763991490.git.skaplun@tarantool.org">
      <pre wrap="" class="moz-quote-pre">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</pre>
    </blockquote>
    I would add exact macOS versions, according to [1] it is: 15000000<br>
    1.
<a class="moz-txt-link-freetext" href="https://stackoverflow.com/questions/19387043/how-can-i-reliably-detect-the-version-of-clang-at-preprocessing-time#comment137533353_19391724">https://stackoverflow.com/questions/19387043/how-can-i-reliably-detect-the-version-of-clang-at-preprocessing-time#comment137533353_19391724</a>
    <blockquote type="cite"
cite="mid:0d0437d54ff1d6878afe5ec627c795b3b1c9bf8e.1763991490.git.skaplun@tarantool.org">
      <pre wrap="" class="moz-quote-pre">
directive in the buildvm.

[1]: <a class="moz-txt-link-freetext" href="https://reviews.llvm.org/D79926">https://reviews.llvm.org/D79926</a>

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. */</pre>
    </blockquote>
    <p>__apple_build_version__ defines a macOS version. But macOS 15
      includes XCode 16, see [2], not 15.x</p>
    <p>So there is an inconsistency in condition and comment. I would
      list macOS versions in a comment like this</p>
    <p>"Workaround for macOS 15, 15.1 and 15.2" to avoid
      misinterpretation due to non-strict inequality with 15000300.</p>
    <p>Also, I would include a link to [2] to the commit message.</p>
    <p>2.
<a class="moz-txt-link-freetext" href="https://developer.apple.com/documentation/macos-release-notes/macos-15-release-notes">https://developer.apple.com/documentation/macos-release-notes/macos-15-release-notes</a></p>
    <blockquote type="cite"
cite="mid:0d0437d54ff1d6878afe5ec627c795b3b1c9bf8e.1763991490.git.skaplun@tarantool.org">
      <pre wrap="" class="moz-quote-pre">
+    fprintf(ctx->fp, "\t.subsections_via_symbols\n");
+#endif
     fprintf(ctx->fp,
       "\t.cstring\n"
       "\t.ascii \"%s\\0\"\n", ctx->dasm_ident);
</pre>
    </blockquote>
  </body>
  <lt-container></lt-container>
</html>