From patchwork Thu Dec 3 13:38:16 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Etienne Cordonnier X-Patchwork-Id: 107198 Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.14093.1796305105096310766 for ; Thu, 03 Dec 2026 05:38:25 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@snap.com header.s=google header.b=dPnpT8jl; spf=pass (domain: snapchat.com, ip: 209.85.128.45, mailfrom: ecordonnier@snapchat.com) Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-4a35a60499eso111552355e9.0 for ; Thu, 03 Dec 2026 05:38:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=snap.com; s=google; t=1796305103; x=1796909903; darn=lists.yoctoproject.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=y7wzxVFXDR4lW8su9OtsnQ5h5l+AUxOkuBdtCTolyhE=; b=dPnpT8jl4EAddWJ1djloDKH0HlZv1RYl6yWwTH4oznYRfAfHiDF7Ttb1xWSlYyUtSt P9m7m/FOt3Q0Jhamo/QDT90VVgaqkpZEeaMHT7ie/N81zo3hV2Gej2+CdOJdzknGVHk0 SvQtndfL2tIBjd9dBnjpLXeDdSGLHslrVj4to= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796305103; x=1796909903; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=y7wzxVFXDR4lW8su9OtsnQ5h5l+AUxOkuBdtCTolyhE=; b=00WNVekCfWAQzuEPzVrlkkjPaa7NWKvQ8IPaxvADlwR7obEIEdVHPiNQugNezavHpG MOTOJ5NVS6LDRuJ3TlLKG1d/yyPcgnEZQtqZd2ORvLTkoU6nJSb2pPSjb91E8Nzn1uf0 In1mj0eXHhF9a5ugZLbESpn1twYl5GDrHHDmElEisCMMkHTeZ7flCDGkJptq/pMwcF7y pY5nsa8QlTdxB6V+xq/9FaeUi0I2dtWZLiE24HTHbplkw6vfBZj5JHgTinccdm7+Kh/Z UG4QB0RkNlsaiFCtCmdotW8hldSJQnf3wSMNe0t3dqZYGxb67F5fbc05oX6e2KWkIeDX cG9g== X-Gm-Message-State: APuU4Z8l5gcVEm4uvAlqXlcCgoW5owLuD+FpYdULMZWvg6hzJ7s/qBsL 7OGeqBJjEoLMxjMg6cLEZPXsHD9L65D1NUwFSXV1RQRZYxbH7P3JWMhtf4iMomlL491QyLc2o28 32OfW//M= X-Gm-Gg: AZFdTZfAisCkOtLUO5Xxx/OstHLgrCl+HPoFnlDRoXJoE/qDwbhSsfMCC0ina2kjAP1 ve/sOiVpYedv7AHW3EdIWYKQLzd2mUNCl1mnJ2m9a++JJDCwlfLcOrvuFHr4z8TeFHE4dK8++5c LnzeFk8wCeVM+hYFVPgoKBKgx/NHGpQPk2zk/9ZBovO8Topw2hJJ3xAIkYrpxGWPLyZumTtLM5G Kt2q7wD1ht11QTKJzwmCxJQuAOT0AWcCGe62KasKXVK0EUfiZMfsyWW7vgczM6Zq1RtJ20/7sHm ZvFjV7d8cvKpF7pHvqbKQGOBekOwNctOreiHPZLUQrOT0CoagNFd5ArpgBNtO0IcwJa8H4td1mH IulF3jTyPVNC54v7AMJJZmRLXPiYyCCJzTbNAO03Nz8ppdwv3lKLEU5bM+EXXe/353F1bc3DL1s P0Cck4yN06nqh8ykpuKCUiBXwkGGFIWwVAGwx95pPtn86uI1bXlNwpikoTcneq+oNglU7122vJZ AbVKDBeu5Wh4GQAyrl3Bx8rsDJi5691DpiD0UGLGZZETpW8jSIVARCDF/tW6Uir55ZDJvaFIfOW F8qAvfOyoMsmlRqb172Bbiua7SjLBG/9+FjnlqxwExd97vwFQMZ0+u86j3JlJhQNojDVi8RPN7B xcdNAhT9UdlTN1x+QBxEig5dv5b+gyndl X-Received: by 2002:a05:600c:6219:b0:4bb:60b1:4409 with SMTP id 5b1f17b1804b1-4bb88816525mr855495965e9.19.1796305103440; Thu, 03 Dec 2026 05:38:23 -0800 (PST) Return-Path: Received: from lj8k2dq3.sc-core.net ([85.237.126.22]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4bbe06edeb7sm116661395e9.11.2026.12.03.05.38.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Dec 2026 05:38:22 -0800 (PST) From: ecordonnier@snap.com To: yocto-patches@lists.yoctoproject.org Cc: Etienne Cordonnier Subject: [meta-darwin][PATCH 1/3] lldb: build nativesdk-lldb with clang for the macOS SDK Date: Thu, 3 Dec 2026 14:38:16 +0100 Message-ID: <20261203133818.967228-1-ecordonnier@snap.com> X-Mailer: git-send-email 2.53.0 MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by lin-tor-korg-lkml-alma10-1 with HTTPS for ; Thu, 03 Dec 2026 13:38:33 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto-patches/message/5657 From: Etienne Cordonnier lldb's macOS host support is Objective-C++, which the Darwin cross-GCC cannot compile. Select the clang toolchain for the nativesdk variant when SDK_OS is darwin, and keep the default SDK toolchain otherwise so that the Linux SDK still uses GCC. The previous PREFERRED_TOOLCHAIN_SDK in the bbappend had no effect: it is only a global default consumed by "TOOLCHAIN ??= ${PREFERRED_TOOLCHAIN}" in base.bbclass, and the distro sets TOOLCHAIN = "gcc". Set TOOLCHAIN with a pn- override instead. base.bbclass expands "inherit toolchain/${TOOLCHAIN}" at finalize time, before the BBCLASSEXTEND variant has inherited nativesdk: TARGET_OS is still the target's, so darwin21 and class-nativesdk are not in OVERRIDES yet, and PN is still bitbake's temporary "lldb-nativesdk", not "nativesdk-lldb". The override is therefore keyed on the temporary PN and the darwin check reads SDK_OS, a global variable that is already set. Tested: macOS NDK nativesdk-clang and nativesdk-lldb build, with x86_64-snapndk-darwin21-clang++ compiling the .mm files; bitbake -e of the Linux NDK nativesdk-lldb still selects toolchain-gcc. AI-Generated: Claude Sonnet 5.5 Signed-off-by: Etienne Cordonnier --- recipes-devtools/clang/lldb_%.bbappend | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/recipes-devtools/clang/lldb_%.bbappend b/recipes-devtools/clang/lldb_%.bbappend index 39734d8..7fe8cb3 100644 --- a/recipes-devtools/clang/lldb_%.bbappend +++ b/recipes-devtools/clang/lldb_%.bbappend @@ -57,9 +57,9 @@ INSANE_SKIP:${PN}:class-nativesdk:darwin21 += " file-rdeps" EXTRA_PYTHON_DEPENDS:class-nativesdk:darwin21 = "" # lldb's macOS host support is Objective-C++ (Host.mm etc.), which the Darwin -# cross-GCC can't compile. Build with the clang-crosssdk compiler instead, with -# the same toolchain-clang adjustments as the nativesdk-clang bbappend. -PREFERRED_TOOLCHAIN_SDK = "clang" +# cross-GCC can't compile. Build it with the clang-crosssdk compiler, with the +# same toolchain-clang adjustments as the nativesdk-clang bbappend. +TOOLCHAIN:pn-lldb-nativesdk = "${@'clang' if d.getVar('SDK_OS').startswith('darwin') else d.getVar('PREFERRED_TOOLCHAIN_SDK')}" COMPILER_RT:class-nativesdk:toolchain-clang:runtime-llvm:darwin21 = "" LIBCPLUSPLUS:class-nativesdk:toolchain-clang:darwin21 = " -stdlib=libstdc++" From patchwork Thu Dec 3 13:38:17 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Etienne Cordonnier X-Patchwork-Id: 107199 Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.13875.1796305110651239148 for ; Thu, 03 Dec 2026 05:38:31 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@snap.com header.s=google header.b=ABKfJMR1; spf=pass (domain: snapchat.com, ip: 209.85.128.49, mailfrom: ecordonnier@snapchat.com) Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-4bb9d8e8e90so111863885e9.3 for ; Thu, 03 Dec 2026 05:38:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=snap.com; s=google; t=1796305109; x=1796909909; darn=lists.yoctoproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=3MClSkIiB7W8Arlh/E/b8c3FFO1La2lhCYea+be21t4=; b=ABKfJMR16XYRY3E79Q/zTRfr9txj7EPmNh37Dbo9+LyUkwlca81yLaHitjaNmfQgOy Vh9s4fkqKpdv1dn4oG8JUMOro0YJxTAJsqaqf73LGJsetmUuQNo6D1fm1p8rNGuKcACz 7wnFsVFy8WTdX5Wq7ihRs5bjIPKbwReTXZG9A= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796305109; x=1796909909; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=3MClSkIiB7W8Arlh/E/b8c3FFO1La2lhCYea+be21t4=; b=Xh+tHGShsDanF5KmfjITYkfa8AddOnuygPOnV1SjZOkWRfjR5MXpkkYxXbwGf4gl20 XgyCysKq2CHYmAYbXvaRKewvRIhgbOQPDZ6kjrzfH4owRTE97h7qNu85QF/jypwFGaTP nryNQ2biV5YEnaJBRPPfkjn2cKUpQ4RGV2PDKbxLAuAIAZ7cvw7L/nui/g+N/m+s8wXm LI+UXD6fdYVsi/HsfbB6RXYaS8nvX/cV9CozIE+nMPDsFjhDtzD6+gH3QE6PX4u5E8SO VpuK51F6/PJ52jUBXbyMEhgwgcf1D1AxD+y6/iWaPBGjK1MbKiHAsgc8AkRrbxHNS49a rAjg== X-Gm-Message-State: APuU4Z+ObOwg6Gjg+WeajSBFUThvgHU+DrXo3sz3v+FtN9lBL+ZLp2H/ xnGt2hpiYRQqAOl9/OV4bgw2r61E3diqelEytTlIUKuEvlHmdcaohN9hZANmDxPOG1CidKxf8EA zP13HECk= X-Gm-Gg: AZFdTZdBX7jwkbBtJwOkl8oik9/m+7gFf+FrY5J73L/Nfs/PFk9RXvVcINahyDo56/+ Ud4m0+ye7qmG2y/Q4UdtXJsIitqyM9vlpfSpk75KFuuqALworp5qyKzw4gULyyJvYkc7XFUaIu9 QmclBrxdAJgn4DMZf6fz+5RixQMam5VmIRgtj3aVeU/t8bLYyMZPe+HIGHcvYGvaNKoxZfgdhZ7 bybsf+fT/D3McPgxw+C+829tZmwoZVit8gxM0AzIq/EauiAi5S5/SVqvojvEdwMODNYAREEwxOg 4D3agJeH2gWAHHeSzqEoEMz4mmtvH4CYsJB5rsV6ET/bNqQxQiiXd7uoNnFhv5CUTT9/Ql9jkw1 uxM+l8GBdwnUd8EG78zsDNvzsfupEbPlIsx9FgcQaJdLZ19rxuOka+IJeMQtAaumXO2dHWxdE2q C3UlTjbybsPnERF7nSCij/Dp7w09+/7vSNC2zYpYTQSjEgQI4pm2aNKLdg50J3EQO7OrKXhz1Z1 siuB34KCxePB6XmJn8NOgYNsEyd0s9JBBnAEP9E6pjBFmTlxRMvOGMqGutCKcF8reODPHd/19vr z9T23e7Toukql+CC2uA40hPigr/F8Tyvj3QCvFlueKShQODMqy6C+SscVGgIrgL0HZik5BOQZc1 ydiBFSSdHapafHTarJkR1alowyw6/3Yzj X-Received: by 2002:a05:600c:1d2a:b0:4b7:6942:39bf with SMTP id 5b1f17b1804b1-4bb88814031mr1039186465e9.28.1796305109073; Thu, 03 Dec 2026 05:38:29 -0800 (PST) Return-Path: Received: from lj8k2dq3.sc-core.net ([85.237.126.22]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4bbe06edeb7sm116661395e9.11.2026.12.03.05.38.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Dec 2026 05:38:28 -0800 (PST) From: ecordonnier@snap.com To: yocto-patches@lists.yoctoproject.org Cc: Etienne Cordonnier Subject: [meta-darwin][PATCH 2/3] lldb: fix install_name_tool for liblldb, libclang-cpp and libLLVM Date: Thu, 3 Dec 2026 14:38:17 +0100 Message-ID: <20261203133818.967228-2-ecordonnier@snap.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261203133818.967228-1-ecordonnier@snap.com> References: <20261203133818.967228-1-ecordonnier@snap.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by lin-tor-korg-lkml-alma10-1 with HTTPS for ; Thu, 03 Dec 2026 13:38:33 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto-patches/message/5658 From: Etienne Cordonnier The binaries reference @rpath/liblldb..dylib, so the previous '-change liblldb..dylib ...' matched nothing and silently did nothing. The only rpath left is the absolute install prefix, so lldb failed on a relocated NDK with 'Library not loaded: @rpath/liblldb...'. Match the real install name and cover lldb, lldb-argdumper, lldb-dap, lldb-instr and lldb-mcp. lldb also links libclang-cpp.dylib and libLLVM.dylib via @rpath and failed the same way, so rewrite them to @loader_path/../lib/ too. liblldb..dylib has the same @rpath references to libclang-cpp and libLLVM with only the absolute rpath, so rewrite those to @loader_path/. -change is a no-op for a binary that does not reference the library. Tested: macOS NDK nativesdk-lldb build; the packaged binaries now reference @loader_path/../lib/liblldb.22.1.8.dylib. AI-Generated: Claude Sonnet 5.5 Signed-off-by: Etienne Cordonnier --- recipes-devtools/clang/lldb_%.bbappend | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/recipes-devtools/clang/lldb_%.bbappend b/recipes-devtools/clang/lldb_%.bbappend index 7fe8cb3..969ce17 100644 --- a/recipes-devtools/clang/lldb_%.bbappend +++ b/recipes-devtools/clang/lldb_%.bbappend @@ -44,7 +44,15 @@ EXTRA_OECMAKE:append:class-nativesdk:darwin21 = " \ " do_compile:append:class-nativesdk:darwin21() { - ${SDK_PREFIX}install_name_tool -change liblldb.${PV}.dylib @loader_path/../lib/liblldb.${PV}.dylib ${B}/bin/lldb-dap + for tool in lldb lldb-argdumper lldb-dap lldb-instr lldb-mcp; do + ${SDK_PREFIX}install_name_tool -change @rpath/liblldb.${PV}.dylib @loader_path/../lib/liblldb.${PV}.dylib ${B}/bin/$tool + ${SDK_PREFIX}install_name_tool -change @rpath/libclang-cpp.dylib @loader_path/../lib/libclang-cpp.dylib ${B}/bin/$tool + ${SDK_PREFIX}install_name_tool -change @rpath/libLLVM.dylib @loader_path/../lib/libLLVM.dylib ${B}/bin/$tool + done + ${SDK_PREFIX}install_name_tool \ + -change @rpath/libclang-cpp.dylib @loader_path/libclang-cpp.dylib \ + -change @rpath/libLLVM.dylib @loader_path/libLLVM.dylib \ + ${B}/lib/liblldb.${PV}.dylib } # lldb-dap's rewritten @loader_path reference to liblldb.dylib trips the From patchwork Thu Dec 3 13:38:18 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Etienne Cordonnier X-Patchwork-Id: 107200 Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.14096.1796305113507502015 for ; Thu, 03 Dec 2026 05:38:33 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@snap.com header.s=google header.b=Vr+DpxuA; spf=pass (domain: snapchat.com, ip: 209.85.128.48, mailfrom: ecordonnier@snapchat.com) Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-4bba5e17728so75716795e9.2 for ; Thu, 03 Dec 2026 05:38:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=snap.com; s=google; t=1796305112; x=1796909912; darn=lists.yoctoproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=E7GUsimtzbvp8OJnXcg8ECu2eCijEDobscCsj34t7OQ=; b=Vr+DpxuAY97p5bIErOHc+ai718Q9YQVV3RZ2Kc9ADaoTmdrFbaCSv3FxRMp9W0P7qq YvurdIoMf4mTOcF7BXRiPpRE916N9Za9l3htdExg+0CxOMeSJLcm/CxKfZMVxyVhlN04 jpaoL+K9x7EfAuiIwJfg6qvawlnkVwv0S///4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796305112; x=1796909912; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=E7GUsimtzbvp8OJnXcg8ECu2eCijEDobscCsj34t7OQ=; b=CDx+hxhP/AKK570DBuQk0nzMn89fPKGeJWaH8aruauCVSD+Ozyu9qOvBd1OG5tSdOj 15uJYvr/lGuCBiIYXGIQsDz0SZeQYbisxrnwqSUT/pl0GJC0y8/FAGwRFHAM1/qZhL8b ZQCVGSPlaIXFDMklCfRcvjh5VW/hWEa3aSdfbx6o4rSSG6SJqJAzMDLhqjXaAD91ydqe iubjNe1zIaXmgeC3+kNSAni1euTeodp/aaGAzQ+ET/huXjDbejL7tE29gDcZgKxubKpK M/JjbPrAsVB35aIGxaj8W9UXOWED04ks4NlHKTJ6KjjVFdQFmAfOZ5ODPKZ2qREOW2wx mL4w== X-Gm-Message-State: APuU4Z9dCVVOpu0DsANDGjTVvUtEaTMAN9awZio4AH86SyYc78hlYOM+ zu/SjqqH0uoPsoCJILWH4IawtSJyHugBQJYXHyeKKvqBEg/zyK1v6mK4cc/OyAyCrVkrNVEIo8/ Dti1F65E= X-Gm-Gg: AZFdTZcWVv+u1fpcIG+7bLZatr4S+8Agv6EfRqVld1OzXerQR6bvVNIygJ4j8Hcb5N2 UjnvqdQbBx2qi//A5Y8SXYP30gGQLg7Zn6KZacLYGWk07iEysgwkszRJX9Ji7iqwetm0ZuzB75K nsKfxqvqirpCZv9FG/h/7W2VUqMVAdv55dnRl2qCi12T8mw6v5OgT954XKLS5E5IT9k79imLFk+ NgUlrnN9Wu2ecSXm3MxmwkhDuOqGEvp9iUYRP7yrH6drD8Y8h+ozw8d0QkAcM49Lstb5sKvm8aB uBhrDpQDQKo85vuu+VjjsMZy+kF1XUe+JNU43bqPpKBYnz4d119cKttmXRaHOgWIjcouZJTaLVo 3277g4QYe6GVC03I4MH+i9n6MWB1kYtes2UdzTwiqKVj7ZwIjqpN3bCmNnbR+G0//MSryD9Cq0M UPsgBJUZdn5V6tbfBIu9ESe66YEQATrIg9xEcDnO+CGM036xS+Ou/ft+NheSsDtD/HraychEGz9 8zQ3IfHVil1lF/YMgQlCwYfN8vJOCBPIeJeCQ5jrZcsMTpaUV/LmLac7S4FC26XglAWctTDzmNP zaR79qo25hJ2ou3cUZhgpqLNolMo4Ma1K/P8iLODg50PFLugBS2UKsdQX5Wx+SBs1TiftS6PLMr WrsAzDWbkzlb/1rupexamIWIvx6hUUSH/ X-Received: by 2002:a05:600c:468c:b0:4bb:6d61:af7c with SMTP id 5b1f17b1804b1-4bb88944bf5mr847319145e9.35.1796305111984; Thu, 03 Dec 2026 05:38:31 -0800 (PST) Return-Path: Received: from lj8k2dq3.sc-core.net ([85.237.126.22]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4bbe06edeb7sm116661395e9.11.2026.12.03.05.38.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Dec 2026 05:38:31 -0800 (PST) From: ecordonnier@snap.com To: yocto-patches@lists.yoctoproject.org Cc: Etienne Cordonnier Subject: [meta-darwin][PATCH 3/3] gcc: keep aarch64 outline atomics hidden Date: Thu, 3 Dec 2026 14:38:18 +0100 Message-ID: <20261203133818.967228-3-ecordonnier@snap.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261203133818.967228-1-ecordonnier@snap.com> References: <20261203133818.967228-1-ecordonnier@snap.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by lin-tor-korg-lkml-alma10-1 with HTTPS for ; Thu, 03 Dec 2026 13:38:43 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto-patches/message/5659 From: Etienne Cordonnier 0101 replaces the local STARTFN macro in libgcc/config/aarch64/lse.S with the generic ENTRY macro, so that Mach-O gets the symbol prefix (ASMNAME), the right alignment directive and no .type/.size. STARTFN emitted HIDDEN(\name); ENTRY does not. As a result every __aarch64_{cas,swp,ldadd,ldclr,ldeor,ldset}* helper in libgcc.a, 125 in total, is a default-visibility global instead of hidden. gcc-source is shared by all GCC recipes, so this also affects the Linux aarch64 target libgcc, not only Darwin. Any shared library that pulls the helpers in without --exclude-libs or a version script then exports them, and its consumers bind to that copy instead of the private copy in their own DSO. Mark each helper hidden again. HIDDEN expands to .hidden on ELF and to .private_extern on Mach-O (both defined by 0101), which matches upstream GCC. The same defect is present in iains/gcc-15-branch (gcc-15-3-darwin), the source of 0101. Tested: gcc-source do_patch applies 0104 on top of 0101 without fuzz. Assembling lse.S for aarch64 with and without 0104 for cas8_acq, cas16_acq_rel, swp4_acq_rel, ldadd8_relax, ldclr2_acq, ldset1_rel and ldeor4_relax gives a plain global symbol without it and .hidden with it. Not tested on Darwin. AI-Generated: Claude Sonnet 5.5 Signed-off-by: Etienne Cordonnier --- ...-aarch64-keep-outline-atomics-hidden.patch | 35 +++++++++++++++++++ recipes-devtools/gcc/gcc-source_%.bbappend | 7 ++++ 2 files changed, 42 insertions(+) create mode 100644 recipes-devtools/gcc/files/0104-libgcc-aarch64-keep-outline-atomics-hidden.patch diff --git a/recipes-devtools/gcc/files/0104-libgcc-aarch64-keep-outline-atomics-hidden.patch b/recipes-devtools/gcc/files/0104-libgcc-aarch64-keep-outline-atomics-hidden.patch new file mode 100644 index 0000000..fac1843 --- /dev/null +++ b/recipes-devtools/gcc/files/0104-libgcc-aarch64-keep-outline-atomics-hidden.patch @@ -0,0 +1,35 @@ +Subject: [PATCH] libgcc: aarch64: keep outline atomics hidden after Darwin ENTRY conversion + +0101 replaces lse.S's local STARTFN macro (which emitted HIDDEN(\name)) with +the generic ENTRY macro, which has no HIDDEN. Every __aarch64_{cas,swp,ld*} +helper in libgcc.a thus becomes default-visibility. Mark them hidden again. +HIDDEN is .hidden on ELF and .private_extern on Mach-O. + +Upstream-Status: Inappropriate [fixes a downstream Darwin backport] +--- +--- a/libgcc/config/aarch64/lse.S ++++ b/libgcc/config/aarch64/lse.S +@@ -186,6 +186,7 @@ + + #ifdef L_cas + ++ HIDDEN (ASMNAME (NAME(cas))) + ENTRY (ASMNAME (NAME(cas))) + JUMP_IF_NOT_LSE 8f + +@@ -249,6 +250,7 @@ + # define SWP .inst 0x38208020 + B + N + #endif + ++ HIDDEN (ASMNAME (NAME (swp))) + ENTRY (ASMNAME (NAME (swp))) + JUMP_IF_NOT_LSE 8f + +@@ -293,6 +295,7 @@ + # define LDOP .inst 0x38200020 + OPN + B + N + #endif + ++ HIDDEN (ASMNAME (NAME (LDNM))) + ENTRY (ASMNAME (NAME (LDNM))) + JUMP_IF_NOT_LSE 8f + diff --git a/recipes-devtools/gcc/gcc-source_%.bbappend b/recipes-devtools/gcc/gcc-source_%.bbappend index de18cff..a886d63 100644 --- a/recipes-devtools/gcc/gcc-source_%.bbappend +++ b/recipes-devtools/gcc/gcc-source_%.bbappend @@ -25,6 +25,13 @@ SRC_URI:append = " \ file://0103-libgcc-i386-cpuinfo-avoid-darwin-alias-ice.patch \ " +# 0101 replaces lse.S's STARTFN (which emitted HIDDEN) with the generic ENTRY +# macro, which does not; this restores hidden visibility of the outline-atomic +# helpers, which would otherwise leak out of every shared library using them. +SRC_URI:append = " \ + file://0104-libgcc-aarch64-keep-outline-atomics-hidden.patch \ +" + # gcc-15.3.0 tarball ships zlib/zlib.map with CRLF; 0101 tail hunk is LF-only. python do_patch:prepend() { import pathlib