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/yyP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DVi8RPN7B 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++"