From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id BBFAA15DDEB8; Thu, 27 Nov 2025 16:55:44 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org BBFAA15DDEB8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1764251744; bh=L0c9qzK35Y5XAabp1P0wJUDPyyLzewjRenpEko+sqcE=; h=Date:To:Cc:References:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=OnNl/I2keonKcDvjMuMS0yMOEOqG2iNwMpQPO4RK5Pk7oKleejinr3fUedqYx576+ WGCJYo2520EalUV2/2OAHRp00zRYuDvf14AJTAoyv3VGlWmdz21+XVCUMKBX3iNLKK /opzoHV39zlzqtBCyiYJdc4wvzTF7KWCuhIaZUJY= Received: from send58.i.mail.ru (send58.i.mail.ru [89.221.237.153]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 0277557BA05 for ; Thu, 27 Nov 2025 16:55:43 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 0277557BA05 Received: by exim-smtp-6c58c594f5-c8xwj with esmtpa (envelope-from ) id 1vOcTF-00000000Ees-40N6; Thu, 27 Nov 2025 16:55:42 +0300 Content-Type: multipart/alternative; boundary="------------AO050TOrYePeYf4Dm5vJCm7q" Message-ID: <527e0628-deb3-4505-86c7-7139bdb07d88@tarantool.org> Date: Thu, 27 Nov 2025 16:55:41 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: Sergey Kaplun Cc: tarantool-patches@dev.tarantool.org References: <0d0437d54ff1d6878afe5ec627c795b3b1c9bf8e.1763991490.git.skaplun@tarantool.org> In-Reply-To: X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: 78E4E2B564C1792B X-77F55803: 4F1203BC0FB41BD990A6E13C587E340DBB2C1B4B7B2D7C8DB05AEBA26451476D00894C459B0CD1B90C7FAE8A3D97715003ED270C30F246C5516918A6711B87EB76BA5B3BCCE3B2F4E2602FFE9E909B31 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE746D93DAA4671895CEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637AC83A81C8FD4AD23D82A6BABE6F325AC2E85FA5F3EDFCBAA7353EFBB553375660CC9DC0D4886FBE8804877D25926B4154068A018F8182DF22B4A610D69D3781C389733CBF5DBD5E913377AFFFEAFD269176DF2183F8FC7C0D9442B0B5983000E8941B15DA834481FCF19DD082D7633A0EF3E4896CB9E6436389733CBF5DBD5E9D5E8D9A59859A8B64854413538E1713FCC7F00164DA146DA6F5DAA56C3B73B237318B6A418E8EAB8D32BA5DBAC0009BE9E8FC8737B5C22490F250D17497FEF6176E601842F6C81A12EF20D2F80756B5FB606B96278B59C4276E601842F6C81A127C277FBC8AE2E8B8DBB596EC94336063AA81AA40904B5D99C9F4D5AE37F343AD1F44FA8B9022EA23BBE47FD9DD3FB595F5C1EE8F4F765FC72CEEB2601E22B093A03B725D353964B0B7D0EA88DDEDAC722CA9DD8327EE4930A3850AC1BE2E73589424AA0EF8DE9BAC4224003CC83647689D4C264860C145E X-C1DE0DAB: 0D63561A33F958A5AFB17209C02490025002B1117B3ED696DC578751DCC62A327E0012C66AE17B00823CB91A9FED034534781492E4B8EEAD27E9584FBD6BDD31BDAD6C7F3747799A X-C8649E89: 1C3962B70DF3F0AD73CAD6646DEDE1918E10F71CB4DF9F96AB70F9BE574AE9C625B6776AC983F447FC0B9F89525902EE6F57B2FD27647F25E66C117BDB76D659B2E37BF0F630568B168A0F07A55E26E5CC52C11A763AABB76CD4C2E85ED57DE9B6C576A4C609A30EB8341EE9D5BE9A0AF74ACF8A2D0960EA8B741B9F509B599EF7631DA046BBE1F18CD93680B12512CF4C41F94D744909CE2512F26BEC029E55448553D2254B8D95CD72808BE417F3B9E0E7457915DAA85F X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu53w8ahmwBjZKM/YPHZyZHvz5uv+WouB9+ObcCpyrx6l7KImUglyhkEat/+ysWwi0gdhEs0JGjl6ggRWTy1haxBpVdbIX1nthFXMZebaIdHP2ghjoIc/363UZI6Kf1ptIMVcWupAQoUeGvypwzDaZPEio= X-Mailru-Sender: 811C44EDE0507D1FF7A5115BD94F839305B5AA5E1B3FAB3C504BCEC120683F152F6200A9A14B683198DB44B3D30E24F6645D15D82EE4B272BD6E4642A116CA93524AA66B5ACBE6721EF430B9A63E2A504198E0F3ECE9B5443453F38A29522196 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit 2/3] macOS: Workaround for buggy XCode 15.0 - 15.2 linker. X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Sergey Bronnikov via Tarantool-patches Reply-To: Sergey Bronnikov Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" This is a multi-part message in MIME format. --------------AO050TOrYePeYf4Dm5vJCm7q Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi, Sergey, Thanks for updates, LGTM On 11/27/25 12:59, Sergey Kaplun wrote: > Hi, Sergey! > Thanks for the review! > > See my answers below. > > On 26.11.25, Sergey Bronnikov wrote: >> Hi, Sergey, >> >> thanks for the patch! LGTM with a minor comment. >> >> Sergey >> >> On 11/24/25 23:26, Sergey Kaplun wrote: >>> From: Mike Pall >>> >>> 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 >> I would add exact macOS versions, according to [1] it is: 15000000 >> 1. > As discussed offline, this is exactly the problem with the Xcode > version, and this macro specifies the corresponding Xcode versions. > >> https://stackoverflow.com/questions/19387043/how-can-i-reliably-detect-the-version-of-clang-at-preprocessing-time#comment137533353_19391724 >> >>> directive in the buildvm. >>> >>> [1]:https://reviews.llvm.org/D79926 >>> >>> Sergey Kaplun: >>> * added the description for the problem >>> >>> Part of tarantool/tarantool#11691 > I've added the link to the machO format as you suggested: > > | macOS: Workaround for buggy XCode 15.0 - 15.2 linker. > | > | Thanks to Carlo Cabrera. > | > | (cherry picked from commit b2915e9ab55b999429b4d1931097064c4e17de53) > | > | 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 > >>> --- >>> 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. */ >> __apple_build_version__ defines a macOS version. But macOS 15 includes >> XCode 16, see [2], not 15.x >> >> So there is an inconsistency in condition and comment. I would list >> macOS versions in a comment like this >> >> "Workaround for macOS 15, 15.1 and 15.2" to avoid misinterpretation due >> to non-strict inequality with 15000300. >> >> Also, I would include a link to [2] to the commit message. >> >> 2. >> https://developer.apple.com/documentation/macos-release-notes/macos-15-release-notes > The same about the comment above. > >>> + fprintf(ctx->fp, "\t.subsections_via_symbols\n"); >>> +#endif >>> fprintf(ctx->fp, >>> "\t.cstring\n" >>> "\t.ascii \"%s\\0\"\n", ctx->dasm_ident); --------------AO050TOrYePeYf4Dm5vJCm7q Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit

