From patchwork Fri Jun 26 11:37:54 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoann Congal X-Patchwork-Id: 91042 X-Patchwork-Delegate: yoann.congal@smile.fr Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9F8BFCDE008 for ; Fri, 26 Jun 2026 11:38:14 +0000 (UTC) Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.33116.1782473893477083295 for ; Fri, 26 Jun 2026 04:38:13 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@smile.fr header.s=google header.b=QhfjG9nk; spf=pass (domain: smile.fr, ip: 209.85.128.41, mailfrom: yoann.congal@smile.fr) Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-4924944fe6bso6170235e9.0 for ; Fri, 26 Jun 2026 04:38:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=smile.fr; s=google; t=1782473891; x=1783078691; darn=lists.openembedded.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=m/OQpPs9J5LrR7y1wpP2CStzwfH8sWE8N7/+n0Ww6kE=; b=QhfjG9nkFvjtp9v3Tgzjk36j/NL5HSvaV4QS9HvROD0I5sRuOrIHCeuXGpX2Y9xWBj vhKh1UqIwYnxdL6ifYKl1wQMtWCBGVR65jJi7nxeNhqyh3sFEo9PyqSRa382T/9chcU5 UG1ROPNvQ12rlLQdVlOnnFrTcBmh/AP2zlCQg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782473891; x=1783078691; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=m/OQpPs9J5LrR7y1wpP2CStzwfH8sWE8N7/+n0Ww6kE=; b=ColyBmMZOWvB5jDl7Y95x9VL+2AW2vDzInBU2aRsKOVcbCH95NZIXgDwTahBapSPWq qpCc5Nc20k6Bx0Wfkd0HLTOxOE4dfVqdrCkeYXNC5yaSmnNcbfrKWFgGxuwOoj3+32Y4 dzzy69pcYWijfHRtiYXjzCQl77lmf6QsjD9ag4lzr9czKjpsYdXJmjPZsV0iyA2LPU3h xXygMofB72E4Va/e0+IYiyPzo9Z7zRZbrPZBPZgw0F8IvRim+rO0nDtcqeK0K9qzYSqB 86uiAIS4n8DbNWK2i98fuNx4fDL7F1JZa2IU2mF6JG6lcxF+I3v5sHOEkS+xcFXlRnql ArhA== X-Gm-Message-State: AOJu0YzrxfOBrckCXADSSJY/bkBJfjAH9Bg2gNhJ8LoCpZgaOAQmAChM Lydl4UKAl+6urBetDdWrEZb2uD4Prn++RuK8M+vFDpqRAahR2YaTRdji5wYLpM0oC78= X-Gm-Gg: AfdE7ckHPR+tlTWoMDkhe8y+DLCyPJJMqzsK6sUaVNV/aOg73GNQgtqVCSYJjcCT/Wm zHhc9/4++76qxDqyZxC+KSBBJP/D1mctjJfyV0RQ6MHADob3v+BqV7Q1MbfyvRgfFLGuXBfEAzb rxLWndvpO9XXfcrGGnNLCuNlXFMj0azaNzoIGFwZi0a6kBPCmvuAL6IxTeuDJERFGHQ5iWtuWiw PXZil854njRQS92JYjR2dNm5Flyo1w4DEbHpmK3wMXZSzuMsZU3LiT/2XxVXoYmH6prd79mUs0i daaCh1OoleZue83rz+/SRW5zng8DoRr0QUlIh0lwKWnPulxU5hgUfcdbNJxGdXq11l8lwTtMFuT yatjnshVA5zh5g2GHqR83Y9ZGLiBWoICoilXDASox+K0k5qLTqej04q+qlyoq03xXD7vEIaePus 5cqPqCwfezJmPvgN45bjV43oteUChJennfZ/82RlFZpFZNrwveRuRvZR2Sakhhw+n4nZ051JVyH eS/54LlOg== X-Received: by 2002:a05:600c:3b13:b0:492:450c:57cf with SMTP id 5b1f17b1804b1-492668ad60fmr101021365e9.31.1782473891549; Fri, 26 Jun 2026 04:38:11 -0700 (PDT) Received: from [10.1.75.39] (2a01cb001331aa00dc663d106f146c8c.ipv6.abo.wanadoo.fr. [2a01:cb00:1331:aa00:dc66:3d10:6f14:6c8c]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49270208b29sm421345e9.10.2026.06.26.04.38.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jun 2026 04:38:11 -0700 (PDT) From: Yoann Congal Date: Fri, 26 Jun 2026 13:37:54 +0200 Subject: [PATCH RFC 1/3] rust: Enable dynamic linking with llvm MIME-Version: 1.0 Message-Id: <20260626-ycongal-scarthgap-rust-segfault-v1-1-97df64b7b298@smile.fr> References: <20260626-ycongal-scarthgap-rust-segfault-v1-0-97df64b7b298@smile.fr> In-Reply-To: <20260626-ycongal-scarthgap-rust-segfault-v1-0-97df64b7b298@smile.fr> To: openembedded-core@lists.openembedded.org Cc: alex.kanavin@gmail.com, ccasciato@21sw.us, paul@pbarker.dev, randy.macleod@windriver.com, ross.burton@arm.com, sundeep.kokkonda@windriver.com, SunilKumar.Dora@windriver.com, Yoann Congal , Sunil Dora , Alexander Kanavin , Richard Purdie X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1782473890; l=1917; i=yoann.congal@smile.fr; s=20260527; h=from:subject:message-id; bh=riv1tCvDYCYHV1fYxFEdE8Vf9sgre8gaLZCGL4DfYAo=; b=lF/IAJEjYsFonlxdprspEpQUBhRUf9BBYTy+uxeIQXe5GvRLZLCJOKjmcVhWdTMQqbFvP+ez8 FzGE928RAsUApgL1L0ac7jUOgqEk0VTw4jkObl9J1zpHIFbbIKrhhYM X-Developer-Key: i=yoann.congal@smile.fr; a=ed25519; pk=AccXM/XSn9zzv1zYXEM/MdcAaQ7cluqUBg1xzwrqNts= List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 26 Jun 2026 11:38:14 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/239627 From: Sunil Dora Fixes [Yocto #16058] A segmentation fault occurs in rustc (e.g. in llvm::X86ReadAdvanceTable) when reusing sstate artifacts built with different host toolchain versions. Issue sequence: 1. llvm-native is built with a newer toolchain (e.g. GCC 15/Binutils 2.45). 2. rust-native is later built with an older linker. (e.g. GCC 12/Binutils 2.40). 3. The older linker statically links parts of llvm-native into librustc_driver. 4. The resulting binary crashes at runtime inside the statically linked LLVM code. The corruption happens at link time when mixing static native objects produced by different toolchain generations. Enable dynamic LLVM linking (link-shared = true) for rust-native so rustc links against libLLVM.so instead of static archives, avoiding host linker incompatibilities when reusing sstate artifacts. Signed-off-by: Sunil Dora Suggested-by: Alexander Kanavin Signed-off-by: Richard Purdie (cherry picked from commit 74ba238ff1ba1e9b612aece1989b828f3a8f8770) Signed-off-by: Yoann Congal --- meta/recipes-devtools/rust/rust_1.75.0.bb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/meta/recipes-devtools/rust/rust_1.75.0.bb b/meta/recipes-devtools/rust/rust_1.75.0.bb index b9348bf05071016cf27880258e27babb3f2eec90..f037bb33715dc4ba7cbb489ab1599ac6c8c875a4 100644 --- a/meta/recipes-devtools/rust/rust_1.75.0.bb +++ b/meta/recipes-devtools/rust/rust_1.75.0.bb @@ -128,6 +128,8 @@ python do_configure() { # [llvm] config.add_section("llvm") + if d.getVar('PN') == "rust-native": + config.set("llvm", "link-shared", e(True)) config.set("llvm", "static-libstdcpp", e(False)) if "llvm" in (d.getVar('TC_CXX_RUNTIME') or ""): config.set("llvm", "use-libcxx", e(True)) From patchwork Fri Jun 26 11:37:55 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoann Congal X-Patchwork-Id: 91041 X-Patchwork-Delegate: yoann.congal@smile.fr Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id CD09FCD4F26 for ; Fri, 26 Jun 2026 11:38:14 +0000 (UTC) Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.33117.1782473894012836463 for ; Fri, 26 Jun 2026 04:38:14 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@smile.fr header.s=google header.b=umZ7Nlm6; spf=pass (domain: smile.fr, ip: 209.85.128.47, mailfrom: yoann.congal@smile.fr) Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-490b613a17bso8259445e9.3 for ; Fri, 26 Jun 2026 04:38:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=smile.fr; s=google; t=1782473892; x=1783078692; darn=lists.openembedded.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=CTXAyJxgtidQ2YPWCiyHnHoEhaWx+uXLJbucVrnwhHs=; b=umZ7Nlm6Lr3j/l+cKUAw3fdquviglElzFzkUMvAVuwkSaaTmWOEQeNRUQTkgBE1Zok QEv8omiyLzneZ8y+4IkMtRP4UI8gfexPCgFgLVGdyTnbLtyYVJg78N1UXM5uf5H7uQ8I V6x1K1rb5BmuL2IhBuf/I2s3rNuK9ubDwZeKo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782473892; x=1783078692; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=CTXAyJxgtidQ2YPWCiyHnHoEhaWx+uXLJbucVrnwhHs=; b=Fp7YOxvXISG6swY7Me/9y01jAf1Ihs5LTMwdcdpO53BWCpzS+dzZQC40uRyr/yXu52 EwasfqREnaSwsv/iWiD3RWSGyrB4L9M92hDN8bh37kWCLxDXAyM2N1vsk5MeVy4SNI+C bEp+mMHqP9A/NVL4ap0pY9GSUUFC4m0+7CdWoVS72ft9FZZTAW72S2RUgxiVZDpRXnMH KFIANK8yv9gu1HUH4uVIZD0++GK7BXTMwXoILvamFNGzt+h/V5iQMQLqlycEbYeveki8 B93M//ru1mcsmnEkTeCAEWB8A8OSaWMdrJGYMcyWQvZsC21RGC5LKh6u1HH9xwb3pdfV 5iwA== X-Gm-Message-State: AOJu0YyUDxl+YizK6fKAFr4CXr4T5TCL8I20GkJGsIze2FLbDWCloL9+ OqxDTdon17j8aoVzpclycC9uacXBJqfEJ8iXZirdxtJBA+QA8lGCx4/YwMPRJC2spZY= X-Gm-Gg: AfdE7cmAt3IazO/eoBSxHgevKNS88NITTJrH3q60UDWQ+qwHrDrt4qniPxQQuQv/7EO 3T4OJZ4glz4S2C/auw5C+1R3DzvxpgWXgPXay3ViGVFkUmCYTNXvXI9wxPpfZLqiA4VbDwzjX2D Rx1ANU52JaTEoSIk1rybv4BsE01DCetkU2ta7QLXfKLbc8cFE00vPLjQw3/eDw8BfRzC6Xj2Czf RJaqKbrz6k/ocppxVhfJgS1LAIAQLcvfBeE6oiHE9233IF95sd/4yqjYOPOedBnxUGlb2HyYski kBSzH+k7qS+kPnS4BqICgHjlXkLtdGOzsyXo6K1lEKpUyFWq5Hwlq2tDjQA73hosNPMWVNzj3ib n6bAgikqTU+CEz3RB+sxkwAnurod/eU4C+x3cRCNOtZo9ZXKxCmipnBmE+Nka7ymXuzEfHXUXLk bM9clZgzRhN1sUHz9/0Ib2Bz8eU97njOmJaNm2dDk92WVicSS0vkW4oC4R5GAblyrOUHBkCnDRO J8vTyS2wg== X-Received: by 2002:a05:600c:4e45:b0:492:4948:bfce with SMTP id 5b1f17b1804b1-4926fc45f89mr7327275e9.16.1782473892228; Fri, 26 Jun 2026 04:38:12 -0700 (PDT) Received: from [10.1.75.39] (2a01cb001331aa00dc663d106f146c8c.ipv6.abo.wanadoo.fr. [2a01:cb00:1331:aa00:dc66:3d10:6f14:6c8c]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49270208b29sm421345e9.10.2026.06.26.04.38.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jun 2026 04:38:11 -0700 (PDT) From: Yoann Congal Date: Fri, 26 Jun 2026 13:37:55 +0200 Subject: [PATCH RFC 2/3] rust-llvm: Disable libedit MIME-Version: 1.0 Message-Id: <20260626-ycongal-scarthgap-rust-segfault-v1-2-97df64b7b298@smile.fr> References: <20260626-ycongal-scarthgap-rust-segfault-v1-0-97df64b7b298@smile.fr> In-Reply-To: <20260626-ycongal-scarthgap-rust-segfault-v1-0-97df64b7b298@smile.fr> To: openembedded-core@lists.openembedded.org Cc: alex.kanavin@gmail.com, ccasciato@21sw.us, paul@pbarker.dev, randy.macleod@windriver.com, ross.burton@arm.com, sundeep.kokkonda@windriver.com, SunilKumar.Dora@windriver.com, Yoann Congal , Richard Purdie X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1782473890; l=1159; i=yoann.congal@smile.fr; s=20260527; h=from:subject:message-id; bh=he6Xk9kWKiIbL8hCU8snGm/CW+3Uo6+PrzUzMDqBWjQ=; b=Zpzdm9rz4qU8hDoLX2MqYg7q9A18G5+90FgXukEyRZDqhrJARDUJt4eIFfDyQtfaSDBhVYN7S O1JGz/Mo4ZJBk3HReLD9GLno96XjJOseRfQKbKoNzr0kA9SL4GZ6ta8 X-Developer-Key: i=yoann.congal@smile.fr; a=ed25519; pk=AccXM/XSn9zzv1zYXEM/MdcAaQ7cluqUBg1xzwrqNts= List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 26 Jun 2026 11:38:14 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/239628 From: Richard Purdie This option currently floats and is leading to non-deterministic builds. It is used for commandline option tab completion which we don't need in our builds in general, let alone internally within rust's llvm. This should fix autobuilder deterministic build issues. Signed-off-by: Richard Purdie (cherry picked from commit c31859be39c68f215576ba73b8a3d66c8ea590d3) Signed-off-by: Yoann Congal --- meta/recipes-devtools/rust/rust-llvm_1.75.0.bb | 1 + 1 file changed, 1 insertion(+) diff --git a/meta/recipes-devtools/rust/rust-llvm_1.75.0.bb b/meta/recipes-devtools/rust/rust-llvm_1.75.0.bb index cba41c739e9692ec7b2cd7ee07554ab00dc98fc5..4adaf5fbf6d31b1984a81e864285c1e06218e325 100644 --- a/meta/recipes-devtools/rust/rust-llvm_1.75.0.bb +++ b/meta/recipes-devtools/rust/rust-llvm_1.75.0.bb @@ -46,6 +46,7 @@ EXTRA_OECMAKE = " \ -DLLVM_ENABLE_ZSTD=OFF \ -DLLVM_ENABLE_LIBXML2=OFF \ -DLLVM_ENABLE_FFI=OFF \ + -DLLVM_ENABLE_LIBEDIT=OFF \ -DLLVM_INSTALL_UTILS=ON \ -DLLVM_BUILD_EXAMPLES=OFF \ -DLLVM_INCLUDE_EXAMPLES=OFF \ From patchwork Fri Jun 26 11:37:56 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoann Congal X-Patchwork-Id: 91043 X-Patchwork-Delegate: yoann.congal@smile.fr Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id CFB0DCD4F26 for ; Fri, 26 Jun 2026 11:38:24 +0000 (UTC) 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.33118.1782473894865047819 for ; Fri, 26 Jun 2026 04:38:15 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@smile.fr header.s=google header.b=VBN5pg9A; spf=pass (domain: smile.fr, ip: 209.85.128.49, mailfrom: yoann.congal@smile.fr) Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-490b1bbcf3aso4561815e9.1 for ; Fri, 26 Jun 2026 04:38:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=smile.fr; s=google; t=1782473893; x=1783078693; darn=lists.openembedded.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=ai8l/1xM4QYfHkDGs80zRn1KEtuxv1XO+nmZ1abeN8o=; b=VBN5pg9AE6KmcXbQl/MReTO11xrRlmrDIpnyPUu6Q5EF73djC3rrV2KbC7D2Oa07d+ /T04c04ICFqFlBvkUZa4YJMhJgO5U2dbjxYoq45pLJg5cc4pMUTnxRRJo7r7auBWS5sq iaZAT4UZUQGiEic5+QPRAAjN8p1BqcUe4lhVA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782473893; x=1783078693; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=ai8l/1xM4QYfHkDGs80zRn1KEtuxv1XO+nmZ1abeN8o=; b=QciuVv+FdeIljYbvu8pozj3kGsYV692p85J9qY6N5Yrp6PPRDZCL4REUFVC4LY4GPX HDg4ddGtL/5W3SKib3fyNsANsXcDozc/TB79cOJdC/hcKnFl7etR6epILr8GX/tTiUwM l71NJEc2wFkN+zsPo8jci+Yrz7OW2Duor2CcjN7ro1mA51OYUswyZtkSmWRY9R1ZClF3 7HQcLo2OXWqunYXgv6iQY6e19DXkvYpMhPdUYXubASEPf+rzZiYlnL7hl78erNRJjCtw oziQWETa/wyKLB0VtoH2ecnidwhjOO7W47cQpaIDTHE5TLbT8onp6l5WH0w1EV0+kQTG +2yQ== X-Gm-Message-State: AOJu0YyQWo1TYis6rMtmpgR6OFN9m99dEpCtz7+eK/X08B1/aFpyuxom t6u2eSDa8I9RE9/M17Vq7+l4kLfnvuDbE0mxTs/Ows32c7YsUsRkpzZBBC2ET3hQswM= X-Gm-Gg: AfdE7cmGKmZHTbwMMl5Tj0e3IUki+f/6HFjaPs1bWcampDB57XIV5p1ZSPxrzIyoOG1 lwtiyi1PPuQRF+EWFtdTCGYSQ3AUyZtbPKp2mfoVpWVe5USfF1u4lUfAEcBfI8Apj/b9ZB2DcKa 8bB+9FjIgdZhDrlJz0RLkG0JQhLK51ViZQf3HuVYgGjuoilhHLlIW/j/ZuX/Nny/JtQgxyrsM0A LbavVQjwGZMrpWwkxMjBgPMRfd5SqeSkkzsUVwPpYZeusyc3M4rpb9UH6pA4W598auxVXR/tN4Z 58NKIIabNbkr0ACtvUSEKGmwGGpwXL7qDZuTGbHAEoJp+kxhPD1BGBrg4V63Z6IgNkZWCtLIQnu fVZ6R8UfmiGEtpDqp9vGPomSbJlvObrmJhuz56na/qHjNgVaXGlr+sx0NvCPR3/5ufBCZXSFeY0 VMzdFKIx6vn2wq9r4dX3bCMq1O80lTB/+8wrHDqYq7KW+wIUJth9Q9/nKXzCYQOv2HOkrkIoZes sGnUsOvNA== X-Received: by 2002:a05:600c:3f18:b0:492:6efc:7c60 with SMTP id 5b1f17b1804b1-4926fc919c3mr5434805e9.28.1782473892999; Fri, 26 Jun 2026 04:38:12 -0700 (PDT) Received: from [10.1.75.39] (2a01cb001331aa00dc663d106f146c8c.ipv6.abo.wanadoo.fr. [2a01:cb00:1331:aa00:dc66:3d10:6f14:6c8c]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49270208b29sm421345e9.10.2026.06.26.04.38.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jun 2026 04:38:12 -0700 (PDT) From: Yoann Congal Date: Fri, 26 Jun 2026 13:37:56 +0200 Subject: [PATCH RFC 3/3] WIP backport: rust: enable dynamic LLVM linking by default MIME-Version: 1.0 Message-Id: <20260626-ycongal-scarthgap-rust-segfault-v1-3-97df64b7b298@smile.fr> References: <20260626-ycongal-scarthgap-rust-segfault-v1-0-97df64b7b298@smile.fr> In-Reply-To: <20260626-ycongal-scarthgap-rust-segfault-v1-0-97df64b7b298@smile.fr> To: openembedded-core@lists.openembedded.org Cc: alex.kanavin@gmail.com, ccasciato@21sw.us, paul@pbarker.dev, randy.macleod@windriver.com, ross.burton@arm.com, sundeep.kokkonda@windriver.com, SunilKumar.Dora@windriver.com, Yoann Congal , Sunil Dora , Alexander Kanavin , Richard Purdie X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1782473890; l=6202; i=yoann.congal@smile.fr; s=20260527; h=from:subject:message-id; bh=gPnqYF2++NojPo+pBfFATG6X6CxcVl5y8bdlUh5a1vQ=; b=VPfQpfrFmwU+vQWlsN/OP5gGmqbbN/8ZJnTFiKJ9mdv84D4t7JwlMqQSOmv+kyUpI5SBun1KG 5H6W6HcwXmHBg3zhrX+N67Dof2nacXFbhrnUcPwu9p5O3noJ19dq3SY X-Developer-Key: i=yoann.congal@smile.fr; a=ed25519; pk=AccXM/XSn9zzv1zYXEM/MdcAaQ7cluqUBg1xzwrqNts= List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 26 Jun 2026 11:38:24 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/239629 From: Sunil Dora Fixes [YOCTO #16058] Enable dynamic linking with LLVM (link-shared) for all rust variants (native, nativesdk and target) via a PACKAGECONFIG option, enabled by default. This prevents segmentation faults when reusing sstate artifacts built with different host toolchains. Update multilib library symlinking to include shared libraries and adjust the rust selftest to install llvm so the dynamically linked compiler can run correctly. Suggested-by: Alexander Kanavin Signed-off-by: Sunil Dora Signed-off-by: Richard Purdie (cherry picked from commit d0671c3dad87a063b3a41dd07cde89b5684e692c) [YC: WIP Backport: * moveid from llvm to rust-llvm (llvm unification has not happened on scarthgap * made changes limited to -native/nativesdk- to avoid changing target output without reason * Redid FILES* packaging around $PN/$PN-dev split to handle LLVM.so files] Signed-off-by: Yoann Congal --- meta/lib/oeqa/selftest/cases/rust.py | 2 +- meta/recipes-devtools/rust/rust-llvm_1.75.0.bb | 39 ++++++++++++++++++++++++-- meta/recipes-devtools/rust/rust_1.75.0.bb | 8 ++++-- 3 files changed, 44 insertions(+), 5 deletions(-) diff --git a/meta/lib/oeqa/selftest/cases/rust.py b/meta/lib/oeqa/selftest/cases/rust.py index 26f132edc4d55f260f835a996181834588249d13..b6912f646e37d0edb07bb178d2d3671ac1a67542 100644 --- a/meta/lib/oeqa/selftest/cases/rust.py +++ b/meta/lib/oeqa/selftest/cases/rust.py @@ -51,7 +51,7 @@ class RustSelfTestSystemEmulated(OESelftestTestCase, OEPTestResultTestCase): bitbake("{} -c test_compile".format(recipe)) builddir = get_bb_var("RUSTSRC", "rust") # build core-image-minimal with required packages - default_installed_packages = ["libgcc", "libstdc++", "libatomic", "libgomp"] + default_installed_packages = ["libgcc", "libstdc++", "libatomic", "libgomp", "llvm"] features = [] features.append('IMAGE_FEATURES += "ssh-server-dropbear"') features.append('CORE_IMAGE_EXTRA_INSTALL += "{0}"'.format(" ".join(default_installed_packages))) diff --git a/meta/recipes-devtools/rust/rust-llvm_1.75.0.bb b/meta/recipes-devtools/rust/rust-llvm_1.75.0.bb index 4adaf5fbf6d31b1984a81e864285c1e06218e325..b32d3ee38cd2be3fa2dde1b8720f59c0b4b13c90 100644 --- a/meta/recipes-devtools/rust/rust-llvm_1.75.0.bb +++ b/meta/recipes-devtools/rust/rust-llvm_1.75.0.bb @@ -56,6 +56,9 @@ EXTRA_OECMAKE = " \ -DCMAKE_INSTALL_PREFIX:PATH=${libdir}/llvm-rust \ " +EXTRA_OECMAKE:append:class-native = " -DLLVM_BUILD_LLVM_DYLIB=ON -DLLVM_LINK_LLVM_DYLIB=ON" +EXTRA_OECMAKE:append:class-nativesdk = " -DLLVM_BUILD_LLVM_DYLIB=ON -DLLVM_LINK_LLVM_DYLIB=ON" + # Forcibly disable the detection of these packages as otherwise # it will look at the host Python install EXTRA_OECMAKE += "\ @@ -87,6 +90,24 @@ do_install:append () { rm -rf "${D}/usr/lib/cmake" } +symlink_llvm_libs() { + # Create symlinks in ${libdir} so that dynamic libraries can be found in standard paths + install -d ${D}${libdir} + for lib in ${D}${libdir}/llvm-rust/lib/libLLVM-*.so*; do + if [ -e "$lib" ]; then + ln -sf llvm-rust/lib/$(basename $lib) ${D}${libdir}/$(basename $lib) + fi + done +} + +do_install:append:class-native () { + symlink_llvm_libs +} + +do_install:append:class-nativesdk () { + symlink_llvm_libs +} + PACKAGES =+ "${PN}-bugpointpasses ${PN}-llvmhello ${PN}-liblto" # Add the extra locations to avoid the complaints about unpackaged files @@ -94,7 +115,21 @@ FILES:${PN}-bugpointpasses = "${libdir}/llvm-rust/lib/BugpointPasses.so" FILES:${PN}-llvmhello = "${libdir}/llvm-rust/lib/LLVMHello.so" FILES:${PN}-liblto = "${libdir}/llvm-rust/lib/libLTO.so.*" FILES:${PN}-staticdev =+ "${libdir}/llvm-rust/*/*.a" -FILES:${PN} += "${libdir}/libLLVM*.so.* ${libdir}/llvm-rust/lib/*.so.* ${libdir}/llvm-rust/bin" -FILES:${PN}-dev += "${datadir}/llvm ${libdir}/llvm-rust/lib/*.so ${libdir}/llvm-rust/include ${libdir}/llvm-rust/share ${libdir}/llvm-rust/lib/cmake" +FILES:${PN} += "${libdir}/libLLVM*.so* ${libdir}/llvm-rust/lib/libLLVM*.so* ${libdir}/llvm-rust/lib/libRemarks.so* ${libdir}/llvm-rust/bin" +FILES:${PN}-dev += "${datadir}/llvm ${libdir}/llvm-rust/include ${libdir}/llvm-rust/share ${libdir}/llvm-rust/lib/cmake" + +# Prevent -dev from matching versioned libs ending in .so +FILES:${PN}-dev:remove = "${libdir}/lib*.so" + +# Package unversioned dev symlinks in -dev +FILES:${PN}-dev += " \ + ${libdir}/llvm-rust/lib/libLLVM.so \ + ${libdir}/llvm-rust/lib/libLTO.so \ + ${libdir}/llvm-rust/lib/libRemarks.so \ +" + +# libLLVM-17.so ends in .so; skip dev-so check for host builds +INSANE_SKIP:${PN}:class-native += "dev-so" +INSANE_SKIP:${PN}:class-nativesdk += "dev-so" BBCLASSEXTEND = "native nativesdk" diff --git a/meta/recipes-devtools/rust/rust_1.75.0.bb b/meta/recipes-devtools/rust/rust_1.75.0.bb index f037bb33715dc4ba7cbb489ab1599ac6c8c875a4..b11f0ddd2816569e08e6cf908786ee32d49b79e1 100644 --- a/meta/recipes-devtools/rust/rust_1.75.0.bb +++ b/meta/recipes-devtools/rust/rust_1.75.0.bb @@ -20,6 +20,11 @@ DEPENDS += "rust-llvm (=${PV})" RDEPENDS:${PN}:append:class-target = " gcc g++ binutils" +PACKAGECONFIG ??= "" +PACKAGECONFIG:class-native ??= "llvm-shared" +PACKAGECONFIG:class-nativesdk ??= "llvm-shared" +PACKAGECONFIG[llvm-shared] = ",,," + # Otherwise we'll depend on what we provide INHIBIT_DEFAULT_RUST_DEPS:class-native = "1" # We don't need to depend on gcc-native because yocto assumes it exists @@ -128,8 +133,7 @@ python do_configure() { # [llvm] config.add_section("llvm") - if d.getVar('PN') == "rust-native": - config.set("llvm", "link-shared", e(True)) + config.set("llvm", "link-shared", e(bb.utils.contains('PACKAGECONFIG', 'llvm-shared', True, False, d))) config.set("llvm", "static-libstdcpp", e(False)) if "llvm" in (d.getVar('TC_CXX_RUNTIME') or ""): config.set("llvm", "use-libcxx", e(True))