Hi, Sergey,

Thanks for updates, LGTM

On 11/27/25 12:59, Sergey Kaplun wrote:
Hi, Sergey!
Thanks for the review!

See my answers below.

On 26.11.25, Sergey Bronnikov wrote:
Hi, Sergey,

thanks for the patch! LGTM with a minor comment.

Sergey

On 11/24/25 23:26, Sergey Kaplun wrote:
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
I would add exact macOS versions, according to [1] it is: 15000000
1. 
As discussed offline, this is exactly the problem with the Xcode
version, and this macro specifies the corresponding Xcode versions.

https://stackoverflow.com/questions/19387043/how-can-i-reliably-detect-the-version-of-clang-at-preprocessing-time#comment137533353_19391724 

directive in the buildvm.

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

Sergey Kaplun:
* added the description for the problem

Part of tarantool/tarantool#11691
I've added the link to the machO format as you suggested:

| macOS: Workaround for buggy XCode 15.0 - 15.2 linker.
|
| Thanks to Carlo Cabrera.
|
| (cherry picked from commit b2915e9ab55b999429b4d1931097064c4e17de53)
|
| 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

---
  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. */
__apple_build_version__ defines a macOS version. But macOS 15 includes 
XCode 16, see [2], not 15.x

So there is an inconsistency in condition and comment. I would list 
macOS versions in a comment like this

"Workaround for macOS 15, 15.1 and 15.2" to avoid misinterpretation due 
to non-strict inequality with 15000300.

Also, I would include a link to [2] to the commit message.

2. 
https://developer.apple.com/documentation/macos-release-notes/macos-15-release-notes
The same about the comment above.


        
+    fprintf(ctx->fp, "\t.subsections_via_symbols\n");
+#endif
      fprintf(ctx->fp,
        "\t.cstring\n"
        "\t.ascii \"%s\\0\"\n", ctx->dasm_ident);

    
--------------AO050TOrYePeYf4Dm5vJCm7q--