From patchwork Fri Aug 5 13:12:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 10995 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 88825C00140 for ; Fri, 5 Aug 2022 13:13:00 +0000 (UTC) Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) by mx.groups.io with SMTP id smtpd.web12.6767.1659705175208683315 for ; Fri, 05 Aug 2022 06:12:55 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=FCG8gkeL; spf=pass (domain: linuxfoundation.org, ip: 209.85.221.53, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wr1-f53.google.com with SMTP id l4so3178382wrm.13 for ; Fri, 05 Aug 2022 06:12:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc; bh=N2RJRsSbrtHzselbM4BYF5+0HqwmiJgiz30/JCoZnuU=; b=FCG8gkeLT+hJApDzZEd+8jC1ufaGkzCFxny0/3CcZbRWQSph+zsckrpzFJEPbwkLxe VZmY95JZcprV9eyXKaagoQLqMLT8xdE2lVt5cEQjseMcZW8xZ1gQVlCY+gbkkkFZYPLW rNxMePZBYmnLGdwp3YldbvoP8v5fSVL87XI7k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc; bh=N2RJRsSbrtHzselbM4BYF5+0HqwmiJgiz30/JCoZnuU=; b=xV7sOQUJwGpMhTiNxI4WurIMecNxOR7Xj4joAuBwpykAv9o+2FVeebJSdp8kn+lPDA wf27RiybqdQPiOS+5t3hiir6ew7R55Jrt8hFdhEBCHQccvGlljoD8F/3h91WEwFe8yhd VnUVd0Sok7SVGpgG5/KfwwRAXCXHrfwy2Hh/EYoLDIjE9Z0k8bZGkQOCuwzEiASUTk/R RgZIAy1LkB1x1ZN6YjhYaT0szA2edF9h7UOOKk/RNGgXe+bXOS4aabwTyo0fBm0Mze0B AcvNZOoVLg2CvMuu64G5IUlmnWBI+oSl1mp1XRfflUB/qaZqOsomfdGmwunX10Ub8E0w KUSA== X-Gm-Message-State: ACgBeo24Bs9I9b4XhvbIkuA+HMsiClq/a6l3TlNygWDRT7uVCPz1Qe3k K31nnVkAvG4OmHjDpc6Yei9nBBtYHjxi5A== X-Google-Smtp-Source: AA6agR5KPdYNEjLATkHi12J9cvS7ekNMa9bJAr9jaAhrvXgsV6s9+F0c+kav53FuBDlWSiWLZaeJJQ== X-Received: by 2002:a5d:6d49:0:b0:21b:a3ba:30b5 with SMTP id k9-20020a5d6d49000000b0021ba3ba30b5mr4434039wri.513.1659705173307; Fri, 05 Aug 2022 06:12:53 -0700 (PDT) Received: from max.int.rpsys.net ([2001:8b0:aba:5f3c:f483:fcb0:1452:5a5a]) by smtp.gmail.com with ESMTPSA id p12-20020a05600c204c00b003a51a0d35e7sm1908901wmg.37.2022.08.05.06.12.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Aug 2022 06:12:52 -0700 (PDT) From: Richard Purdie To: openembedded-core@lists.openembedded.org Subject: [PATCH 01/29] nativesdk: Clear TUNE_FEATURES Date: Fri, 5 Aug 2022 14:12:24 +0100 Message-Id: <20220805131252.3706794-1-richard.purdie@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 05 Aug 2022 13:13:00 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/168935 Similarly to what native.bbclass does, clear TUNE_FEATURES since these aren't appropriate to the nativesdk build. This saves us having to change down signature issues due to data in this variable. Signed-off-by: Richard Purdie --- meta/classes/nativesdk.bbclass | 1 + 1 file changed, 1 insertion(+) diff --git a/meta/classes/nativesdk.bbclass b/meta/classes/nativesdk.bbclass index f8e96075134..e46739e325b 100644 --- a/meta/classes/nativesdk.bbclass +++ b/meta/classes/nativesdk.bbclass @@ -55,6 +55,7 @@ TARGET_CXXFLAGS = "${BUILDSDK_CXXFLAGS}" TARGET_LDFLAGS = "${BUILDSDK_LDFLAGS}" TARGET_FPU = "" EXTRA_OECONF_GCC_FLOAT = "" +TUNE_FEATURES = "" CPPFLAGS = "${BUILDSDK_CPPFLAGS}" CFLAGS = "${BUILDSDK_CFLAGS}" From patchwork Fri Aug 5 13:12:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 10996 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 97CAFC25B06 for ; Fri, 5 Aug 2022 13:13:00 +0000 (UTC) Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) by mx.groups.io with SMTP id smtpd.web12.6768.1659705176182557441 for ; Fri, 05 Aug 2022 06:12:56 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=cNy6kl7A; spf=pass (domain: linuxfoundation.org, ip: 209.85.128.54, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wm1-f54.google.com with SMTP id b6so1389761wmq.5 for ; Fri, 05 Aug 2022 06:12:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc; bh=X2TAOfXg7YoGOOnAQE+GYx8LSGd2JtQEi9WVmmO0/Fo=; b=cNy6kl7Ahd955w1hkAmJ2MYM02P9QaGxaQcIhY6Jjs7PTyM3eBLTmJmfBdWK18DOJC MsqlQ3e5zwbktYqD7BA3jH7o58W6g3ytPmtR3nFebp7tx+AoY9RgoOqOSguyXcz/dEMP 2BpwuhMfnNo76qoWH/eMgEPsihTCdqKMIaaKA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc; bh=X2TAOfXg7YoGOOnAQE+GYx8LSGd2JtQEi9WVmmO0/Fo=; b=gx2uUrZZSiADrAuLLabOOKf64MVDI/1OFtAES1ShqBGJvyM54V+raeOoKa94i1sxmU znmgPbIikYXqBrPUMQRoqt8AzycIWGi3CM4uQ7Bzegr03VUxhPuR9kUdvHVXqPGpu9q5 jyjpyL5ZKC11IU5cVpRL65a1DtVOWOZeD1sZ7wVW6aUhZM+YrwZIGewxP5vZoOM+iJgT nNteWYeVBVDnbMVlcxh2/DuCdu5zVF0BXo996hbiT6dauiAsJpgtUzkKSi7CeBawh/8j kDApNUCqPxQ5hnkJV4k5Pvx0TvWDRDh41pJwAW3LgSwKHLuCafTlZDMjpclanMnz00yf 97Gw== X-Gm-Message-State: ACgBeo16UcTcecNPw6UvZg899saBNskVEu/um4MGdMVOOODB2UHR1Ndd EsgPY2OWNkliB+YatZdYPSJKaCYkEiCaIA== X-Google-Smtp-Source: AA6agR4vEuLLauKz2ASnFhgHDnYA96W1kdHKHtTEhC55irWVIGObBKs5Haxyw1A2NeVouo1Mr4S57g== X-Received: by 2002:a05:600c:a08:b0:3a1:9319:ab78 with SMTP id z8-20020a05600c0a0800b003a19319ab78mr9343793wmp.158.1659705174200; Fri, 05 Aug 2022 06:12:54 -0700 (PDT) Received: from max.int.rpsys.net ([2001:8b0:aba:5f3c:f483:fcb0:1452:5a5a]) by smtp.gmail.com with ESMTPSA id p12-20020a05600c204c00b003a51a0d35e7sm1908901wmg.37.2022.08.05.06.12.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Aug 2022 06:12:53 -0700 (PDT) From: Richard Purdie To: openembedded-core@lists.openembedded.org Subject: [PATCH 02/29] populate_sdk_base: Disable rust SDK for MIPS n32 Date: Fri, 5 Aug 2022 14:12:25 +0100 Message-Id: <20220805131252.3706794-2-richard.purdie@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220805131252.3706794-1-richard.purdie@linuxfoundation.org> References: <20220805131252.3706794-1-richard.purdie@linuxfoundation.org> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 05 Aug 2022 13:13:00 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/168936 The n32 MIPS rust SDK doesn't quite build (libstd-rs fails with an llvm register issue). Disable it for now, someone with interest in having it working can fix if/as/when. Signed-off-by: Richard Purdie --- meta/classes/populate_sdk_base.bbclass | 1 + 1 file changed, 1 insertion(+) diff --git a/meta/classes/populate_sdk_base.bbclass b/meta/classes/populate_sdk_base.bbclass index f260217b508..0d1c6e18c4e 100644 --- a/meta/classes/populate_sdk_base.bbclass +++ b/meta/classes/populate_sdk_base.bbclass @@ -45,6 +45,7 @@ SDKTARGETSYSROOT = "${SDKPATH}/sysroots/${REAL_MULTIMACH_TARGET_SYS}" SDK_TOOLCHAIN_LANGS ??= "" SDK_TOOLCHAIN_LANGS:remove:sdkmingw32 = "rust" +SDK_TOOLCHAIN_LANGS:remove:mipsarchn32 = "rust" TOOLCHAIN_HOST_TASK ?= " \ nativesdk-packagegroup-sdk-host \ From patchwork Fri Aug 5 13:12:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 10999 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 998E3C25B0E for ; Fri, 5 Aug 2022 13:13:00 +0000 (UTC) Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) by mx.groups.io with SMTP id smtpd.web09.6778.1659705177065009322 for ; Fri, 05 Aug 2022 06:12:57 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=amGOCWJe; spf=pass (domain: linuxfoundation.org, ip: 209.85.221.53, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wr1-f53.google.com with SMTP id l22so3219057wrz.7 for ; Fri, 05 Aug 2022 06:12:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc; bh=z8VCMMuhxd8cDnuNmG/WOVtbmRjgYNio5gDnUyrN604=; b=amGOCWJe0TGxtex+NN7ziytgPaSFhcaJPKOlXo2b8iSjIygEwdoc4wwNKFNvmjkGqe N1hdEWgwVKGecNNcRlY0o/FLuShJ0ZGnIPdC6XOKXoj4O8/wtqKB61Su6E9GfOqYIITs aHmz3I2Tia/s7Kq0PLYT7YuBVzcHTvNXEcCcI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc; bh=z8VCMMuhxd8cDnuNmG/WOVtbmRjgYNio5gDnUyrN604=; b=hveuXf9175Midg+uBoG29ckkcZfWFLrlVQa+uJey8LCpjbfFlPiR8LjcfSblTPdOix EqTpsdJBPmeNDo6yFcvElujZAQNuqhtmcM70qZbx1hFyYvD3Q2jxv6AQtww6mff6lqNR 1I1+21mfXws0931xXEn85i1lU6NJ7j9USVJwXxntzzzPo8FtooGjdQwN22mHqvNjz6ym mJmhVEEso8riTSR8/Tn8UzSP1LQbkVf9sfOPFdhJZoOVcVo95YUFi2wTig7easxfc0C6 3xiEJBqbaR9hJS3Oon2rWuGOWamfSX+QawWnFBbpGyr5aBrsEPMNR+zgcqekD9Phn+Qo AmoA== X-Gm-Message-State: ACgBeo3JC9Iy06C//jQ3EpR5DC5n+CWCcd4qCJZfYgjl2sEsPd5NuqZa TawcU7iGaKupwI61sVG8vjMH5C0MDkzWPA== X-Google-Smtp-Source: AA6agR5vQiZagv3XB9joxfaI/vu/XNW+2snmu+aH0UK8Cnr+MrgMuPwRyswjDgnQE79iARjDYpzXPg== X-Received: by 2002:a05:6000:18ab:b0:220:6c0d:8157 with SMTP id b11-20020a05600018ab00b002206c0d8157mr4409816wri.438.1659705175185; Fri, 05 Aug 2022 06:12:55 -0700 (PDT) Received: from max.int.rpsys.net ([2001:8b0:aba:5f3c:f483:fcb0:1452:5a5a]) by smtp.gmail.com with ESMTPSA id p12-20020a05600c204c00b003a51a0d35e7sm1908901wmg.37.2022.08.05.06.12.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Aug 2022 06:12:54 -0700 (PDT) From: Richard Purdie To: openembedded-core@lists.openembedded.org Subject: [PATCH 03/29] selftest/reproducible: Exclude rust/rust-dbg for now until we can fix Date: Fri, 5 Aug 2022 14:12:26 +0100 Message-Id: <20220805131252.3706794-3-richard.purdie@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220805131252.3706794-1-richard.purdie@linuxfoundation.org> References: <20220805131252.3706794-1-richard.purdie@linuxfoundation.org> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 05 Aug 2022 13:13:00 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/168937 There looks to be a reproducibility issue left in one of the rust libraries. It doesn't appear to be a string issue but some binary problem. Disable rust from the reproducibility testing until we can get to the bottom of the issue (allowing wider testing of all the other improvements). Signed-off-by: Richard Purdie --- meta/lib/oeqa/selftest/cases/reproducible.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/meta/lib/oeqa/selftest/cases/reproducible.py b/meta/lib/oeqa/selftest/cases/reproducible.py index 5042c11d8eb..f4dd779842a 100644 --- a/meta/lib/oeqa/selftest/cases/reproducible.py +++ b/meta/lib/oeqa/selftest/cases/reproducible.py @@ -16,6 +16,8 @@ import os import datetime exclude_packages = [ + 'rust', + 'rust-dbg' ] def is_excluded(package): From patchwork Fri Aug 5 13:12:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 10997 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 94A4FC25B0C for ; Fri, 5 Aug 2022 13:13:00 +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.web10.6822.1659705177741602045 for ; Fri, 05 Aug 2022 06:12:58 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=P3bPv10i; spf=pass (domain: linuxfoundation.org, ip: 209.85.128.41, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wm1-f41.google.com with SMTP id s13so945783wmj.1 for ; Fri, 05 Aug 2022 06:12:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc; bh=/VNfTvvRP2tVIcduShLynaJvw4nC9PjXv8eT1DXFwe4=; b=P3bPv10i0TsBuG9h8rAFZ1Tvz3g0tenb0VOMuqES8yrVn/MpNnWZjaWS5iX672hk7e Z6i7/2M0nDH7qLSL92+K4ew9K4TxXqaFoxZpdRzc81ct4PPw6RwBLsFKvvDhvqpZ8UYZ HD/9lFXnO7faJ9XP3xKXHeiae9kjUMqpLzhDI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc; bh=/VNfTvvRP2tVIcduShLynaJvw4nC9PjXv8eT1DXFwe4=; b=qm08QrQItN1toKiaUfT4bjcIoS1k1Be1MvMUKN9cmvrV6u4FqL73uvn9RpcrPUMNXr RQ9cXXYIRrCwz/PFyBHWEXtsVK5KHgQim8P+uYxdbnKwoeWAtlONIvopmKNoyr4fWwo0 yrS1rrFuiIZ0+Wi0rnR/cmHra10xoqXN+uLlU0JCSDqL7nK6enc0SFyiJPCGRxHx8gOP fORulT0hk4SiIZd8evCePB3H0BgBi5hvuPrQo7kYmyzleeIuybXlRUylHRSCEspSScPC L8e+5R28Mngp9Bz2X4Sk8fQVU1TFOg/zwfRWF5Ng96sQz2ORaGwhjiSytxM9EFA1oNSt SUgw== X-Gm-Message-State: ACgBeo378+wt4hSJ6xptJwYM2TLLGy3fQ1iUgRnWEjb24kYGs8ABBQ5j S/am6Vu6fiq3Gcd/pgcwU1YUIiFVZla2uA== X-Google-Smtp-Source: AA6agR5VcpbLQ7Sfe48w1HhNJ1w3l4TlcB933b8n0evA4zG7NWr/SZSTzw3hwQf7WCM5bk7xLVYT8Q== X-Received: by 2002:a05:600c:154f:b0:3a3:4383:e1eb with SMTP id f15-20020a05600c154f00b003a34383e1ebmr4705797wmg.111.1659705175966; Fri, 05 Aug 2022 06:12:55 -0700 (PDT) Received: from max.int.rpsys.net ([2001:8b0:aba:5f3c:f483:fcb0:1452:5a5a]) by smtp.gmail.com with ESMTPSA id p12-20020a05600c204c00b003a51a0d35e7sm1908901wmg.37.2022.08.05.06.12.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Aug 2022 06:12:55 -0700 (PDT) From: Richard Purdie To: openembedded-core@lists.openembedded.org Subject: [PATCH 04/29] conf/distro/no-static-libs: Allow static musl for rust Date: Fri, 5 Aug 2022 14:12:27 +0100 Message-Id: <20220805131252.3706794-4-richard.purdie@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220805131252.3706794-1-richard.purdie@linuxfoundation.org> References: <20220805131252.3706794-1-richard.purdie@linuxfoundation.org> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 05 Aug 2022 13:13:00 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/168938 When building rust for musl targets we need the static library from musl, so enable it. Signed-off-by: Richard Purdie --- meta/conf/distro/include/no-static-libs.inc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/meta/conf/distro/include/no-static-libs.inc b/meta/conf/distro/include/no-static-libs.inc index ee673834601..75359928a14 100644 --- a/meta/conf/distro/include/no-static-libs.inc +++ b/meta/conf/distro/include/no-static-libs.inc @@ -18,6 +18,8 @@ DISABLE_STATIC:pn-nativesdk-openssl = "" DISABLE_STATIC:pn-gcc-runtime = "" # libusb1-native is used to build static dfu-util-native DISABLE_STATIC:pn-libusb1-native = "" +# needed by rust +DISABLE_STATIC:pn-musl = "" EXTRA_OECONF:append = "${DISABLE_STATIC}" From patchwork Fri Aug 5 13:12:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 10994 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 8A43DC3F6B0 for ; Fri, 5 Aug 2022 13:13:00 +0000 (UTC) Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) by mx.groups.io with SMTP id smtpd.web08.6583.1659705178597213530 for ; Fri, 05 Aug 2022 06:12:58 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=I3riGE0o; spf=pass (domain: linuxfoundation.org, ip: 209.85.221.51, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wr1-f51.google.com with SMTP id v3so3295687wrp.0 for ; Fri, 05 Aug 2022 06:12:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc; bh=IrvSfJ+YeswSk+3a+1A7l/D72zYt33glfMsW475vj9g=; b=I3riGE0od5iMNX7n/Li94BeRHNVS3Ed7o0DaAEJ+sHrbs5/fUDIWkp5W4Dr99AtMvf w76KCXL+YtmmMLuOZoOoxiMkkBw7NQ0Z7vHbiVjrBwNGopTWcFgHBzSi7YlLwi+0yHss jExI8ZVWhfcWms/OataOjlhinCK0dWL6e0snU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc; bh=IrvSfJ+YeswSk+3a+1A7l/D72zYt33glfMsW475vj9g=; b=DW3vPPQV/fvBcHoY0PnoD4U7Fdxv0ugrtgHWfLkuspfKR8nI/GaHGnWrG9WzMEVcqu paIXhoXXgEierfyXLWX2CfiowBtmJgz5Rvrlsf56Y3lPpWoFzMuMtL6NTj+9TYQozenW gEwBKJveiwLQrqOUbStPY489Ay1MY6rvlW8n99BIIzTKgAih89Hinmu4gvbi5w1f/uZZ DbPWFhoYMebaIiHqT3c4CkiX6UXhA4MyTvi4EXKu+Efe5Jx/mL3AHnIxEXLDM1mecT/n ZCJcvsC4QsVQN0dX2kf5aYVh6G1HtUPzMkgMBTGLTcI/yJCbmKUZzRvxcRMb1t1S+OXM U8rg== X-Gm-Message-State: ACgBeo1i6PunlBsWJrGlEEH+sqxmoQfjekLMOltqDDGPIdyrAKjPIm+d TRvegOiZOm7CvkqCAf2xlowge06UGLIhVA== X-Google-Smtp-Source: AA6agR7SH9oxMIo2u5menkqa82/YFVOXqlvpF/ikjXjmqqCnx1enxZVM1ZAAZzv/R0QTZS0wNS03Xw== X-Received: by 2002:a05:6000:1a89:b0:21d:ab1a:b19b with SMTP id f9-20020a0560001a8900b0021dab1ab19bmr4492168wry.78.1659705176903; Fri, 05 Aug 2022 06:12:56 -0700 (PDT) Received: from max.int.rpsys.net ([2001:8b0:aba:5f3c:f483:fcb0:1452:5a5a]) by smtp.gmail.com with ESMTPSA id p12-20020a05600c204c00b003a51a0d35e7sm1908901wmg.37.2022.08.05.06.12.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Aug 2022 06:12:56 -0700 (PDT) From: Richard Purdie To: openembedded-core@lists.openembedded.org Subject: [PATCH 05/29] rust-target-config: Add mips n32 best guess at target information Date: Fri, 5 Aug 2022 14:12:28 +0100 Message-Id: <20220805131252.3706794-5-richard.purdie@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220805131252.3706794-1-richard.purdie@linuxfoundation.org> References: <20220805131252.3706794-1-richard.purdie@linuxfoundation.org> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 05 Aug 2022 13:13:00 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/168939 Add a best guess at MIPS n32 target information. This might not be 100% correct but is something to start from at least. Signed-off-by: Richard Purdie --- meta/classes/rust-target-config.bbclass | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/meta/classes/rust-target-config.bbclass b/meta/classes/rust-target-config.bbclass index 87b7dee3edc..1721839922e 100644 --- a/meta/classes/rust-target-config.bbclass +++ b/meta/classes/rust-target-config.bbclass @@ -190,6 +190,13 @@ TARGET_POINTER_WIDTH[mips64] = "64" TARGET_C_INT_WIDTH[mips64] = "64" MAX_ATOMIC_WIDTH[mips64] = "64" +## mips64-n32-unknown-linux-{gnu, musl} +DATA_LAYOUT[mips64-n32] = "E-m:e-p:32:32-i8:8:32-i16:16:32-i64:64-n32:64-S128" +TARGET_ENDIAN[mips64-n32] = "big" +TARGET_POINTER_WIDTH[mips64-n32] = "32" +TARGET_C_INT_WIDTH[mips64-n32] = "32" +MAX_ATOMIC_WIDTH[mips64-n32] = "64" + ## mips64el-unknown-linux-{gnu, musl} DATA_LAYOUT[mips64el] = "e-m:e-i8:8:32-i16:16:32-i64:64-n32:64-S128" TARGET_ENDIAN[mips64el] = "little" From patchwork Fri Aug 5 13:12:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 10998 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 8C565C25B08 for ; Fri, 5 Aug 2022 13:13:00 +0000 (UTC) Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) by mx.groups.io with SMTP id smtpd.web08.6584.1659705179496665197 for ; Fri, 05 Aug 2022 06:12:59 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=TI52ohua; spf=pass (domain: linuxfoundation.org, ip: 209.85.221.42, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wr1-f42.google.com with SMTP id j15so3235698wrr.2 for ; Fri, 05 Aug 2022 06:12:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc; bh=03zbOk/SycMP5bSYDUCVgcenomjajyfdszYVXBxpRBg=; b=TI52ohuaazAUc2zO+DdbG3JKqmT9Hf4jYNAGUTEaIiNKWSIL3tQjlxdqV5gvCZWkXJ SG6izbLHsKVpobBWHJbg1JLUfG6KXMLZ/pcz8lBYz9EMhG8+gTQoDBtMhSsnlmwXXdx0 2Q/MufIuDOxiyH2DWEKYf9Ll5BGhQ2lYdnkPo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc; bh=03zbOk/SycMP5bSYDUCVgcenomjajyfdszYVXBxpRBg=; b=iSFg5AfUsQSkSc5kynLl4cX/2iVwexiKYDnE8AY46YkfBq13YHz93VxXyPoJXW1QB3 WiyxBEVXA7X4U89RiDj6goxsQYKGByRo+ecFDtlcvLtQfp8sAes/hesYNaj+TW4NwOQq jWDIiuTDjIiocT7lAJ8o0u7jo1aOnTpEhCsf7aUuc1JeGJfYpTxE1li6L8AjagLjuV9y 9DVULiygwqzkV5f35skQUCJi0UAgEgKvUlpDi6YfHdMouAd9WgH5j2D8/fCpTnLQrpVv BLLNkUON2bJMIhAglneD9wkFfjk+9E0p6EkhbBHhlYOvjlQQCuM8gQKZ0FAq7OS8krx8 Bdvw== X-Gm-Message-State: ACgBeo2qR3GQRNeM5l5l/199pge8PFLRS6XWGTOudTrPso0KArWWlaZX DSddd8kKGQ+HpotVoupgg+z8Fq8PXJAM7w== X-Google-Smtp-Source: AA6agR6EBR+0+N9eTqH5C8I0PwIPVprk76xzWkQ4VBMtXcf7TRimTQ+BSrGu9I0T8Kq44y13nr5NZg== X-Received: by 2002:a5d:6746:0:b0:221:76b8:b8d1 with SMTP id l6-20020a5d6746000000b0022176b8b8d1mr1406107wrw.710.1659705177822; Fri, 05 Aug 2022 06:12:57 -0700 (PDT) Received: from max.int.rpsys.net ([2001:8b0:aba:5f3c:f483:fcb0:1452:5a5a]) by smtp.gmail.com with ESMTPSA id p12-20020a05600c204c00b003a51a0d35e7sm1908901wmg.37.2022.08.05.06.12.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Aug 2022 06:12:57 -0700 (PDT) From: Richard Purdie To: openembedded-core@lists.openembedded.org Subject: [PATCH 06/29] rust-common: Add CXXFLAGS Date: Fri, 5 Aug 2022 14:12:29 +0100 Message-Id: <20220805131252.3706794-6-richard.purdie@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220805131252.3706794-1-richard.purdie@linuxfoundation.org> References: <20220805131252.3706794-1-richard.purdie@linuxfoundation.org> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 05 Aug 2022 13:13:00 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/168940 Similarly to CC and CCLD, handle CXX flags too. Signed-off-by: Richard Purdie --- meta/classes/rust-common.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/classes/rust-common.bbclass b/meta/classes/rust-common.bbclass index cb811ac5da7..0c9363b31a1 100644 --- a/meta/classes/rust-common.bbclass +++ b/meta/classes/rust-common.bbclass @@ -177,7 +177,7 @@ do_rust_create_wrappers () { # Yocto Target / Rust Target C compiler create_wrapper "${RUST_TARGET_CC}" "${WRAPPER_TARGET_CC}" "${WRAPPER_TARGET_LDFLAGS}" # Yocto Target / Rust Target C++ compiler - create_wrapper "${RUST_TARGET_CXX}" "${WRAPPER_TARGET_CXX}" + create_wrapper "${RUST_TARGET_CXX}" "${WRAPPER_TARGET_CXX}" "${CXXFLAGS}" # Yocto Target / Rust Target linker create_wrapper "${RUST_TARGET_CCLD}" "${WRAPPER_TARGET_CCLD}" "${WRAPPER_TARGET_LDFLAGS}" # Yocto Target / Rust Target archiver From patchwork Fri Aug 5 13:12:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 11000 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 6D887C00140 for ; Fri, 5 Aug 2022 13:13:10 +0000 (UTC) Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) by mx.groups.io with SMTP id smtpd.web12.6770.1659705180369431073 for ; Fri, 05 Aug 2022 06:13:00 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=a95SOqho; spf=pass (domain: linuxfoundation.org, ip: 209.85.221.44, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wr1-f44.google.com with SMTP id v3so3295770wrp.0 for ; Fri, 05 Aug 2022 06:13:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc; bh=X0ddlNTM7x3TqGetYwP3c0jqPQVAIatsfShG4OmIc34=; b=a95SOqho7YZIxRTzJs9ZbS3vxyYSdCqguOw4TamYzkEGhAMSZphwOBK1UkJSl6arRF FZB08iirA3qWJo1sV3T5HMGT8rv/nKcX6oKxpJ/uXnmhOpcDRL8yKUOYbGKL3GwUj5kf wlGVHHF3W1DWKoEDbc4L8h540xSNq3FNv16O8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc; bh=X0ddlNTM7x3TqGetYwP3c0jqPQVAIatsfShG4OmIc34=; b=yiKIkXu3u8g3GwY3W3qdDxltiV1JdLBIPQKkSF0uJnlppBC3BmBS5BHIrDqmlnG2ch fmJJ8/zvrcE4kRsWzqwoeq9Bh8UA3XD9Ft/G8izl1b2tPhOb9YJvsXU6ZZTJOCft8byf jlR+C3bElMkQgNbu5HIgA0I6IaM3yE97WFhMe1ehGwMn2yaWPtMGr0kb+agnKPa+mLQA VYg1vqa4rhuDIaznjxCUDj7Vhu92MIgwVA0RQ8YyfKmOpkpG+5/GR5X/0dPmdK/O2dRD tws+xfLGwf+hshOsJvFEUqlfMNQB5psipcwndgw6Ow4ERmqXmxgTYgQZfF+dKaJkmNtp BZsw== X-Gm-Message-State: ACgBeo1OxtMzSq2CMQfbneHHGuZTrJoJbyghZaT6JUYIlWfTraUZ0PED J+R1wVRyi9HyGVWRZt7IodnpgJL9hnbHbA== X-Google-Smtp-Source: AA6agR4IVR1ifQTeFp/Jgr58nmCB8peGJtyyEhV2HbpJxfXqmMJB0AjcbTI1vfyw6RZ3M71Cr+JpTQ== X-Received: by 2002:adf:fb10:0:b0:207:af88:1eb9 with SMTP id c16-20020adffb10000000b00207af881eb9mr4355795wrr.238.1659705178691; Fri, 05 Aug 2022 06:12:58 -0700 (PDT) Received: from max.int.rpsys.net ([2001:8b0:aba:5f3c:f483:fcb0:1452:5a5a]) by smtp.gmail.com with ESMTPSA id p12-20020a05600c204c00b003a51a0d35e7sm1908901wmg.37.2022.08.05.06.12.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Aug 2022 06:12:58 -0700 (PDT) From: Richard Purdie To: openembedded-core@lists.openembedded.org Subject: [PATCH 07/29] rust-common: Drop export directive from wrappers Date: Fri, 5 Aug 2022 14:12:30 +0100 Message-Id: <20220805131252.3706794-7-richard.purdie@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220805131252.3706794-1-richard.purdie@linuxfoundation.org> References: <20220805131252.3706794-1-richard.purdie@linuxfoundation.org> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 05 Aug 2022 13:13:10 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/168941 These variables don't need to be exported into the environment, which reduces the scope of rebuilds when variable values change. Signed-off-by: Richard Purdie --- meta/classes/rust-common.bbclass | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/meta/classes/rust-common.bbclass b/meta/classes/rust-common.bbclass index 0c9363b31a1..b79a829462c 100644 --- a/meta/classes/rust-common.bbclass +++ b/meta/classes/rust-common.bbclass @@ -153,11 +153,11 @@ create_wrapper () { chmod +x "${file}" } -export WRAPPER_TARGET_CC = "${CC}" -export WRAPPER_TARGET_CXX = "${CXX}" -export WRAPPER_TARGET_CCLD = "${CCLD}" -export WRAPPER_TARGET_LDFLAGS = "${LDFLAGS}" -export WRAPPER_TARGET_AR = "${AR}" +WRAPPER_TARGET_CC = "${CC}" +WRAPPER_TARGET_CXX = "${CXX}" +WRAPPER_TARGET_CCLD = "${CCLD}" +WRAPPER_TARGET_LDFLAGS = "${LDFLAGS}" +WRAPPER_TARGET_AR = "${AR}" # compiler is used by gcc-rs # linker is used by rustc/cargo From patchwork Fri Aug 5 13:12:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 11008 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 90A33C282E7 for ; Fri, 5 Aug 2022 13:13:10 +0000 (UTC) Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) by mx.groups.io with SMTP id smtpd.web12.6771.1659705181226824020 for ; Fri, 05 Aug 2022 06:13:01 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=BRajBH3C; spf=pass (domain: linuxfoundation.org, ip: 209.85.128.42, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wm1-f42.google.com with SMTP id i128-20020a1c3b86000000b003a3a22178beso3958400wma.3 for ; Fri, 05 Aug 2022 06:13:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc; bh=K6DtOh7EoROS8kNyDWx2h1QFJhoL30l0OmGvFv8rZB8=; b=BRajBH3C2Zj8DVfwBMDy78NVvGwPbeYrC2RPAfl/B+MFdDrNWGQZriUBGD85ZI8dzE /ydDiBHVaNaodTxW+d5P4fbJZKAFsZxkcL8p2W0TjYUd/JzkqYZPH5FIgg5nl+xmm3dt 11ejHkFsCc6yFbAzx7915zEhIJ+JPtBl1qg4g= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc; bh=K6DtOh7EoROS8kNyDWx2h1QFJhoL30l0OmGvFv8rZB8=; b=HqU5mFZxTKR9t3wF3FR+bbCUB3RgKaDkIR9rSePE7LJz+cGOKXeIQ39aWWIpOfGdnC U90+RQA6lo15ZiRiLy8Tl6dE5YMNhev+BtQ/2GJbEBI1LDYvj0gZuMzviRLlQZQ08voc 55QT667CjvPHxbLy0cZP2ELjNVqKTWBKi4NVVP8CQ7gcS2rZ4N+KVYp9agt0C1XjLPzd vz+UMK/DGgj6iLFf3Lz861P3CxVXncbPfRlRf0VwcgwamJk22w0PpgL2HDwUdVi0SCTT QUNGlkID8BMrTlAwIXH8u3qr8YkwLgVoWGdJcYn2tWppkymJc83JyJrjhEBE8xeue6kH m2sA== X-Gm-Message-State: ACgBeo1fK+0cdjEAgr7PZIcuEe03NcncGKh7WMRcOR8iWOYNY9Bpj7gY KYezbZdlJpYe+Cs9PvySOlslsikAeX8LCg== X-Google-Smtp-Source: AA6agR5207I0sZkLw+t+O47NMs0A8huZiPMEOtMi/RN4q/9EjKLz+RgDdWsnfxgLrQqp9HcvXWsm7Q== X-Received: by 2002:a05:600c:35d5:b0:3a3:2490:c984 with SMTP id r21-20020a05600c35d500b003a32490c984mr9888759wmq.162.1659705179440; Fri, 05 Aug 2022 06:12:59 -0700 (PDT) Received: from max.int.rpsys.net ([2001:8b0:aba:5f3c:f483:fcb0:1452:5a5a]) by smtp.gmail.com with ESMTPSA id p12-20020a05600c204c00b003a51a0d35e7sm1908901wmg.37.2022.08.05.06.12.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Aug 2022 06:12:58 -0700 (PDT) From: Richard Purdie To: openembedded-core@lists.openembedded.org Subject: [PATCH 08/29] rust-common: Rework wrappers top handle musl Date: Fri, 5 Aug 2022 14:12:31 +0100 Message-Id: <20220805131252.3706794-8-richard.purdie@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220805131252.3706794-1-richard.purdie@linuxfoundation.org> References: <20220805131252.3706794-1-richard.purdie@linuxfoundation.org> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 05 Aug 2022 13:13:10 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/168942 For musl we need to be able to add a library to the end of the linker commandline. Rework the wrapper code to be able to do this through a new variable. Signed-off-by: Richard Purdie --- meta/classes/rust-common.bbclass | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/meta/classes/rust-common.bbclass b/meta/classes/rust-common.bbclass index b79a829462c..1bce7761ab0 100644 --- a/meta/classes/rust-common.bbclass +++ b/meta/classes/rust-common.bbclass @@ -141,13 +141,18 @@ RUST_TARGET_AR = "${WRAPPER_DIR}/target-rust-ar" create_wrapper () { file="$1" shift + extras="$1" + shift cat <<- EOF > "${file}" #!/usr/bin/env python3 import os, sys orig_binary = "$@" + extras = "${extras}" binary = orig_binary.split()[0] args = orig_binary.split() + sys.argv[1:] + if extras: + args.append(extras) os.execvp(binary, args) EOF chmod +x "${file}" @@ -157,6 +162,7 @@ WRAPPER_TARGET_CC = "${CC}" WRAPPER_TARGET_CXX = "${CXX}" WRAPPER_TARGET_CCLD = "${CCLD}" WRAPPER_TARGET_LDFLAGS = "${LDFLAGS}" +WRAPPER_TARGET_EXTRALD = "" WRAPPER_TARGET_AR = "${AR}" # compiler is used by gcc-rs @@ -166,22 +172,22 @@ do_rust_create_wrappers () { mkdir -p "${WRAPPER_DIR}" # Yocto Build / Rust Host C compiler - create_wrapper "${RUST_BUILD_CC}" "${BUILD_CC}" + create_wrapper "${RUST_BUILD_CC}" "" "${BUILD_CC}" # Yocto Build / Rust Host C++ compiler - create_wrapper "${RUST_BUILD_CXX}" "${BUILD_CXX}" + create_wrapper "${RUST_BUILD_CXX}" "" "${BUILD_CXX}" # Yocto Build / Rust Host linker - create_wrapper "${RUST_BUILD_CCLD}" "${BUILD_CCLD}" "${BUILD_LDFLAGS}" + create_wrapper "${RUST_BUILD_CCLD}" "" "${BUILD_CCLD}" "${BUILD_LDFLAGS}" # Yocto Build / Rust Host archiver - create_wrapper "${RUST_BUILD_AR}" "${BUILD_AR}" + create_wrapper "${RUST_BUILD_AR}" "" "${BUILD_AR}" # Yocto Target / Rust Target C compiler - create_wrapper "${RUST_TARGET_CC}" "${WRAPPER_TARGET_CC}" "${WRAPPER_TARGET_LDFLAGS}" + create_wrapper "${RUST_TARGET_CC}" "${WRAPPER_TARGET_EXTRALD}" "${WRAPPER_TARGET_CC}" "${WRAPPER_TARGET_LDFLAGS}" # Yocto Target / Rust Target C++ compiler - create_wrapper "${RUST_TARGET_CXX}" "${WRAPPER_TARGET_CXX}" "${CXXFLAGS}" + create_wrapper "${RUST_TARGET_CXX}" "${WRAPPER_TARGET_EXTRALD}" "${WRAPPER_TARGET_CXX}" "${CXXFLAGS}" # Yocto Target / Rust Target linker - create_wrapper "${RUST_TARGET_CCLD}" "${WRAPPER_TARGET_CCLD}" "${WRAPPER_TARGET_LDFLAGS}" + create_wrapper "${RUST_TARGET_CCLD}" "${WRAPPER_TARGET_EXTRALD}" "${WRAPPER_TARGET_CCLD}" "${WRAPPER_TARGET_LDFLAGS}" # Yocto Target / Rust Target archiver - create_wrapper "${RUST_TARGET_AR}" "${WRAPPER_TARGET_AR}" + create_wrapper "${RUST_TARGET_AR}" "" "${WRAPPER_TARGET_AR}" } From patchwork Fri Aug 5 13:12:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 11007 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 9072BC25B0E for ; Fri, 5 Aug 2022 13:13:10 +0000 (UTC) Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) by mx.groups.io with SMTP id smtpd.web11.6692.1659705182370809358 for ; Fri, 05 Aug 2022 06:13:02 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=eDFw5hgI; spf=pass (domain: linuxfoundation.org, ip: 209.85.128.42, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wm1-f42.google.com with SMTP id ay36-20020a05600c1e2400b003a4e30d7995so3957739wmb.5 for ; Fri, 05 Aug 2022 06:13:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc; bh=LmkYEAokNaJuJXug+JWHszklKGaWZXCjJ4kbVyuUr9A=; b=eDFw5hgIU4kV0YaxBPZ8xn1CZcJ1J1WPqdkGiIRh+uZV1ndQysJW8AZUzvCnEuavvy yi1csLrRQKbzKwMsb/jtXXYAoiTuMKapnJU4oZ2ZTodMqpxaz0wws3iEKEzsKtzXF+mT L506isByLggtYMrCNgmAv6w1RfCYjDb+L2FL8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc; bh=LmkYEAokNaJuJXug+JWHszklKGaWZXCjJ4kbVyuUr9A=; b=ScozeBZ3ATJCAXVo5NvXn4R5kFuaFQlsbPz3hHpitoSO7VDLT6tOsCKZs/6n7mGZLa vEugfOjvRwK6xKRewquBwcd31dntk51v84CKEBSuK7sABfKy0tH6iAKE2Fy5ZFrMUnhf PqPGGuHXB06FQqAGeWNopOX3vY9CrZUqLeZJ9JRITJ4UO48kAONIZZgPAO2r2/BQGndH bXhZP59T2PBuokJ+XEOg+mapZYYsErlp+y5lJuNHEGUgikFe4QSZuMQ0X9WNKj4Qqg3u Bhcax6u1/QZprIJZjbfpfDwdn7SPfanzrDWmcQh22ynM8iCQ1DUy40keZX1HUqnGrK35 dD2A== X-Gm-Message-State: ACgBeo3HUBtIk0U131CT8guibExj2e/gNUTD/2MAYnqLwlWykuFs8lXU JuJKXFwYexzpaK1eVnHOzOjhlX/7N53Jrw== X-Google-Smtp-Source: AA6agR4gpEULt25Wn7IcD240JxX6gSEezSMyaLyeFOooTPrYJu99JfiRzrh/Bj5+sWstLhBrtGAr6A== X-Received: by 2002:a05:600c:3045:b0:3a5:16a8:77c0 with SMTP id n5-20020a05600c304500b003a516a877c0mr2958443wmh.83.1659705180342; Fri, 05 Aug 2022 06:13:00 -0700 (PDT) Received: from max.int.rpsys.net ([2001:8b0:aba:5f3c:f483:fcb0:1452:5a5a]) by smtp.gmail.com with ESMTPSA id p12-20020a05600c204c00b003a51a0d35e7sm1908901wmg.37.2022.08.05.06.12.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Aug 2022 06:12:59 -0700 (PDT) From: Richard Purdie To: openembedded-core@lists.openembedded.org Subject: [PATCH 09/29] rust: Work around reproducibility issues Date: Fri, 5 Aug 2022 14:12:32 +0100 Message-Id: <20220805131252.3706794-9-richard.purdie@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220805131252.3706794-1-richard.purdie@linuxfoundation.org> References: <20220805131252.3706794-1-richard.purdie@linuxfoundation.org> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 05 Aug 2022 13:13:10 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/168943 Add a patch which removes the sections of code which encode buildpaths. Whilst not ideal, the patches at least show where the problematic data is coming from and should allow more focused work to resovle it by someone who has a better understanding of rust and what this code is doing. It does look unlikely we actually need this code in our usecases anyway. Signed-off-by: Richard Purdie --- meta/recipes-devtools/rust/rust-source.inc | 3 + .../rust/rust/hardcodepaths.patch | 70 +++++++++++++++++++ 2 files changed, 73 insertions(+) create mode 100644 meta/recipes-devtools/rust/rust/hardcodepaths.patch diff --git a/meta/recipes-devtools/rust/rust-source.inc b/meta/recipes-devtools/rust/rust-source.inc index fda26534e88..b814574e55f 100644 --- a/meta/recipes-devtools/rust/rust-source.inc +++ b/meta/recipes-devtools/rust/rust-source.inc @@ -1,6 +1,9 @@ SRC_URI += "https://static.rust-lang.org/dist/rustc-${PV}-src.tar.xz;name=rust" SRC_URI[rust.sha256sum] = "6c00ef115c894c2645e60b5049a4f5dacf1dc0c993f3074f7ae4fdf4c755dd5e" +SRC_URI:append:class-target:pn-rust = " file://hardcodepaths.patch" +SRC_URI:append:class-nativesdk:pn-nativesdk-rust = " file://hardcodepaths.patch" + RUSTSRC = "${WORKDIR}/rustc-${PV}-src" UPSTREAM_CHECK_URI = "https://forge.rust-lang.org/infra/other-installation-methods.html" diff --git a/meta/recipes-devtools/rust/rust/hardcodepaths.patch b/meta/recipes-devtools/rust/rust/hardcodepaths.patch new file mode 100644 index 00000000000..2fdfe6d4637 --- /dev/null +++ b/meta/recipes-devtools/rust/rust/hardcodepaths.patch @@ -0,0 +1,70 @@ +When building for the target, some build paths end up embedded in the binaries. +These changes remove that. Further investigation is needed to work out the way +to resolve these issues properly upstream. + +Upstream-Status: Inappropriate [patches need rework] +Signed-off-by: Richard Purdie + +Index: rustc-1.62.0-src/src/tools/clippy/src/driver.rs +=================================================================== +--- rustc-1.62.0-src.orig/src/tools/clippy/src/driver.rs ++++ rustc-1.62.0-src/src/tools/clippy/src/driver.rs +@@ -255,7 +255,6 @@ pub fn main() { + .and_then(|out| String::from_utf8(out.stdout).ok()) + .map(|s| PathBuf::from(s.trim())) + }) +- .or_else(|| option_env!("SYSROOT").map(PathBuf::from)) + .or_else(|| { + let home = option_env!("RUSTUP_HOME") + .or(option_env!("MULTIRUST_HOME")) +Index: rustc-1.62.0-src/compiler/rustc_codegen_llvm/src/context.rs +=================================================================== +--- rustc-1.62.0-src.orig/compiler/rustc_codegen_llvm/src/context.rs ++++ rustc-1.62.0-src/compiler/rustc_codegen_llvm/src/context.rs +@@ -167,46 +167,6 @@ pub unsafe fn create_module<'ll>( + } + } + +- // Ensure the data-layout values hardcoded remain the defaults. +- if sess.target.is_builtin { +- let tm = crate::back::write::create_informational_target_machine(tcx.sess); +- llvm::LLVMRustSetDataLayoutFromTargetMachine(llmod, tm); +- llvm::LLVMRustDisposeTargetMachine(tm); +- +- let llvm_data_layout = llvm::LLVMGetDataLayoutStr(llmod); +- let llvm_data_layout = str::from_utf8(CStr::from_ptr(llvm_data_layout).to_bytes()) +- .expect("got a non-UTF8 data-layout from LLVM"); +- +- // Unfortunately LLVM target specs change over time, and right now we +- // don't have proper support to work with any more than one +- // `data_layout` than the one that is in the rust-lang/rust repo. If +- // this compiler is configured against a custom LLVM, we may have a +- // differing data layout, even though we should update our own to use +- // that one. +- // +- // As an interim hack, if CFG_LLVM_ROOT is not an empty string then we +- // disable this check entirely as we may be configured with something +- // that has a different target layout. +- // +- // Unsure if this will actually cause breakage when rustc is configured +- // as such. +- // +- // FIXME(#34960) +- let cfg_llvm_root = option_env!("CFG_LLVM_ROOT").unwrap_or(""); +- let custom_llvm_used = cfg_llvm_root.trim() != ""; +- +- if !custom_llvm_used && target_data_layout != llvm_data_layout { +- bug!( +- "data-layout for target `{rustc_target}`, `{rustc_layout}`, \ +- differs from LLVM target's `{llvm_target}` default layout, `{llvm_layout}`", +- rustc_target = sess.opts.target_triple, +- rustc_layout = target_data_layout, +- llvm_target = sess.target.llvm_target, +- llvm_layout = llvm_data_layout +- ); +- } +- } +- + let data_layout = SmallCStr::new(&target_data_layout); + llvm::LLVMSetDataLayout(llmod, data_layout.as_ptr()); + From patchwork Fri Aug 5 13:12:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 11003 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 84844C25B0C for ; Fri, 5 Aug 2022 13:13:10 +0000 (UTC) Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) by mx.groups.io with SMTP id smtpd.web12.6768.1659705176182557441 for ; Fri, 05 Aug 2022 06:13:03 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=WhWrWn2J; spf=pass (domain: linuxfoundation.org, ip: 209.85.128.54, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wm1-f54.google.com with SMTP id b6so1389924wmq.5 for ; Fri, 05 Aug 2022 06:13:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc; bh=hURljutyvnLW8LR0znv4/ymez9sYqd22RUfIm2r5rz4=; b=WhWrWn2JjXNmU33/lAmJ4cOyjNtYo2PzTYMPVQl1iXWxzaoWnX0F+/0fNE3YV6llbj jubEsvExkPsGpj49LKF/s9zsF3xtwoNmcBIEJJf0ELao9cn4MzzyGB2LQombi78OhBHp yi/Pec44OIoQ5q+DOH5HkKtD3pDtX8rVi+FbA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc; bh=hURljutyvnLW8LR0znv4/ymez9sYqd22RUfIm2r5rz4=; b=TakmUJXllIHueeJgDz3qH1ynKZ2rBZ6JZMrUpKQmPJg/ag0xdg51B61s1pRcYhQhHa LI7DRmMougLSg3fyIMACcejHtIgqw+f8CKGzDTppUG3qFYT9NC7soGGmvTeJvhPinskA mJZVgJTmnKHfpfefmhuvM8lGRhEKGYKWfwP9kaOYtKR/wxm2Rr62sSSSyFTi5AHvnET6 GIk/waB/QilbSYkZi7dWO8haotEXI0WnByozBrjB95X7SINpNdsHaPlRPthMjoaXxL5d kZ1QdvU4MZHz8S+KdMxLixA/hZNYGjjdIn+hDTU4tbEYXLMMnFgmvhIOj0Sk2igBfiZn +3gQ== X-Gm-Message-State: ACgBeo0hq33ooMHUjG3x0odCb7Ywd+g0lHMbYjtx385LcuHL84Vc2NyH bCfo2vvVKzhg631g4kAgJ4AF5fM7kz8qEQ== X-Google-Smtp-Source: AA6agR6gQrr+64Nmu9jmuygC6wDNBq4yCe0Rlt3/82LxS/7wVaWHrL7sgeRYFAs6sge+ax5a2BZVaA== X-Received: by 2002:a7b:cd0f:0:b0:3a5:1fed:ff86 with SMTP id f15-20020a7bcd0f000000b003a51fedff86mr1664029wmj.197.1659705182037; Fri, 05 Aug 2022 06:13:02 -0700 (PDT) Received: from max.int.rpsys.net ([2001:8b0:aba:5f3c:f483:fcb0:1452:5a5a]) by smtp.gmail.com with ESMTPSA id p12-20020a05600c204c00b003a51a0d35e7sm1908901wmg.37.2022.08.05.06.13.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Aug 2022 06:13:01 -0700 (PDT) From: Richard Purdie To: openembedded-core@lists.openembedded.org Subject: [PATCH 10/29] rust: Switch to use RUST_XXX_SYS consistently Date: Fri, 5 Aug 2022 14:12:33 +0100 Message-Id: <20220805131252.3706794-10-richard.purdie@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220805131252.3706794-1-richard.purdie@linuxfoundation.org> References: <20220805131252.3706794-1-richard.purdie@linuxfoundation.org> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 05 Aug 2022 13:13:10 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/168944 Signed-off-by: Richard Purdie --- meta/classes/cargo.bbclass | 4 ++-- meta/classes/cargo_common.bbclass | 6 +++--- meta/classes/python_pyo3.bbclass | 2 +- meta/classes/rust-target-config.bbclass | 2 +- meta/classes/rust.bbclass | 4 ++-- meta/conf/bitbake.conf | 2 +- meta/recipes-devtools/rust/libstd-rs.inc | 4 ++-- meta/recipes-devtools/rust/rust.inc | 10 +++++----- meta/recipes-gnome/librsvg/librsvg_2.54.4.bb | 4 ++-- 9 files changed, 19 insertions(+), 19 deletions(-) diff --git a/meta/classes/cargo.bbclass b/meta/classes/cargo.bbclass index 4a780a501ff..539ff03ec7d 100644 --- a/meta/classes/cargo.bbclass +++ b/meta/classes/cargo.bbclass @@ -32,12 +32,12 @@ MANIFEST_PATH ??= "${S}/${CARGO_SRC_DIR}/Cargo.toml" RUSTFLAGS ??= "" BUILD_MODE = "${@['--release', ''][d.getVar('DEBUG_BUILD') == '1']}" -CARGO_BUILD_FLAGS = "-v --target ${HOST_SYS} ${BUILD_MODE} --manifest-path=${MANIFEST_PATH}" +CARGO_BUILD_FLAGS = "-v --target ${RUST_HOST_SYS} ${BUILD_MODE} --manifest-path=${MANIFEST_PATH}" # This is based on the content of CARGO_BUILD_FLAGS and generally will need to # change if CARGO_BUILD_FLAGS changes. BUILD_DIR = "${@['release', 'debug'][d.getVar('DEBUG_BUILD') == '1']}" -CARGO_TARGET_SUBDIR="${HOST_SYS}/${BUILD_DIR}" +CARGO_TARGET_SUBDIR="${RUST_HOST_SYS}/${BUILD_DIR}" oe_cargo_build () { export RUSTFLAGS="${RUSTFLAGS}" export RUST_TARGET_PATH="${RUST_TARGET_PATH}" diff --git a/meta/classes/cargo_common.bbclass b/meta/classes/cargo_common.bbclass index 39f32829fd4..dcd0afd9801 100644 --- a/meta/classes/cargo_common.bbclass +++ b/meta/classes/cargo_common.bbclass @@ -69,15 +69,15 @@ cargo_common_do_configure () { cat <<- EOF >> ${CARGO_HOME}/config # HOST_SYS - [target.${HOST_SYS}] + [target.${RUST_HOST_SYS}] linker = "${CARGO_RUST_TARGET_CCLD}" EOF - if [ "${HOST_SYS}" != "${BUILD_SYS}" ]; then + if [ "${RUST_HOST_SYS}" != "${RUST_BUILD_SYS}" ]; then cat <<- EOF >> ${CARGO_HOME}/config # BUILD_SYS - [target.${BUILD_SYS}] + [target.${RUST_BUILD_SYS}] linker = "${RUST_BUILD_CCLD}" EOF fi diff --git a/meta/classes/python_pyo3.bbclass b/meta/classes/python_pyo3.bbclass index 10cc3a06457..b41e3ba0752 100644 --- a/meta/classes/python_pyo3.bbclass +++ b/meta/classes/python_pyo3.bbclass @@ -8,7 +8,7 @@ inherit cargo python3-dir siteinfo export PYO3_CROSS="1" export PYO3_CROSS_PYTHON_VERSION="${PYTHON_BASEVERSION}" export PYO3_CROSS_LIB_DIR="${STAGING_LIBDIR}" -export CARGO_BUILD_TARGET="${HOST_SYS}" +export CARGO_BUILD_TARGET="${RUST_HOST_SYS}" export RUSTFLAGS export PYO3_PYTHON="${PYTHON}" export PYO3_CONFIG_FILE="${WORKDIR}/pyo3.config" diff --git a/meta/classes/rust-target-config.bbclass b/meta/classes/rust-target-config.bbclass index 1721839922e..7fe039601af 100644 --- a/meta/classes/rust-target-config.bbclass +++ b/meta/classes/rust-target-config.bbclass @@ -360,7 +360,7 @@ def rust_gen_target(d, thing, wd, arch): json.dump(tspec, f, indent=4) # These are accounted for in tmpdir path names so don't need to be in the task sig -rust_gen_target[vardepsexclude] += "RUST_HOST_SYS RUST_TARGET_SYS ABIEXTENSION llvm_cpu" +rust_gen_target[vardepsexclude] += "ABIEXTENSION llvm_cpu" do_rust_gen_targets[vardeps] += "DATA_LAYOUT TARGET_ENDIAN TARGET_POINTER_WIDTH TARGET_C_INT_WIDTH MAX_ATOMIC_WIDTH FEATURES" diff --git a/meta/classes/rust.bbclass b/meta/classes/rust.bbclass index 5c8938d09fe..f20e063c5be 100644 --- a/meta/classes/rust.bbclass +++ b/meta/classes/rust.bbclass @@ -2,7 +2,7 @@ inherit rust-common RUSTC = "rustc" -RUSTC_ARCHFLAGS += "--target=${HOST_SYS} ${RUSTFLAGS}" +RUSTC_ARCHFLAGS += "--target=${RUST_HOST_SYS} ${RUSTFLAGS}" def rust_base_dep(d): # Taken from meta/classes/base.bbclass `base_dep_prepend` and modified to @@ -37,7 +37,7 @@ HOST_CFLAGS ?= "${CFLAGS}" HOST_CXXFLAGS ?= "${CXXFLAGS}" HOST_CPPFLAGS ?= "${CPPFLAGS}" -rustlib_suffix="${TUNE_ARCH}${TARGET_VENDOR}-${TARGET_OS}/rustlib/${HOST_SYS}/lib" +rustlib_suffix="${TUNE_ARCH}${TARGET_VENDOR}-${TARGET_OS}/rustlib/${RUST_HOST_SYS}/lib" # Native sysroot standard library path rustlib_src="${prefix}/lib/${rustlib_suffix}" # Host sysroot standard library path diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf index 1d36aae8b35..bdfb6784371 100644 --- a/meta/conf/bitbake.conf +++ b/meta/conf/bitbake.conf @@ -943,7 +943,7 @@ BB_HASHEXCLUDE_COMMON ?= "TMPDIR FILE PATH PWD BB_TASKHASH BBPATH BBSERVER DL_DI SSTATE_HASHEQUIV_OWNER CCACHE_TOP_DIR BB_HASHSERVE GIT_CEILING_DIRECTORIES \ OMP_NUM_THREADS BB_CURRENTTASK" BB_BASEHASH_IGNORE_VARS ?= "${BB_HASHEXCLUDE_COMMON} PSEUDO_IGNORE_PATHS BUILDHISTORY_DIR \ - SSTATE_DIR SOURCE_DATE_EPOCH" + SSTATE_DIR SOURCE_DATE_EPOCH RUST_BUILD_SYS RUST_HOST_SYS RUST_TARGET_SYS" BB_HASHCONFIG_IGNORE_VARS ?= "${BB_HASHEXCLUDE_COMMON} DATE TIME SSH_AGENT_PID \ SSH_AUTH_SOCK PSEUDO_BUILD BB_ENV_PASSTHROUGH_ADDITIONS DISABLE_SANITY_CHECKS \ PARALLEL_MAKE BB_NUMBER_THREADS BB_ORIGENV BB_INVALIDCONF BBINCLUDED \ diff --git a/meta/recipes-devtools/rust/libstd-rs.inc b/meta/recipes-devtools/rust/libstd-rs.inc index 987956344a2..d49383ced58 100644 --- a/meta/recipes-devtools/rust/libstd-rs.inc +++ b/meta/recipes-devtools/rust/libstd-rs.inc @@ -35,6 +35,6 @@ do_install () { # With the incremental build support added in 1.24, the libstd deps directory also includes dependency # files that get installed. Those are really only needed to incrementally rebuild the libstd library # itself and don't need to be installed. - rm -f ${B}/${TARGET_SYS}/${BUILD_DIR}/deps/*.d - cp ${B}/${TARGET_SYS}/${BUILD_DIR}/deps/* ${D}${rustlibdir} + rm -f ${B}/${RUST_TARGET_SYS}/${BUILD_DIR}/deps/*.d + cp ${B}/${RUST_TARGET_SYS}/${BUILD_DIR}/deps/* ${D}${rustlibdir} } diff --git a/meta/recipes-devtools/rust/rust.inc b/meta/recipes-devtools/rust/rust.inc index ecb057ad3b5..aa067932fdd 100644 --- a/meta/recipes-devtools/rust/rust.inc +++ b/meta/recipes-devtools/rust/rust.inc @@ -79,7 +79,7 @@ python do_configure() { config = configparser.RawConfigParser() # [target.ARCH-poky-linux] - target_section = "target.{}".format(d.getVar('TARGET_SYS', True)) + target_section = "target.{}".format(d.getVar('RUST_TARGET_SYS', True)) config.add_section(target_section) llvm_config = d.expand("${YOCTO_ALTERNATE_EXE_PATH}") @@ -128,11 +128,11 @@ python do_configure() { config.set("build", "vendor", e(True)) if not "targets" in locals(): - targets = [d.getVar("TARGET_SYS", True)] + targets = [d.getVar("RUST_TARGET_SYS", True)] config.set("build", "target", e(targets)) if not "hosts" in locals(): - hosts = [d.getVar("HOST_SYS", True)] + hosts = [d.getVar("RUST_HOST_SYS", True)] config.set("build", "host", e(hosts)) # We can't use BUILD_SYS since that is something the rust snapshot knows @@ -181,10 +181,10 @@ do_compile () { rust_do_install () { mkdir -p ${D}${bindir} - cp build/${HOST_SYS}/stage2/bin/* ${D}${bindir} + cp build/${RUST_HOST_SYS}/stage2/bin/* ${D}${bindir} mkdir -p ${D}${libdir}/rustlib - cp -pRd build/${HOST_SYS}/stage2/lib/* ${D}${libdir} + cp -pRd build/${RUST_HOST_SYS}/stage2/lib/* ${D}${libdir} # Remove absolute symlink so bitbake doesn't complain rm -f ${D}${libdir}/rustlib/src/rust } diff --git a/meta/recipes-gnome/librsvg/librsvg_2.54.4.bb b/meta/recipes-gnome/librsvg/librsvg_2.54.4.bb index cc7fb9bbdfe..f3bbeb74ebe 100644 --- a/meta/recipes-gnome/librsvg/librsvg_2.54.4.bb +++ b/meta/recipes-gnome/librsvg/librsvg_2.54.4.bb @@ -31,7 +31,7 @@ export RUST_BACKTRACE = "full" export RUSTFLAGS export RUST_TARGET_PATH -export RUST_TARGET = "${HOST_SYS}" +export RUST_TARGET = "${RUST_HOST_SYS}" RUSTFLAGS:append:mips = " --cfg crossbeam_no_atomic_64" RUSTFLAGS:append:mipsel = " --cfg crossbeam_no_atomic_64" @@ -45,7 +45,7 @@ RUSTFLAGS:append:riscv32 = " --cfg crossbeam_no_atomic_64" do_compile:prepend() { cp ${STAGING_LIBDIR_NATIVE}/rustlib/${HOST_SYS}.json ${WORKDIR} cp ${STAGING_LIBDIR_NATIVE}/rustlib/${BUILD_SYS}.json ${WORKDIR} - sed -ie 's,"linker": ".*","linker": "${RUST_TARGET_CC}",g' ${WORKDIR}/${HOST_SYS}.json + sed -ie 's,"linker": ".*","linker": "${RUST_TARGET_CC}",g' ${WORKDIR}/${RUST_HOST_SYS}.json RUST_TARGET_PATH="${WORKDIR}" export RUST_TARGET_PATH } From patchwork Fri Aug 5 13:12:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 11005 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 84DFFC25B0D for ; Fri, 5 Aug 2022 13:13:10 +0000 (UTC) Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) by mx.groups.io with SMTP id smtpd.web08.6586.1659705184757203275 for ; Fri, 05 Aug 2022 06:13:05 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=bE+6ya6L; spf=pass (domain: linuxfoundation.org, ip: 209.85.128.42, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wm1-f42.google.com with SMTP id h34-20020a05600c49a200b003a5165eae0fso1266495wmp.4 for ; Fri, 05 Aug 2022 06:13:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc; bh=QtlL6vCmjf/ln4dEb7MxQBB/Rf4ekVaXojUJJesayoE=; b=bE+6ya6LZev14aQptddEjRXLxXLdWaHtkELt4/StBcmBVvkKSomVDQ8zPFZMhnUmCa 31Jn26TLTGrB0Y1/525ktk/geV/Vc3aMqtsGXPTI4oxV7V5ilK0aRftW+SwrERjcPBwb +7vskz9hk4eaoVOlkxWBcf+T2+ceygquG7jYk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc; bh=QtlL6vCmjf/ln4dEb7MxQBB/Rf4ekVaXojUJJesayoE=; b=Uh1I03RkIs8m7osuxMzRJe8cs0UyMfFka8Z7bW8EY3AS89ekTvkJ25UiQsv1phUYLr UN0shJ5lqr1FnwkoDlKDvzuC+VJWGEq+N9Ad9geWQZae+F/ydVc2vSRaAz7uAttwKyh0 Two3XY15tHM2SxpEw0GNcpXN35Bbg2l58zZ142w8V/R7v6tQz6TnSuW190XiPam9crIx 2CTItED99uLPLN27SgSAQCQxalnhQAmpkHb6H8Td4OwB0add7SGgzcbMHxjE+QGwNbxz 98IFfPqsPHQo2RFZA1S7dig/AGpQNkAdwXCfsAQ4x/P+WZI0TNYNobsYi+lMxW17ZR+g n3iQ== X-Gm-Message-State: ACgBeo0IjUFWUkQjmQe276JWcWxLqb/TPGq0L2jmGqv78H3y18jMns+v S8QkR0FC6TESML7ERq6cr/jcqrJ2F/1K5w== X-Google-Smtp-Source: AA6agR4jPoFRwdubgzsJ1B2WWRTa3/2DcAzhgIFyG3Xxo7S5rWVcQyZr8J2fZg84EicFx13n4vF6UQ== X-Received: by 2002:a05:600c:3c8a:b0:3a0:4ad8:d3c4 with SMTP id bg10-20020a05600c3c8a00b003a04ad8d3c4mr9719806wmb.43.1659705182941; Fri, 05 Aug 2022 06:13:02 -0700 (PDT) Received: from max.int.rpsys.net ([2001:8b0:aba:5f3c:f483:fcb0:1452:5a5a]) by smtp.gmail.com with ESMTPSA id p12-20020a05600c204c00b003a51a0d35e7sm1908901wmg.37.2022.08.05.06.13.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Aug 2022 06:13:02 -0700 (PDT) From: Richard Purdie To: openembedded-core@lists.openembedded.org Subject: [PATCH 11/29] rust.inc: Rename variables to make code clearer Date: Fri, 5 Aug 2022 14:12:34 +0100 Message-Id: <20220805131252.3706794-11-richard.purdie@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220805131252.3706794-1-richard.purdie@linuxfoundation.org> References: <20220805131252.3706794-1-richard.purdie@linuxfoundation.org> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 05 Aug 2022 13:13:10 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/168945 Instead of reusing a "target_section" variable, name them host and build section instead. This patch sets things up for other improvementsm, separating out the renaming. Signed-off-by: Richard Purdie --- meta/recipes-devtools/rust/rust.inc | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/meta/recipes-devtools/rust/rust.inc b/meta/recipes-devtools/rust/rust.inc index aa067932fdd..30f2b71fe8c 100644 --- a/meta/recipes-devtools/rust/rust.inc +++ b/meta/recipes-devtools/rust/rust.inc @@ -79,24 +79,24 @@ python do_configure() { config = configparser.RawConfigParser() # [target.ARCH-poky-linux] - target_section = "target.{}".format(d.getVar('RUST_TARGET_SYS', True)) - config.add_section(target_section) + host_section = "target.{}".format(d.getVar('RUST_TARGET_SYS', True)) + config.add_section(host_section) llvm_config = d.expand("${YOCTO_ALTERNATE_EXE_PATH}") - config.set(target_section, "llvm-config", e(llvm_config)) + config.set(host_section, "llvm-config", e(llvm_config)) - config.set(target_section, "cxx", e(d.expand("${RUST_TARGET_CXX}"))) - config.set(target_section, "cc", e(d.expand("${RUST_TARGET_CC}"))) + config.set(host_section, "cxx", e(d.expand("${RUST_TARGET_CXX}"))) + config.set(host_section, "cc", e(d.expand("${RUST_TARGET_CC}"))) # If we don't do this rust-native will compile it's own llvm for BUILD. # [target.${BUILD_ARCH}-unknown-linux-gnu] - target_section = "target.{}".format(d.getVar('SNAPSHOT_BUILD_SYS', True)) - config.add_section(target_section) + build_section = "target.{}".format(d.getVar('SNAPSHOT_BUILD_SYS', True)) + config.add_section(build_section) - config.set(target_section, "llvm-config", e(llvm_config)) + config.set(build_section, "llvm-config", e(llvm_config)) - config.set(target_section, "cxx", e(d.expand("${RUST_BUILD_CXX}"))) - config.set(target_section, "cc", e(d.expand("${RUST_BUILD_CC}"))) + config.set(build_section, "cxx", e(d.expand("${RUST_BUILD_CXX}"))) + config.set(build_section, "cc", e(d.expand("${RUST_BUILD_CC}"))) # [llvm] config.add_section("llvm") From patchwork Fri Aug 5 13:12:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 11006 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 864C9C25B06 for ; Fri, 5 Aug 2022 13:13:10 +0000 (UTC) Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) by mx.groups.io with SMTP id smtpd.web10.6825.1659705185985244244 for ; Fri, 05 Aug 2022 06:13:06 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=Dkhyust4; spf=pass (domain: linuxfoundation.org, ip: 209.85.221.48, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wr1-f48.google.com with SMTP id bv3so3222418wrb.5 for ; Fri, 05 Aug 2022 06:13:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc; bh=EtPeiC82RmhBSABZHo2Bu2yDRAMp+AksMVgArsTu4n0=; b=Dkhyust4n4Y/k3K+8NASBfgOiFzxWhOtRJ9u2fduV/ysyTaBY1/FRFh8xoRXDFH1jc K42P6gqhguwreOmplA7E+hOCg/jLrSKmnOaFzV42yrItNZ9I7e3fVe0xzVkJu2oV/C/V MhoqYB0s8zAUc5c6cW1xLrtiHXOoFDSo9aEGk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc; bh=EtPeiC82RmhBSABZHo2Bu2yDRAMp+AksMVgArsTu4n0=; b=B7wyaxQrQMfBHOe+w7TIZd13St0pY/qExvDMy1lvrL5AB+8hnNelZuwhPRI4Ez5asV 0+8JP92oqTNyITuQI/iA5RwgcJFWI2lsj2jrdiQrWNLyPXnNPUVUS++025AS3Ba65C5E wuKnsXHBQtvT4WTML/hvqTz8AtE0XoZu5g1qHC0bn4YPvyhoSA53xcJz1ZxNwb2e9Laf tb03Z1pOaFTqVzb+65LIzWLaMK+jfkWFyoyVq81BGM7+czJpQ4UPqSg03PIP1P1+iGPx ++g7EnjNf0p0+95+OIz4tq1+j/Wh/mydm6ZfNowEocwOPq+NCLzHkrGZCJF4PnYIFYCR hv7A== X-Gm-Message-State: ACgBeo2XEvSniuwGZnH47ZqPnQ4LMwQYK1d/VSI3a8Aqj10gGTNxjEJt Q2qac7fPTth018wZB7QgYbeOw+gvilmFYg== X-Google-Smtp-Source: AA6agR6ExSt5W6HbH2PvP+p+KqBIbOc3P2HA9D6vVhISiVtj1TILF45ZqH+JnEE26ZqF5uxRXbdXJg== X-Received: by 2002:a05:6000:1789:b0:220:626a:b69a with SMTP id e9-20020a056000178900b00220626ab69amr4316591wrg.579.1659705184272; Fri, 05 Aug 2022 06:13:04 -0700 (PDT) Received: from max.int.rpsys.net ([2001:8b0:aba:5f3c:f483:fcb0:1452:5a5a]) by smtp.gmail.com with ESMTPSA id p12-20020a05600c204c00b003a51a0d35e7sm1908901wmg.37.2022.08.05.06.13.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Aug 2022 06:13:03 -0700 (PDT) From: Richard Purdie To: openembedded-core@lists.openembedded.org Subject: [PATCH 12/29] rust.inc: Fix cross build llvm-config handling Date: Fri, 5 Aug 2022 14:12:35 +0100 Message-Id: <20220805131252.3706794-12-richard.purdie@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220805131252.3706794-1-richard.purdie@linuxfoundation.org> References: <20220805131252.3706794-1-richard.purdie@linuxfoundation.org> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 05 Aug 2022 13:13:10 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/168946 We need llvm-config for the target but the cross compiled target binary is no good. We can copy the native one into the target location where it will then return the target values though. Signed-off-by: Richard Purdie --- meta/recipes-devtools/rust/rust.inc | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/meta/recipes-devtools/rust/rust.inc b/meta/recipes-devtools/rust/rust.inc index 30f2b71fe8c..47b76e725de 100644 --- a/meta/recipes-devtools/rust/rust.inc +++ b/meta/recipes-devtools/rust/rust.inc @@ -18,7 +18,8 @@ export RUST_TARGET_PATH="${WORKDIR}/targets/" export FORCE_CRATE_HASH="${BB_TASKHASH}" RUST_ALTERNATE_EXE_PATH ?= "${STAGING_LIBDIR}/llvm-rust/bin/llvm-config" -export YOCTO_ALTERNATE_EXE_PATH = "${RUST_ALTERNATE_EXE_PATH}" +RUST_ALTERNATE_EXE_PATH_NATIVE = "${STAGING_LIBDIR_NATIVE}/llvm-rust/bin/llvm-config" + export YOCTO_ALTERNATE_MULTILIB_NAME = "/${BASELIB}" # We don't want to use bitbakes vendoring because the rust sources do their @@ -82,8 +83,9 @@ python do_configure() { host_section = "target.{}".format(d.getVar('RUST_TARGET_SYS', True)) config.add_section(host_section) - llvm_config = d.expand("${YOCTO_ALTERNATE_EXE_PATH}") - config.set(host_section, "llvm-config", e(llvm_config)) + llvm_config_target = d.expand("${RUST_ALTERNATE_EXE_PATH}") + llvm_config_build = d.expand("${RUST_ALTERNATE_EXE_PATH_NATIVE}") + config.set(host_section, "llvm-config", e(llvm_config_target)) config.set(host_section, "cxx", e(d.expand("${RUST_TARGET_CXX}"))) config.set(host_section, "cc", e(d.expand("${RUST_TARGET_CC}"))) @@ -93,7 +95,7 @@ python do_configure() { build_section = "target.{}".format(d.getVar('SNAPSHOT_BUILD_SYS', True)) config.add_section(build_section) - config.set(build_section, "llvm-config", e(llvm_config)) + config.set(build_section, "llvm-config", e(llvm_config_build)) config.set(build_section, "cxx", e(d.expand("${RUST_BUILD_CXX}"))) config.set(build_section, "cc", e(d.expand("${RUST_BUILD_CC}"))) @@ -169,6 +171,14 @@ rust_runx () { unset CXXFLAGS unset CPPFLAGS + # Copy the natively built llvm-config into the target so we can run it. Horrible, + # but works! + if [ ${RUST_ALTERNATE_EXE_PATH_NATIVE} != ${RUST_ALTERNATE_EXE_PATH} ]; then + mkdir -p `dirname ${RUST_ALTERNATE_EXE_PATH}` + cp ${RUST_ALTERNATE_EXE_PATH_NATIVE} ${RUST_ALTERNATE_EXE_PATH} + chrpath -d ${RUST_ALTERNATE_EXE_PATH} + fi + oe_cargo_fix_env python3 src/bootstrap/bootstrap.py ${@oe.utils.parallel_make_argument(d, '-j %d')} "$@" --verbose From patchwork Fri Aug 5 13:12:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 11004 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 75FD2C25B08 for ; Fri, 5 Aug 2022 13:13:10 +0000 (UTC) Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) by mx.groups.io with SMTP id smtpd.web09.6782.1659705187235305448 for ; Fri, 05 Aug 2022 06:13:07 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=UEXeL0Tu; spf=pass (domain: linuxfoundation.org, ip: 209.85.221.43, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wr1-f43.google.com with SMTP id n4so1462986wrp.10 for ; Fri, 05 Aug 2022 06:13:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc; bh=pDS2Bk+N1B6tb+4lmXTGjMYx8OMJ516WEyrs30wFP/s=; b=UEXeL0TuMLvIiN5gEhn3YzxTXXPGXbEPfLKqBn3p6Df4Ko2OId5I68sJRkvrVuCAYq tj7Kf5hh7tJyWZu0H4ij4YYkZWKwdlbdpW82PD+uQUyOp4ZzvVA9hYJ2jS4Q2VZrqhB1 s+z6t0G8pKc6s5+oHtV/cGlWZztE1wMC9Mb2I= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc; bh=pDS2Bk+N1B6tb+4lmXTGjMYx8OMJ516WEyrs30wFP/s=; b=tK60LQDyENIemEFm1WP22sBG21tgyVTmfmYnBx7k26k7e8MWNO2WadxxO2y8RPowVE tSMr3W4ecMzr71PLS6FUN+XlErFPea9ngKWDou9Lg4x0RQJuZgyB4pXfOoAjWqE06egC xWfpn8OlNbwqTkSveVms/Hu95ajfIMdrVLoVwrByDPDYagvbfTjTfEv6tKXSh/8/JXl+ ijl3657l7vbLILNNZyNnxdVyS5fBE1uOsraqtqQ5h0kdHCELQ52IJpRwmLjivl4y1Otz l+btTrOJTdPsMpAZb7qKcJMo5otnj+MYiY16CGgMTj9Kbzs6hwdSViiyXbZyuQDzylyK 3cNg== X-Gm-Message-State: ACgBeo1/FF6GepzpUHSujUvNR7dGH/T3ZpFP5XFfT5/RPQtx/2YkbwJR NGs2Le/5ItSmO+UMjPQrzLyjt4yEgGshsw== X-Google-Smtp-Source: AA6agR6gSelEui3pUVP1NsitQvjzdmZVzf78Xuy0iZlMlvB7mrJeedAhhlR/nJvMFSnQe8TIjdoliA== X-Received: by 2002:a5d:6190:0:b0:21f:cf9:68ec with SMTP id j16-20020a5d6190000000b0021f0cf968ecmr4459840wru.696.1659705185402; Fri, 05 Aug 2022 06:13:05 -0700 (PDT) Received: from max.int.rpsys.net ([2001:8b0:aba:5f3c:f483:fcb0:1452:5a5a]) by smtp.gmail.com with ESMTPSA id p12-20020a05600c204c00b003a51a0d35e7sm1908901wmg.37.2022.08.05.06.13.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Aug 2022 06:13:04 -0700 (PDT) From: Richard Purdie To: openembedded-core@lists.openembedded.org Subject: [PATCH 13/29] rust/mesa: Drop obsolete YOCTO_ALTERNATE_MULTILIB_NAME Date: Fri, 5 Aug 2022 14:12:36 +0100 Message-Id: <20220805131252.3706794-13-richard.purdie@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220805131252.3706794-1-richard.purdie@linuxfoundation.org> References: <20220805131252.3706794-1-richard.purdie@linuxfoundation.org> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 05 Aug 2022 13:13:10 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/168947 This variable is no longer used by the llvm patches. Signed-off-by: Richard Purdie --- meta/recipes-devtools/rust/rust.inc | 2 -- meta/recipes-graphics/mesa/mesa.inc | 1 - 2 files changed, 3 deletions(-) diff --git a/meta/recipes-devtools/rust/rust.inc b/meta/recipes-devtools/rust/rust.inc index 47b76e725de..7d1f5347ea7 100644 --- a/meta/recipes-devtools/rust/rust.inc +++ b/meta/recipes-devtools/rust/rust.inc @@ -20,8 +20,6 @@ export FORCE_CRATE_HASH="${BB_TASKHASH}" RUST_ALTERNATE_EXE_PATH ?= "${STAGING_LIBDIR}/llvm-rust/bin/llvm-config" RUST_ALTERNATE_EXE_PATH_NATIVE = "${STAGING_LIBDIR_NATIVE}/llvm-rust/bin/llvm-config" -export YOCTO_ALTERNATE_MULTILIB_NAME = "/${BASELIB}" - # We don't want to use bitbakes vendoring because the rust sources do their # own vendoring. CARGO_DISABLE_BITBAKE_VENDORING = "1" diff --git a/meta/recipes-graphics/mesa/mesa.inc b/meta/recipes-graphics/mesa/mesa.inc index f02ef2dc2bf..7e46fd9c15f 100644 --- a/meta/recipes-graphics/mesa/mesa.inc +++ b/meta/recipes-graphics/mesa/mesa.inc @@ -56,7 +56,6 @@ ANY_OF_DISTRO_FEATURES:class-target = "opengl vulkan" PLATFORMS ??= "${@bb.utils.filter('PACKAGECONFIG', 'x11 wayland', d)}" export YOCTO_ALTERNATE_EXE_PATH = "${STAGING_LIBDIR}/llvm-config" -export YOCTO_ALTERNATE_MULTILIB_NAME = "${base_libdir}" export LLVM_CONFIG = "${STAGING_BINDIR_NATIVE}/llvm-config${MESA_LLVM_RELEASE}" export WANT_LLVM_RELEASE = "${MESA_LLVM_RELEASE}" From patchwork Fri Aug 5 13:12:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 11002 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 7678BC3F6B0 for ; Fri, 5 Aug 2022 13:13:10 +0000 (UTC) Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) by mx.groups.io with SMTP id smtpd.web12.6768.1659705176182557441 for ; Fri, 05 Aug 2022 06:13:07 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=KFj+MEIa; spf=pass (domain: linuxfoundation.org, ip: 209.85.128.54, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wm1-f54.google.com with SMTP id b6so1389994wmq.5 for ; Fri, 05 Aug 2022 06:13:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc; bh=GXEiZaUo2jc528PGvNwaWOpdzWuGPCO+1Uo980CA+PM=; b=KFj+MEIaTj6BmrdUn6chjbPcevCRx5f7NjuUQyV6pfI+8ZR88RpIPZQ3JwRayrGqm9 tLvlImcdpxK2Is6bcb9OZbrZDseX1SSxkyF4l3z9jaeBCQaqV9tcpn2WDmEy9jgNdeKh 3vonTBfNmEOj01U8M6D4MmIU3/Y18EFonuyt8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc; bh=GXEiZaUo2jc528PGvNwaWOpdzWuGPCO+1Uo980CA+PM=; b=K5b2CKXfIhjGGBRvnxWoOIjJCynYaIE0dkUNaYXv6GYqtEQ0LLB/AyowSVPSLVtxgR QHPkfmEj3OgmcGkaX9P8IcYyGD0mC7+yA7pwXXt9YFHUCTIGQZiJBqVEFsDtk675om6G Z0wt3mXqrwiSip2KAS2jJXcIbdTenQ2EmMXFCxglRdtjer7jYOL/qP1WaEDlM0UZFxaB cW59O2sfRZUrpaHS838DfTQAmXrPc0HFnuZanoaZyIDm3jmzF6THgHTFrCWTxsfcR3yE 9sePjTvQATuDmi88wZzfLrH7G1AocxGrfFqMBgKWFt6jUlaq3B8tHGaZgY9iiRRZAGQa Vggg== X-Gm-Message-State: ACgBeo27kShPNR2o+YmAiB8CRVoXc5PMTyhSQORo0X8xnBzixepvWiSZ GZg9l5b02m5DQZAArjZKIZbuBxk3VQknrA== X-Google-Smtp-Source: AA6agR6Ax11191d8rJaSU3us6UPuKgCS3Aq+BHaaQwFMOIK1bmRw+YKfejxi8x9M1Y0C1FVN+JHZlA== X-Received: by 2002:a7b:cb0a:0:b0:3a4:eafc:367d with SMTP id u10-20020a7bcb0a000000b003a4eafc367dmr4805280wmj.0.1659705186589; Fri, 05 Aug 2022 06:13:06 -0700 (PDT) Received: from max.int.rpsys.net ([2001:8b0:aba:5f3c:f483:fcb0:1452:5a5a]) by smtp.gmail.com with ESMTPSA id p12-20020a05600c204c00b003a51a0d35e7sm1908901wmg.37.2022.08.05.06.13.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Aug 2022 06:13:06 -0700 (PDT) From: Richard Purdie To: openembedded-core@lists.openembedded.org Subject: [PATCH 14/29] rust-target-config: Show clear error when target isn't defined Date: Fri, 5 Aug 2022 14:12:37 +0100 Message-Id: <20220805131252.3706794-14-richard.purdie@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220805131252.3706794-1-richard.purdie@linuxfoundation.org> References: <20220805131252.3706794-1-richard.purdie@linuxfoundation.org> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 05 Aug 2022 13:13:10 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/168948 Signed-off-by: Richard Purdie --- meta/classes/rust-target-config.bbclass | 2 ++ 1 file changed, 2 insertions(+) diff --git a/meta/classes/rust-target-config.bbclass b/meta/classes/rust-target-config.bbclass index 7fe039601af..ab177cf59f4 100644 --- a/meta/classes/rust-target-config.bbclass +++ b/meta/classes/rust-target-config.bbclass @@ -326,6 +326,8 @@ def rust_gen_target(d, thing, wd, arch): tspec = {} tspec['llvm-target'] = llvm_target tspec['data-layout'] = d.getVarFlag('DATA_LAYOUT', arch_abi) + if tspec['data-layout'] is None: + bb.fatal("No rust target defined for %s" % arch_abi) tspec['max-atomic-width'] = int(d.getVarFlag('MAX_ATOMIC_WIDTH', arch_abi)) tspec['target-pointer-width'] = d.getVarFlag('TARGET_POINTER_WIDTH', arch_abi) tspec['target-c-int-width'] = d.getVarFlag('TARGET_C_INT_WIDTH', arch_abi) From patchwork Fri Aug 5 13:12:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 11001 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 76CF1C48BE4 for ; Fri, 5 Aug 2022 13:13:10 +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.web12.6776.1659705189866605746 for ; Fri, 05 Aug 2022 06:13:10 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=V03xi43v; spf=pass (domain: linuxfoundation.org, ip: 209.85.128.49, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wm1-f49.google.com with SMTP id n20-20020a05600c3b9400b003a4f2261a7eso1275538wms.2 for ; Fri, 05 Aug 2022 06:13:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc; bh=xwz4nNvg+Wh/omYyioIBC0OJ1tzyPFMZqGCd6h3uqGI=; b=V03xi43vU4l82v7REQyUTzcE8SO8XdYJk3UeseBFOmBI6EqQIbqS97gzxIJyBJYmIT Tu6rDVGFySxeyu24/golyGyqRfq+p8WhJY+eVkGTDNvWDv4sAhaLvl9t0CfIFyLmKtrV NmT5rRunufBAT9eYLzcMi3vpBNo+VBzBrtriA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc; bh=xwz4nNvg+Wh/omYyioIBC0OJ1tzyPFMZqGCd6h3uqGI=; b=sWxxfUPYVvtQCLmdHKkUGnM5hR2MzkFgivtrz6p/P4zS83NHeoJTijTvZuxbV4p+pD iPqYq9rhnXIxy3z/mF7EbmtVz/pTSnA6tfFwYtkDY/KSCkwY9nJtn1ks0yeSLODPP8U/ 544Ppda0tt8y+FLasAIAyWC8VcU41nari2zQGs+/aa/nLUE3+HMrjQVU63MLQMYWiPxI lWXr5IFoQ5JyUZ3tsOtXtVrxniM2SMLMiho4JsX3mW606NINsx0vRjt8OQpkzHQ3KpYU tF9NIcR7TzBRM6igAogaZZNu829Mg4BTfWoZLnYwBOMlIWqkXoq8WRCKQpu9SrqGa98A ewXg== X-Gm-Message-State: ACgBeo1bbh1bq4PrOok52kcUAkD0VjdNKYHf6LqcJ38m/rRrjWFYEPxB dhjIgpqcALefAcZUxn7l29qve5WVYREIwg== X-Google-Smtp-Source: AA6agR7wESSr7p9CJBvkKFTu6Qzr1Xo6FZdmaGodOXxBV1B+tPqIE07K3siWVb5e6s/Li9NItVxUig== X-Received: by 2002:a05:600c:3d0d:b0:3a3:7a1a:326a with SMTP id bh13-20020a05600c3d0d00b003a37a1a326amr9418124wmb.127.1659705187857; Fri, 05 Aug 2022 06:13:07 -0700 (PDT) Received: from max.int.rpsys.net ([2001:8b0:aba:5f3c:f483:fcb0:1452:5a5a]) by smtp.gmail.com with ESMTPSA id p12-20020a05600c204c00b003a51a0d35e7sm1908901wmg.37.2022.08.05.06.13.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Aug 2022 06:13:07 -0700 (PDT) From: Richard Purdie To: openembedded-core@lists.openembedded.org Subject: [PATCH 15/29] rust: Generate per recipe target configuration files Date: Fri, 5 Aug 2022 14:12:38 +0100 Message-Id: <20220805131252.3706794-15-richard.purdie@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220805131252.3706794-1-richard.purdie@linuxfoundation.org> References: <20220805131252.3706794-1-richard.purdie@linuxfoundation.org> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 05 Aug 2022 13:13:10 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/168949 Instead of generating target configuration files centrally and often getting it wrong, or having trouble finding the right set, generate them dynamically from the bbclass into WORKDIR per recipe. Signed-off-by: Richard Purdie --- meta/classes/cargo.bbclass | 3 ++- meta/classes/rust-bin.bbclass | 1 - meta/classes/rust-common.bbclass | 2 +- meta/classes/rust-target-config.bbclass | 18 +++++++++--------- meta/recipes-devtools/cargo/cargo.inc | 2 ++ meta/recipes-devtools/rust/libstd-rs.inc | 3 +++ meta/recipes-devtools/rust/rust.inc | 5 ++--- meta/recipes-gnome/librsvg/librsvg_2.54.4.bb | 14 +++++++------- 8 files changed, 26 insertions(+), 22 deletions(-) diff --git a/meta/classes/cargo.bbclass b/meta/classes/cargo.bbclass index 539ff03ec7d..2475d05b3d2 100644 --- a/meta/classes/cargo.bbclass +++ b/meta/classes/cargo.bbclass @@ -4,6 +4,7 @@ ## Cargo. inherit cargo_common +inherit rust-target-config # the binary we will use CARGO = "cargo" @@ -40,7 +41,7 @@ BUILD_DIR = "${@['release', 'debug'][d.getVar('DEBUG_BUILD') == '1']}" CARGO_TARGET_SUBDIR="${RUST_HOST_SYS}/${BUILD_DIR}" oe_cargo_build () { export RUSTFLAGS="${RUSTFLAGS}" - export RUST_TARGET_PATH="${RUST_TARGET_PATH}" + bbnote "Using rust targets from ${RUST_TARGET_PATH}" bbnote "cargo = $(which ${CARGO})" bbnote "rustc = $(which ${RUSTC})" bbnote "${CARGO} build ${CARGO_BUILD_FLAGS} $@" diff --git a/meta/classes/rust-bin.bbclass b/meta/classes/rust-bin.bbclass index c87343b3cff..7a70a7b6ba3 100644 --- a/meta/classes/rust-bin.bbclass +++ b/meta/classes/rust-bin.bbclass @@ -93,7 +93,6 @@ do_configure () { } oe_runrustc () { - export RUST_TARGET_PATH="${RUST_TARGET_PATH}" bbnote ${RUSTC} ${RUSTC_ARCHFLAGS} ${RUSTC_FLAGS} "$@" "${RUSTC}" ${RUSTC_ARCHFLAGS} ${RUSTC_FLAGS} "$@" } diff --git a/meta/classes/rust-common.bbclass b/meta/classes/rust-common.bbclass index 1bce7761ab0..adcf96f0cd9 100644 --- a/meta/classes/rust-common.bbclass +++ b/meta/classes/rust-common.bbclass @@ -1,4 +1,5 @@ inherit python3native +inherit rust-target-config # Common variables used by all Rust builds export rustlibdir = "${libdir}/rust" @@ -10,7 +11,6 @@ RUSTLIB = "-L ${STAGING_LIBDIR}/rust" RUST_DEBUG_REMAP = "--remap-path-prefix=${WORKDIR}=/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR}" RUSTFLAGS += "${RUSTLIB} ${RUST_DEBUG_REMAP}" RUSTLIB_DEP ?= "libstd-rs" -export RUST_TARGET_PATH = "${STAGING_LIBDIR_NATIVE}/rustlib" RUST_PANIC_STRATEGY ?= "unwind" # Native builds are not effected by TCLIBC. Without this, rust-native diff --git a/meta/classes/rust-target-config.bbclass b/meta/classes/rust-target-config.bbclass index ab177cf59f4..bc6bd77abbf 100644 --- a/meta/classes/rust-target-config.bbclass +++ b/meta/classes/rust-target-config.bbclass @@ -292,6 +292,7 @@ def rust_gen_target(d, thing, wd, arch): import json sys = d.getVar('{}_SYS'.format(thing)) prefix = d.getVar('{}_PREFIX'.format(thing)) + rustsys = d.getVar('RUST_{}_SYS'.format(thing)) abi = None cpu = "generic" @@ -318,13 +319,9 @@ def rust_gen_target(d, thing, wd, arch): features = features or d.getVarFlag('FEATURES', arch_abi) or "" features = features.strip() - llvm_target = d.getVar('RUST_TARGET_SYS') - if thing == "BUILD": - llvm_target = d.getVar('RUST_HOST_SYS') - # build tspec tspec = {} - tspec['llvm-target'] = llvm_target + tspec['llvm-target'] = rustsys tspec['data-layout'] = d.getVarFlag('DATA_LAYOUT', arch_abi) if tspec['data-layout'] is None: bb.fatal("No rust target defined for %s" % arch_abi) @@ -358,7 +355,7 @@ def rust_gen_target(d, thing, wd, arch): tspec['panic-strategy'] = d.getVar("RUST_PANIC_STRATEGY") # write out the target spec json file - with open(wd + sys + '.json', 'w') as f: + with open(wd + rustsys + '.json', 'w') as f: json.dump(tspec, f, indent=4) # These are accounted for in tmpdir path names so don't need to be in the task sig @@ -366,10 +363,13 @@ rust_gen_target[vardepsexclude] += "ABIEXTENSION llvm_cpu" do_rust_gen_targets[vardeps] += "DATA_LAYOUT TARGET_ENDIAN TARGET_POINTER_WIDTH TARGET_C_INT_WIDTH MAX_ATOMIC_WIDTH FEATURES" -RUST_TARGETGENS = "BUILD" +RUST_TARGETS_DIR = "${WORKDIR}/rust-targets/" +export RUST_TARGET_PATH = "${RUST_TARGETS_DIR}" + +RUST_TARGETGENS = "BUILD HOST TARGET" python do_rust_gen_targets () { - wd = d.getVar('WORKDIR') + '/targets/' + wd = d.getVar('RUST_TARGETS_DIR') # Order of BUILD, HOST, TARGET is important in case the files overwrite, most specific last rust_gen_target(d, 'BUILD', wd, d.getVar('BUILD_ARCH')) if "HOST" in d.getVar("RUST_TARGETGENS"): @@ -379,5 +379,5 @@ python do_rust_gen_targets () { } addtask rust_gen_targets after do_patch before do_compile -do_rust_gen_targets[dirs] += "${WORKDIR}/targets" +do_rust_gen_targets[dirs] += "${RUST_TARGETS_DIR}" diff --git a/meta/recipes-devtools/cargo/cargo.inc b/meta/recipes-devtools/cargo/cargo.inc index 607c51fc3d1..978504052b9 100644 --- a/meta/recipes-devtools/cargo/cargo.inc +++ b/meta/recipes-devtools/cargo/cargo.inc @@ -18,6 +18,8 @@ EXCLUDE_FROM_WORLD = "1" inherit cargo pkgconfig +RUST_TARGETGENS = "BUILD HOST TARGET" + do_cargo_setup_snapshot () { ${WORKDIR}/rust-snapshot-components/${CARGO_SNAPSHOT}/install.sh --prefix="${WORKDIR}/${CARGO_SNAPSHOT}" --disable-ldconfig # Need to use uninative's loader if enabled/present since the library paths diff --git a/meta/recipes-devtools/rust/libstd-rs.inc b/meta/recipes-devtools/rust/libstd-rs.inc index d49383ced58..1498b88f0e2 100644 --- a/meta/recipes-devtools/rust/libstd-rs.inc +++ b/meta/recipes-devtools/rust/libstd-rs.inc @@ -12,6 +12,9 @@ DEPENDS:append:libc-musl = " libunwind" DEPENDS:remove:riscv32 = "libunwind" DEPENDS:remove:riscv64 = "libunwind" + +RUST_TARGETGENS = "BUILD HOST TARGET" + # Embed bitcode in order to allow compiling both with and without LTO RUSTFLAGS += "-Cembed-bitcode=yes" # Needed so cargo can find libbacktrace diff --git a/meta/recipes-devtools/rust/rust.inc b/meta/recipes-devtools/rust/rust.inc index 7d1f5347ea7..172cd22657d 100644 --- a/meta/recipes-devtools/rust/rust.inc +++ b/meta/recipes-devtools/rust/rust.inc @@ -12,9 +12,6 @@ DEPENDS:append:class-native = " rust-llvm-native" S = "${RUSTSRC}" -# We generate local targets, and need to be able to locate them -export RUST_TARGET_PATH="${WORKDIR}/targets/" - export FORCE_CRATE_HASH="${BB_TASKHASH}" RUST_ALTERNATE_EXE_PATH ?= "${STAGING_LIBDIR}/llvm-rust/bin/llvm-config" @@ -40,6 +37,8 @@ setup_cargo_environment () { inherit rust-target-config +RUST_TARGETGENS = "BUILD HOST TARGET" + do_rust_setup_snapshot () { for installer in "${WORKDIR}/rust-snapshot-components/"*"/install.sh"; do "${installer}" --prefix="${WORKDIR}/rust-snapshot" --disable-ldconfig diff --git a/meta/recipes-gnome/librsvg/librsvg_2.54.4.bb b/meta/recipes-gnome/librsvg/librsvg_2.54.4.bb index f3bbeb74ebe..82b1bf9bcef 100644 --- a/meta/recipes-gnome/librsvg/librsvg_2.54.4.bb +++ b/meta/recipes-gnome/librsvg/librsvg_2.54.4.bb @@ -14,7 +14,7 @@ SECTION = "x11/utils" DEPENDS = "cairo gdk-pixbuf glib-2.0 libxml2 pango python3-docutils-native" BBCLASSEXTEND = "native nativesdk" -inherit gnomebase pixbufcache upstream-version-is-even gobject-introspection rust vala gi-docgen +inherit cargo_common gnomebase pixbufcache upstream-version-is-even gobject-introspection rust vala gi-docgen SRC_URI += "file://0001-Makefile.am-pass-rust-target-to-cargo-also-when-not-.patch \ file://0001-system-deps-src-lib.rs-do-not-probe-into-harcoded-li.patch \ @@ -29,7 +29,6 @@ BASEDEPENDS:append = " cargo-native" export RUST_BACKTRACE = "full" export RUSTFLAGS -export RUST_TARGET_PATH export RUST_TARGET = "${RUST_HOST_SYS}" @@ -38,16 +37,17 @@ RUSTFLAGS:append:mipsel = " --cfg crossbeam_no_atomic_64" RUSTFLAGS:append:powerpc = " --cfg crossbeam_no_atomic_64" RUSTFLAGS:append:riscv32 = " --cfg crossbeam_no_atomic_64" +CARGO_DISABLE_BITBAKE_VENDORING = "1" +do_configure[postfuncs] += "cargo_common_do_configure" + +inherit rust-target-config + # rust-cross writes the target linker binary into target json definition without any flags. # This breaks here because the linker isn't going to work without at least knowing where # the sysroot is. So copy the json to workdir, and patch in the path to wrapper from rust class # which supplies the needed flags. do_compile:prepend() { - cp ${STAGING_LIBDIR_NATIVE}/rustlib/${HOST_SYS}.json ${WORKDIR} - cp ${STAGING_LIBDIR_NATIVE}/rustlib/${BUILD_SYS}.json ${WORKDIR} - sed -ie 's,"linker": ".*","linker": "${RUST_TARGET_CC}",g' ${WORKDIR}/${RUST_HOST_SYS}.json - RUST_TARGET_PATH="${WORKDIR}" - export RUST_TARGET_PATH + sed -ie 's,"linker": ".*","linker": "${RUST_TARGET_CC}",g' ${RUST_TARGETS_DIR}/${RUST_HOST_SYS}.json } # Issue only on windows From patchwork Fri Aug 5 13:12:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 11009 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 880F6C00140 for ; Fri, 5 Aug 2022 13:13:20 +0000 (UTC) Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) by mx.groups.io with SMTP id smtpd.web12.6771.1659705181226824020 for ; Fri, 05 Aug 2022 06:13:10 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=Jf2K03Bv; spf=pass (domain: linuxfoundation.org, ip: 209.85.128.42, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wm1-f42.google.com with SMTP id i128-20020a1c3b86000000b003a3a22178beso3958614wma.3 for ; Fri, 05 Aug 2022 06:13:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc; bh=zZ982Gna0b4HBPzqVaxZU3SRfWfC6p70dMYboDAx+gI=; b=Jf2K03BvWYlSFLDDsVvtP7r/HfDJXCNpwX4GhTlIqW2Wbck4oTE/k7P4TaAFwWf8T7 n9uCXTjB6NgdFqvmWOcrV7KLBu61MhTpdvdpPgSJC8QuUi1Z0bPnFqJPUhnVBLVJnLu8 n+zirxM4/43yUb97jJGBVC3X6JN0iYt6VlSzI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc; bh=zZ982Gna0b4HBPzqVaxZU3SRfWfC6p70dMYboDAx+gI=; b=E9qENvFtvlQ/4gPdWWXDoL28+KBC/7aVCXAtDUIAUnbi10gMpyG0Rn9msr83FIEqRN Llh9cNcBXSI5XBEC1I/9BS2jPPceXTtabpLfcBFR+gZrUWNakTtKV//EVFUnXTef7QPY qekS6XL/ytQfa/LobY1e+GVis2LIKgJji/qBzOrAvgF9lNd82mtXc/ExWXcTgpfXe5tw Et1rZQWcN4mFqojlbpmwCb7ddfOtgIHBO5WkJ/W7QLjs7CLSOl9P6bIUTdrU1Lh2rtqV +fMy2/1v6jq8BIsH/ho4RY0VKU3QvA8kBa4mthlgOzdfzMdZiZW7BtVLDvUoorD9gU7G b4Ow== X-Gm-Message-State: ACgBeo1Qi7h46OGVnbe5HrLWx9XhrOm+Y5LOei+ehX8Pmun6kXVJwRFU BA4VWN2yYnMiDux6on2Pu6YDeqabdMiZkQ== X-Google-Smtp-Source: AA6agR4cFDOQMirKfcKOlPt1j1gQBbxM6ng7vfol0uGuSJlangODSbgWYkkkU/EvSp1a2Vul3GvRSw== X-Received: by 2002:a7b:cb0c:0:b0:3a3:2a38:5066 with SMTP id u12-20020a7bcb0c000000b003a32a385066mr4722596wmj.74.1659705189512; Fri, 05 Aug 2022 06:13:09 -0700 (PDT) Received: from max.int.rpsys.net ([2001:8b0:aba:5f3c:f483:fcb0:1452:5a5a]) by smtp.gmail.com with ESMTPSA id p12-20020a05600c204c00b003a51a0d35e7sm1908901wmg.37.2022.08.05.06.13.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Aug 2022 06:13:08 -0700 (PDT) From: Richard Purdie To: openembedded-core@lists.openembedded.org Subject: [PATCH 16/29] rust-common/rust: Improve bootstrap BUILD_SYS handling Date: Fri, 5 Aug 2022 14:12:39 +0100 Message-Id: <20220805131252.3706794-16-richard.purdie@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220805131252.3706794-1-richard.purdie@linuxfoundation.org> References: <20220805131252.3706794-1-richard.purdie@linuxfoundation.org> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 05 Aug 2022 13:13:20 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/168950 Move the "unknown" vendor workaround used during bootstrap to a central location so it is applied consistently to all RUST_BUILD_SYS values rather than some subset. Signed-off-by: Richard Purdie --- meta/classes/rust-common.bbclass | 5 +++++ meta/recipes-devtools/rust/rust.inc | 7 +++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/meta/classes/rust-common.bbclass b/meta/classes/rust-common.bbclass index adcf96f0cd9..f2e99493fef 100644 --- a/meta/classes/rust-common.bbclass +++ b/meta/classes/rust-common.bbclass @@ -68,6 +68,11 @@ def rust_base_triple(d, thing): else: arch = oe.rust.arch_to_rust_arch(d.getVar('{}_ARCH'.format(thing))) + # When bootstrapping rust-native, BUILD must be the same as upstream snapshot tarballs + bpn = d.getVar('BPN') + if thing == "BUILD" and bpn in ["rust"]: + return arch + "-unknown-linux-gnu" + # All the Yocto targets are Linux and are 'unknown' vendor = "-unknown" os = d.getVar('{}_OS'.format(thing)) diff --git a/meta/recipes-devtools/rust/rust.inc b/meta/recipes-devtools/rust/rust.inc index 172cd22657d..5730887411a 100644 --- a/meta/recipes-devtools/rust/rust.inc +++ b/meta/recipes-devtools/rust/rust.inc @@ -23,7 +23,6 @@ CARGO_DISABLE_BITBAKE_VENDORING = "1" # We can't use RUST_BUILD_SYS here because that may be "musl" if # TCLIBC="musl". Snapshots are always -unknown-linux-gnu -SNAPSHOT_BUILD_SYS = "${RUST_BUILD_ARCH}-unknown-linux-gnu" setup_cargo_environment () { # The first step is to build bootstrap and some early stage tools, # these are build for the same target as the snapshot, e.g. @@ -31,7 +30,7 @@ setup_cargo_environment () { # Later stages are build for the native target (i.e. target.x86_64-linux) cargo_common_do_configure - printf '[target.%s]\n' "${SNAPSHOT_BUILD_SYS}" >> ${CARGO_HOME}/config + printf '[target.%s]\n' "${RUST_BUILD_SYS}" >> ${CARGO_HOME}/config printf "linker = '%s'\n" "${RUST_BUILD_CCLD}" >> ${CARGO_HOME}/config } @@ -89,7 +88,7 @@ python do_configure() { # If we don't do this rust-native will compile it's own llvm for BUILD. # [target.${BUILD_ARCH}-unknown-linux-gnu] - build_section = "target.{}".format(d.getVar('SNAPSHOT_BUILD_SYS', True)) + build_section = "target.{}".format(d.getVar('RUST_BUILD_SYS', True)) config.add_section(build_section) config.set(build_section, "llvm-config", e(llvm_config_build)) @@ -136,7 +135,7 @@ python do_configure() { # We can't use BUILD_SYS since that is something the rust snapshot knows # nothing about when trying to build some stage0 tools (like fabricate) - config.set("build", "build", e(d.getVar("SNAPSHOT_BUILD_SYS", True))) + config.set("build", "build", e(d.getVar("RUST_BUILD_SYS", True))) # [install] config.add_section("install") From patchwork Fri Aug 5 13:12:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 11017 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 A5183C28B2B for ; Fri, 5 Aug 2022 13:13:20 +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.web10.6822.1659705177741602045 for ; Fri, 05 Aug 2022 06:13:11 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=N6PibkW4; spf=pass (domain: linuxfoundation.org, ip: 209.85.128.41, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wm1-f41.google.com with SMTP id s13so946067wmj.1 for ; Fri, 05 Aug 2022 06:13:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc; bh=O7KctozCA4tg6jvL/YfCpxVrdj8MFUJjpJ9u06xms7o=; b=N6PibkW4keK3FJ9cm2szmHOYr0QnDZ2RlU9/UOz/lS4jwBATavndEgQRwdi/XbafeL e53u+Pq86A/91jd6TlROAxWvleOfg7B4PJb2sRCis5XCLQuihNu/+3xcvUoL9KvmapV/ ZyDV+ktWaIgz3PX3fpWg9+53eGUfGvtla4HWM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc; bh=O7KctozCA4tg6jvL/YfCpxVrdj8MFUJjpJ9u06xms7o=; b=RlnwxFyR6XLcotXSEN2qHdmnYU3kTfSre690ByYBAOaOkTNw0ZbHhABU96FRfEWFH3 ufenb4x1NFJasyYsANFQUR7Riij7gw/7SX+TXaaL67gT2mubEMMbaESS1fiOpRLIY2X9 lfMzcuqGJPeG/iFawaUx+GTgMl7Txf0JBKK8iuTshMp/AR4yX1w97UXIiIObuSULgeXD xnLBC2XbFu5y7yM9ttvbKf7a5iSx6S2VHFoVvKVw1/6Y/UL+hINXY9sULCkPEjtjQHb/ rtgEO0YRG9NfIjZ6WwKq1xZR8nsTT0zWVJMOPcWcn6aKqNcBvKXXvZLoiVp1ez46WwXq khTQ== X-Gm-Message-State: ACgBeo3JyrHj/yCuNC0e+2cQedLLaBH76sadNilujSj64W1cF3jDxovh O61JAouVVjuOX+XY217FazGj0w4kkc6WCA== X-Google-Smtp-Source: AA6agR4otZpmgVarvbLXk2MpkDwTYz4adqBgm7+gQDFOylkjygaFgaaWDXHtCXsesDYXvRqWxZyQIw== X-Received: by 2002:a05:600c:1e03:b0:3a3:6cd6:1d38 with SMTP id ay3-20020a05600c1e0300b003a36cd61d38mr9570767wmb.25.1659705190370; Fri, 05 Aug 2022 06:13:10 -0700 (PDT) Received: from max.int.rpsys.net ([2001:8b0:aba:5f3c:f483:fcb0:1452:5a5a]) by smtp.gmail.com with ESMTPSA id p12-20020a05600c204c00b003a51a0d35e7sm1908901wmg.37.2022.08.05.06.13.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Aug 2022 06:13:09 -0700 (PDT) From: Richard Purdie To: openembedded-core@lists.openembedded.org Subject: [PATCH 17/29] cargo_common: Handle build SYS as well as HOST/TARGET Date: Fri, 5 Aug 2022 14:12:40 +0100 Message-Id: <20220805131252.3706794-17-richard.purdie@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220805131252.3706794-1-richard.purdie@linuxfoundation.org> References: <20220805131252.3706794-1-richard.purdie@linuxfoundation.org> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 05 Aug 2022 13:13:20 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/168951 Improve the common class to handle BUILD_SYS as well as host and target, removing the need to a workaround in the rust recipe. Signed-off-by: Richard Purdie --- meta/classes/cargo_common.bbclass | 9 +++++++++ meta/recipes-devtools/rust/rust.inc | 3 --- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/meta/classes/cargo_common.bbclass b/meta/classes/cargo_common.bbclass index dcd0afd9801..4a419cdd0a3 100644 --- a/meta/classes/cargo_common.bbclass +++ b/meta/classes/cargo_common.bbclass @@ -82,6 +82,15 @@ cargo_common_do_configure () { EOF fi + if [ "${RUST_TARGET_SYS}" != "${RUST_BUILD_SYS}" -a "${RUST_TARGET_SYS}" != "${RUST_HOST_SYS}"]; then + cat <<- EOF >> ${CARGO_HOME}/config + + # TARGET_SYS + [target.${RUST_TARGET_SYS}] + linker = "${RUST_TARGET_CCLD}" + EOF + fi + # Put build output in build directory preferred by bitbake instead of # inside source directory unless they are the same if [ "${B}" != "${S}" ]; then diff --git a/meta/recipes-devtools/rust/rust.inc b/meta/recipes-devtools/rust/rust.inc index 5730887411a..12c86e02c4a 100644 --- a/meta/recipes-devtools/rust/rust.inc +++ b/meta/recipes-devtools/rust/rust.inc @@ -29,9 +29,6 @@ setup_cargo_environment () { # x86_64-unknown-linux-gnu. # Later stages are build for the native target (i.e. target.x86_64-linux) cargo_common_do_configure - - printf '[target.%s]\n' "${RUST_BUILD_SYS}" >> ${CARGO_HOME}/config - printf "linker = '%s'\n" "${RUST_BUILD_CCLD}" >> ${CARGO_HOME}/config } inherit rust-target-config From patchwork Fri Aug 5 13:12:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 11016 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 9FD7AC25B0E for ; Fri, 5 Aug 2022 13:13:20 +0000 (UTC) Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) by mx.groups.io with SMTP id smtpd.web11.6700.1659705193015844321 for ; Fri, 05 Aug 2022 06:13:13 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=P6ctC4t3; spf=pass (domain: linuxfoundation.org, ip: 209.85.221.46, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wr1-f46.google.com with SMTP id z16so3172332wrh.12 for ; Fri, 05 Aug 2022 06:13:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc; bh=8375xG5KIqTBCOvn00jcoIS+CjFWQyKYw8uzqmJ+4kU=; b=P6ctC4t3sr2qo3an4tMMqKbZosuMk60ZNk3eDfbhQAWv7kqZSRmgOC8hC6l27XJMan 4Fq7n7pAsrpLVpWjxm1+2OrXYQdV5BRAw0Q9R8+PKaqbl5EQuk2JybCrjmpmjvaGxK7B dOjgLHgg8/KskQEhDBwsgtjOIYyVSaRkGeRVM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc; bh=8375xG5KIqTBCOvn00jcoIS+CjFWQyKYw8uzqmJ+4kU=; b=SjVWuLg0kVWaznIRkyvH0/70+g/ztFQAtt6RcTtVKCDSQTGHR6qlOAPAZs6mEOm7L7 m9GQc9vpXFtDc9N/+Jy2POrlen89jcO/0H1IvfcpzS78Eci8jjNqTaBqxXQhN3oqo5zP Vnx+/eKg5J3aB1grCMIiEcpo46cbpls7yk1c2Ey7Z/lhnvQnbqT8SEMFH6Rsi6gOWGYH sJVzn6RoMDoRuH/DVCZXcjxynZ/uQTcdXJMK9gjkMoOziFa7EIpBYW26WyONSPb4mh56 C7PNOl3mDmEd6p+vUvxMq1229XJM4TNj2Nf20rXYhxh6/9/uUcmztm8KfaIlmd+tVuOy gBng== X-Gm-Message-State: ACgBeo3ETyK9UNxuN3WKEyGMw62MJ/Da1CqxyRcLRJnTmTIe3k54NxPr +kMVgV4+FDkq0I38j4xAbitS4xTwegDu9A== X-Google-Smtp-Source: AA6agR5QlS2hBtO/hrYoYm3NYzzTwfKs1TCVy54KknwjdlgnSasr/oT9x8T/zjUt8NmFPJ26KUTcRg== X-Received: by 2002:a5d:6241:0:b0:21e:f97f:d0cb with SMTP id m1-20020a5d6241000000b0021ef97fd0cbmr4376017wrv.37.1659705191178; Fri, 05 Aug 2022 06:13:11 -0700 (PDT) Received: from max.int.rpsys.net ([2001:8b0:aba:5f3c:f483:fcb0:1452:5a5a]) by smtp.gmail.com with ESMTPSA id p12-20020a05600c204c00b003a51a0d35e7sm1908901wmg.37.2022.08.05.06.13.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Aug 2022 06:13:10 -0700 (PDT) From: Richard Purdie To: openembedded-core@lists.openembedded.org Subject: [PATCH 18/29] rust-llvm: Enable nativesdk variant Date: Fri, 5 Aug 2022 14:12:41 +0100 Message-Id: <20220805131252.3706794-18-richard.purdie@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220805131252.3706794-1-richard.purdie@linuxfoundation.org> References: <20220805131252.3706794-1-richard.purdie@linuxfoundation.org> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 05 Aug 2022 13:13:20 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/168952 The allow nativesdk variants of the tools to build, enable a nativesdk variant of rust-llvm. Signed-off-by: Richard Purdie --- meta/recipes-devtools/rust/rust-llvm.inc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/meta/recipes-devtools/rust/rust-llvm.inc b/meta/recipes-devtools/rust/rust-llvm.inc index 9baad12dc8e..625eb570416 100644 --- a/meta/recipes-devtools/rust/rust-llvm.inc +++ b/meta/recipes-devtools/rust/rust-llvm.inc @@ -47,6 +47,13 @@ EXTRA_OECMAKE:append:class-target = "\ -DLLVM_CONFIG_PATH=${STAGING_LIBDIR_NATIVE}/llvm-rust/bin/llvm-config \ " +EXTRA_OECMAKE:append:class-nativesdk = "\ + -DCMAKE_CROSSCOMPILING:BOOL=ON \ + -DLLVM_BUILD_TOOLS=OFF \ + -DLLVM_TABLEGEN=${STAGING_LIBDIR_NATIVE}/llvm-rust/bin/llvm-tblgen \ + -DLLVM_CONFIG_PATH=${STAGING_LIBDIR_NATIVE}/llvm-rust/bin/llvm-config \ +" + # The debug symbols are huge here (>2GB) so suppress them since they # provide almost no value. If you really need them then override this INHIBIT_PACKAGE_DEBUG_SPLIT = "1" @@ -68,4 +75,4 @@ 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" -BBCLASSEXTEND = "native" +BBCLASSEXTEND = "native nativesdk" From patchwork Fri Aug 5 13:12:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 11015 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 A0039C282E7 for ; Fri, 5 Aug 2022 13:13:20 +0000 (UTC) Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) by mx.groups.io with SMTP id smtpd.web08.6587.1659705194196225206 for ; Fri, 05 Aug 2022 06:13:14 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=XqVgCrNE; spf=pass (domain: linuxfoundation.org, ip: 209.85.221.42, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wr1-f42.google.com with SMTP id z12so3198457wrs.9 for ; Fri, 05 Aug 2022 06:13:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc; bh=dJm3deYeEwWGNZaBphPaPpkPYhpoNBpT8PRYa5vF1fo=; b=XqVgCrNEJyUTaEV0jGvMrjOnO27ssaG+QmJ6sgY4HAbPSSt5d+v1gbj+LEWx9Lwbhj NNbg5HXbjHElatPpGwFUC9wZvTmcyS3Mydt1i9xm8rghuExQS1xbj/UoSvKzwnN+Zb9T 3caTJ4FQeji4NbJjOG/hxoKFSuQ8uPgx9ADhM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc; bh=dJm3deYeEwWGNZaBphPaPpkPYhpoNBpT8PRYa5vF1fo=; b=63SodAPuqWMpALVCmntduHHc7ZOJZU5+okmSU4YLtFFwg3PfaXmvLhxIyV946YCHdP Lm009gSMmN83p6hwoNDqtkH8TW7oFxbM2XCrMyFMT4ni7X39siNo1WY+ViUDsi0x04Sj b50CqeEMH/GXJHB5Vne+hYP/xM+Fkh7KAEhk+ikImaJtI0Md9IgvE5BjnaqAjGRUDNI+ pxoBHtPjG4Vx7mOOIZnPSQddTeR+pywHsLSeSlDhnhY/od5c0cQ65EtOTCh4R0T3j8a8 jsocuRFiQ6Aos4syGLkO81Fg7gzTIoDbAhveQK58+kxD5SRiWG5QT3NKDVBuS9lWP8Xf amog== X-Gm-Message-State: ACgBeo1Fd6xQ52qdLpBtuwAkXTl2Vnz5z1/clbQIIT0OBmEWu7m2rfcj 96IfxDqZePO+LnWDGIrU6aMYutAn/7Nr5Q== X-Google-Smtp-Source: AA6agR6f8iFEDesKBZ+aEtg4C5Cjo1V8h2rhtHIlFNSPIr6l1CaJ0dZEEldpAFm5ZyxpCWU9b6jBCw== X-Received: by 2002:a5d:40c7:0:b0:220:6407:6fc2 with SMTP id b7-20020a5d40c7000000b0022064076fc2mr4307458wrq.352.1659705192416; Fri, 05 Aug 2022 06:13:12 -0700 (PDT) Received: from max.int.rpsys.net ([2001:8b0:aba:5f3c:f483:fcb0:1452:5a5a]) by smtp.gmail.com with ESMTPSA id p12-20020a05600c204c00b003a51a0d35e7sm1908901wmg.37.2022.08.05.06.13.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Aug 2022 06:13:12 -0700 (PDT) From: Richard Purdie To: openembedded-core@lists.openembedded.org Subject: [PATCH 19/29] rust.inc: Fix for cross compilation configuration Date: Fri, 5 Aug 2022 14:12:42 +0100 Message-Id: <20220805131252.3706794-19-richard.purdie@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220805131252.3706794-1-richard.purdie@linuxfoundation.org> References: <20220805131252.3706794-1-richard.purdie@linuxfoundation.org> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 05 Aug 2022 13:13:20 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/168953 For cross compilation, build, host and target may be different. Ensure the main rust config has the appropriate sections added to match the configurations. Signed-off-by: Richard Purdie --- meta/recipes-devtools/rust/rust.inc | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/meta/recipes-devtools/rust/rust.inc b/meta/recipes-devtools/rust/rust.inc index 12c86e02c4a..7c16b8165bb 100644 --- a/meta/recipes-devtools/rust/rust.inc +++ b/meta/recipes-devtools/rust/rust.inc @@ -73,7 +73,7 @@ python do_configure() { config = configparser.RawConfigParser() # [target.ARCH-poky-linux] - host_section = "target.{}".format(d.getVar('RUST_TARGET_SYS', True)) + host_section = "target.{}".format(d.getVar('RUST_HOST_SYS', True)) config.add_section(host_section) llvm_config_target = d.expand("${RUST_ALTERNATE_EXE_PATH}") @@ -86,12 +86,22 @@ python do_configure() { # If we don't do this rust-native will compile it's own llvm for BUILD. # [target.${BUILD_ARCH}-unknown-linux-gnu] build_section = "target.{}".format(d.getVar('RUST_BUILD_SYS', True)) - config.add_section(build_section) + if build_section != host_section: + config.add_section(build_section) - config.set(build_section, "llvm-config", e(llvm_config_build)) + config.set(build_section, "llvm-config", e(llvm_config_build)) - config.set(build_section, "cxx", e(d.expand("${RUST_BUILD_CXX}"))) - config.set(build_section, "cc", e(d.expand("${RUST_BUILD_CC}"))) + config.set(build_section, "cxx", e(d.expand("${RUST_BUILD_CXX}"))) + config.set(build_section, "cc", e(d.expand("${RUST_BUILD_CC}"))) + + target_section = "target.{}".format(d.getVar('RUST_TARGET_SYS', True)) + if target_section != host_section and target_section != build_section: + config.add_section(target_section) + + config.set(target_section, "llvm-config", e(llvm_config_target)) + + config.set(target_section, "cxx", e(d.expand("${RUST_TARGET_CXX}"))) + config.set(target_section, "cc", e(d.expand("${RUST_TARGET_CC}"))) # [llvm] config.add_section("llvm") From patchwork Fri Aug 5 13:12:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 11014 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 99DD5C25B0C for ; Fri, 5 Aug 2022 13:13:20 +0000 (UTC) Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) by mx.groups.io with SMTP id smtpd.web09.6782.1659705187235305448 for ; Fri, 05 Aug 2022 06:13:14 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=CdCJigfe; spf=pass (domain: linuxfoundation.org, ip: 209.85.221.43, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wr1-f43.google.com with SMTP id n4so1463416wrp.10 for ; Fri, 05 Aug 2022 06:13:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc; bh=Wzb8J8ky9isqgGk0tt0WCT8QETut2REefbZkobgzND0=; b=CdCJigfemzavJZvwzKRoyC1YEhqaAJtzX3H2PmliNDMIojuAjOZM1pv9WPzXROB3pz LozxsagEBG56M8o8rE6F4nyghPYdGv8v/N8MFZIzX5KRam1pTno3+vCaR0/pqfc/edAy zv2OEwqCsI2hD1ECguebgLgHNn5nhiEjNogi4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc; bh=Wzb8J8ky9isqgGk0tt0WCT8QETut2REefbZkobgzND0=; b=wQSgpuo+9bN4XBqAwtgRkdH7fhJS3WniIOvwNGYzE9zzEJlcMOLVxeXt1h+EzFx4jY CV1wEICkMP0FTfGAQ4GwdG5wVBz0RAwHF632ksJNZIJgMIsDeuC4Ole/EjW0JM392Ny/ LmhdSTcSAUxTQ8/tYi/5mCD8dwHITefKmWMaluTd/WWWMXhZtxchwkh/LEUzHrawm2b5 RHOAX+IFnQuT1j7hWZ3wILDYinJu6LCUw2XvpjgtWoI5RwiRY0IIdkMK1PpFF12mjfaY NK8Z9hS8UkHxzzDrIOjIKdHB/cVKATNsp3GijVIqHLucNEUUKPCn8cFGbsv/SXx1Hx8E Uz8g== X-Gm-Message-State: ACgBeo2L/pHD27F2klR17aGkpn/jOar/6Y/wx3guDv8M1Ajm2iavazG7 D/af/wPux7BfWacOwNdGWw2uDmzpOF/F8Q== X-Google-Smtp-Source: AA6agR7KyS1zUffYW7Rv+OXgYVDi2dTDPtPwzwOt8I0iyN/28C6PprcgspKb6gulsD1rSNnpquCuYQ== X-Received: by 2002:a5d:6d49:0:b0:21b:a3ba:30b5 with SMTP id k9-20020a5d6d49000000b0021ba3ba30b5mr4434953wri.513.1659705193584; Fri, 05 Aug 2022 06:13:13 -0700 (PDT) Received: from max.int.rpsys.net ([2001:8b0:aba:5f3c:f483:fcb0:1452:5a5a]) by smtp.gmail.com with ESMTPSA id p12-20020a05600c204c00b003a51a0d35e7sm1908901wmg.37.2022.08.05.06.13.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Aug 2022 06:13:13 -0700 (PDT) From: Richard Purdie To: openembedded-core@lists.openembedded.org Subject: [PATCH 20/29] rust-common: Update to match cross targets Date: Fri, 5 Aug 2022 14:12:43 +0100 Message-Id: <20220805131252.3706794-20-richard.purdie@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220805131252.3706794-1-richard.purdie@linuxfoundation.org> References: <20220805131252.3706794-1-richard.purdie@linuxfoundation.org> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 05 Aug 2022 13:13:20 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/168954 Tweak the armv7 workaround to work for cross environments and as a host triplet and not just as a target. Signed-off-by: Richard Purdie --- meta/classes/rust-common.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/classes/rust-common.bbclass b/meta/classes/rust-common.bbclass index f2e99493fef..7c432ed131b 100644 --- a/meta/classes/rust-common.bbclass +++ b/meta/classes/rust-common.bbclass @@ -63,7 +63,7 @@ def rust_base_triple(d, thing): ''' # The llvm-target for armv7 is armv7-unknown-linux-gnueabihf - if thing == "TARGET" and target_is_armv7(d): + if d.getVar('{}_ARCH'.format(thing)) == d.getVar('TARGET_ARCH') and target_is_armv7(d): arch = "armv7" else: arch = oe.rust.arch_to_rust_arch(d.getVar('{}_ARCH'.format(thing))) From patchwork Fri Aug 5 13:12:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 11012 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 9400DC25B0D for ; Fri, 5 Aug 2022 13:13:20 +0000 (UTC) Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) by mx.groups.io with SMTP id smtpd.web08.6587.1659705194196225206 for ; Fri, 05 Aug 2022 06:13:16 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=I9u6xHVx; spf=pass (domain: linuxfoundation.org, ip: 209.85.221.42, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wr1-f42.google.com with SMTP id z12so3198590wrs.9 for ; Fri, 05 Aug 2022 06:13:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc; bh=KD3zi5VPJTUIl7gf3YBtUk8udugvSm2OeCj9+Gfd9H8=; b=I9u6xHVxYi06hu3ueB4ZvGZCSfyt7W2evLKjC80kamjj6EI2mKOHiEGwi4ZpSZakYt kH0kpO+FjIOJF+lb6qLTamfScKZIDFCyhtz9qROtyGfnmSudzQEq6aOTStKHJxb+47uH Z6iALNlSG+bGOqhD3l4iv4sgawwI/4isG6zr8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc; bh=KD3zi5VPJTUIl7gf3YBtUk8udugvSm2OeCj9+Gfd9H8=; b=BRE+O9xLm1JpeWfZ6+YeRuSEgrdDsv0GE8xlm9UAJAJfVGo4SBjuvkt5ItZi/ILvc8 RhzR6h4/cAxLw767AZBUCzm43BMguj8QgMWFdf+5y8YwT0kocTNVpYjK9wb7PzqgQpF0 WhxCJI58/CvcvqlqIqjPYqKWpoCeYSlGiRxL0nA976jGUYfJO02QvLdCNZAAHgtSk7ko iCOXc48CI+RCz9/US82rOzsFe9nSq9uk0ORAb3kK3PON0neYxH3VxQalS40tp+Ue+skL R+QG4c/Hq4yTbufx+pLhpRGbBWcaN6+r57svioIoTEA1A1qAJKTK0n/QYSQVeBNDBrSU sc2g== X-Gm-Message-State: ACgBeo3r6M01UUF73l1jB1ONX8ChFD9UddtqRvlYuocpZItdcYAt5XnG Mm8TkWf31Ppiw2tktNIZFynZ5r8Y6bzUgg== X-Google-Smtp-Source: AA6agR6A9WIPcR2ejmgUa5PM5dYCWORaLOm0cRtIt17KFVANTBgQEGU15Fs4VaFE0KOR3u05qHF2uQ== X-Received: by 2002:a05:6000:18ab:b0:220:6c0d:8157 with SMTP id b11-20020a05600018ab00b002206c0d8157mr4410699wri.438.1659705194792; Fri, 05 Aug 2022 06:13:14 -0700 (PDT) Received: from max.int.rpsys.net ([2001:8b0:aba:5f3c:f483:fcb0:1452:5a5a]) by smtp.gmail.com with ESMTPSA id p12-20020a05600c204c00b003a51a0d35e7sm1908901wmg.37.2022.08.05.06.13.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Aug 2022 06:13:14 -0700 (PDT) From: Richard Purdie To: openembedded-core@lists.openembedded.org Subject: [PATCH 21/29] rust-target-config: Make target workaround generic Date: Fri, 5 Aug 2022 14:12:44 +0100 Message-Id: <20220805131252.3706794-21-richard.purdie@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220805131252.3706794-1-richard.purdie@linuxfoundation.org> References: <20220805131252.3706794-1-richard.purdie@linuxfoundation.org> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 05 Aug 2022 13:13:20 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/168955 Ensure the 'target' data is set for both HOST and TARGET queries as appropriate to work correctly in cross configurations. Signed-off-by: Richard Purdie --- meta/classes/rust-target-config.bbclass | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/meta/classes/rust-target-config.bbclass b/meta/classes/rust-target-config.bbclass index bc6bd77abbf..b3c738f02a4 100644 --- a/meta/classes/rust-target-config.bbclass +++ b/meta/classes/rust-target-config.bbclass @@ -290,6 +290,10 @@ llvm_cpu[vardepvalue] = "${@llvm_cpu(d)}" def rust_gen_target(d, thing, wd, arch): import json + + build_sys = d.getVar('BUILD_SYS') + target_sys = d.getVar('TARGET_SYS') + sys = d.getVar('{}_SYS'.format(thing)) prefix = d.getVar('{}_PREFIX'.format(thing)) rustsys = d.getVar('RUST_{}_SYS'.format(thing)) @@ -298,7 +302,9 @@ def rust_gen_target(d, thing, wd, arch): cpu = "generic" features = "" - if thing == "TARGET": + # Need to apply the target tuning conssitently, only if the triplet applies to the target + # and not in the native case + if sys == target_sys and sys != build_sys: abi = d.getVar('ABIEXTENSION') cpu = llvm_cpu(d) if bb.data.inherits_class('native', d): From patchwork Fri Aug 5 13:12:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 11011 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 93A73C25B06 for ; Fri, 5 Aug 2022 13:13:20 +0000 (UTC) Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) by mx.groups.io with SMTP id smtpd.web12.6780.1659705197775584356 for ; Fri, 05 Aug 2022 06:13:18 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=EnhZaop1; spf=pass (domain: linuxfoundation.org, ip: 209.85.221.45, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wr1-f45.google.com with SMTP id q30so3182139wra.11 for ; Fri, 05 Aug 2022 06:13:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc; bh=EQAAOsR7VDLPtDmBP8DxT83b4Y/vW7FfqwsE2nmDzgI=; b=EnhZaop19he4MHThFeRGI4DiqwroWQIQ0ImH3/GivZsrwxuV2TXMR9fQ5biGJvh38V IHo1qDQkN9DXS5HheRdSmVbFVa8WLeWyShSZS+soZ/WNrhWEM4mXG7UEGAURloYl9wFi OTZs2JGFLp1EL6rXVTzZMUSpHOeZJALzdeUlQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc; bh=EQAAOsR7VDLPtDmBP8DxT83b4Y/vW7FfqwsE2nmDzgI=; b=g8o6eD7mP3088uChTD31+vC2jCBfGE222KRhISM4OZww+C8daU42wWV7QekMedOhp2 jA6Y6b5gs7vxF95YPECGyoSo83WQ8mrSZa61PeyAjbWu32mdpdmgaavsADFDmnE7r2KV 3KY53xDB9yUtwk1d7IJryegz1Wlz/T5/LgNzTRd1G/E86zTylZ9u/PR7H3hFfasEjDIs +MI4YbxvAF0QQjuGSF8hC4dUt5tNJTQcPfZwTeCFHDv9AOLRZqMAZzkHyElnWX1evSB/ LcBgly69zoPDTh8PpbmEoBwoOUSxxw6Hq6G40muSGPrNwdQNvrqZEH5TIBaX+SC4NILD RrCw== X-Gm-Message-State: ACgBeo0/6i8NbshTi+yyp7S34mUCBg7wmMz1XXscs+sK25YG2i2wLCWi 5SZVGCWDOLcGb+pX+H19kI+MRdTS93PL+g== X-Google-Smtp-Source: AA6agR4x2DBNa9yd7ZByEhyArn1QI8VB35dJCem3k+hr+fz7MXl8AiZYZDoidzCQQxfGY1DGwXsFog== X-Received: by 2002:a5d:64ca:0:b0:220:6247:42c1 with SMTP id f10-20020a5d64ca000000b00220624742c1mr4326366wri.478.1659705195953; Fri, 05 Aug 2022 06:13:15 -0700 (PDT) Received: from max.int.rpsys.net ([2001:8b0:aba:5f3c:f483:fcb0:1452:5a5a]) by smtp.gmail.com with ESMTPSA id p12-20020a05600c204c00b003a51a0d35e7sm1908901wmg.37.2022.08.05.06.13.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Aug 2022 06:13:15 -0700 (PDT) From: Richard Purdie To: openembedded-core@lists.openembedded.org Subject: [PATCH 22/29] rust-common: Simplify libc handling Date: Fri, 5 Aug 2022 14:12:45 +0100 Message-Id: <20220805131252.3706794-22-richard.purdie@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220805131252.3706794-1-richard.purdie@linuxfoundation.org> References: <20220805131252.3706794-1-richard.purdie@linuxfoundation.org> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 05 Aug 2022 13:13:20 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/168956 The current libc handling code is simply wrong in many cases. Simplify it to a check of the triplet for musl handling which is much simpler and less error prone when handling things like nativesdk targets. Signed-off-by: Richard Purdie --- meta/classes/rust-common.bbclass | 45 ++++++-------------------------- 1 file changed, 8 insertions(+), 37 deletions(-) diff --git a/meta/classes/rust-common.bbclass b/meta/classes/rust-common.bbclass index 7c432ed131b..516b258c15e 100644 --- a/meta/classes/rust-common.bbclass +++ b/meta/classes/rust-common.bbclass @@ -13,27 +13,6 @@ RUSTFLAGS += "${RUSTLIB} ${RUST_DEBUG_REMAP}" RUSTLIB_DEP ?= "libstd-rs" RUST_PANIC_STRATEGY ?= "unwind" -# Native builds are not effected by TCLIBC. Without this, rust-native -# thinks it's "target" (i.e. x86_64-linux) is a musl target. -RUST_LIBC = "${TCLIBC}" -RUST_LIBC:class-crosssdk = "glibc" -RUST_LIBC:class-native = "glibc" - -def determine_libc(d, thing): - '''Determine which libc something should target''' - - # BUILD is never musl, TARGET may be musl or glibc, - # HOST could be musl, but only if a compiler is built to be run on - # target in which case HOST_SYS != BUILD_SYS. - if thing == 'TARGET': - libc = d.getVar('RUST_LIBC') - elif thing == 'BUILD' and (d.getVar('HOST_SYS') != d.getVar('BUILD_SYS')): - libc = d.getVar('RUST_LIBC') - else: - libc = d.getVar('RUST_LIBC:class-native') - - return libc - def target_is_armv7(d): '''Determine if target is armv7''' # TUNE_FEATURES may include arm* even if the target is not arm @@ -73,26 +52,18 @@ def rust_base_triple(d, thing): if thing == "BUILD" and bpn in ["rust"]: return arch + "-unknown-linux-gnu" - # All the Yocto targets are Linux and are 'unknown' - vendor = "-unknown" - os = d.getVar('{}_OS'.format(thing)) - libc = determine_libc(d, thing) - - # Prefix with a dash and convert glibc -> gnu - if libc == "glibc": - libc = "-gnu" - elif libc == "musl": - libc = "-musl" - - # Don't double up musl (only appears to be the case on aarch64) - if os == "linux-musl": - if libc != "-musl": - bb.fatal("{}_OS was '{}' but TCLIBC was not 'musl'".format(thing, os)) - os = "linux" + vendor = d.getVar('{}_VENDOR'.format(thing)) + # Default to glibc + libc = "-gnu" + os = d.getVar('{}_OS'.format(thing)) # This catches ARM targets and appends the necessary hard float bits if os == "linux-gnueabi" or os == "linux-musleabi": libc = bb.utils.contains('TUNE_FEATURES', 'callconvention-hard', 'hf', '', d) + elif "musl" in os: + libc = "-musl" + os = "linux" + return arch + vendor + '-' + os + libc From patchwork Fri Aug 5 13:12:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 11010 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 88135C3F6B0 for ; Fri, 5 Aug 2022 13:13:20 +0000 (UTC) Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) by mx.groups.io with SMTP id smtpd.web11.6701.1659705199070377879 for ; Fri, 05 Aug 2022 06:13:19 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=g61+dJrQ; spf=pass (domain: linuxfoundation.org, ip: 209.85.221.52, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wr1-f52.google.com with SMTP id q30so3182206wra.11 for ; Fri, 05 Aug 2022 06:13:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc; bh=1F9m6E0GJEZi2ZJ/R/i2ot8u2oBB2TmMz7+MZsSQC7g=; b=g61+dJrQpZeeHnw8iT+OCKfngQwK7J14tDTCOZ+vNVjXRcSXv6ysEz/Ak7oOtdOWoP b5qZYbJns/Pa7QgV8dqsddIOIzYPchS6yPcfvfXwePpTxzicAb2/fqDwt01NFNoyrxBR 3+r+8QfKbEfEAN3ui25B3mDQ1ZGwZdPaIItyQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc; bh=1F9m6E0GJEZi2ZJ/R/i2ot8u2oBB2TmMz7+MZsSQC7g=; b=wNzLCKgcKnd/avMIxXMkFGEsxxL1wpkzBDwcAkiL1RQoH/Qelf8vbaFZ5cYbo11wqG dWU/fK/yByIw+reK9U3zSsGgJjrWJSemk1er5MGx7BG0kNaBlsf3OawxYxnMy4wVmVzh T44zRt+mY7cLhE3bJEKxbxeJaszoD3p1fPoIZrdJL7lbi/GTEyrMCP3/ee5DjssrxzRI 0ToAukIsWfatmIhCYBEO+qI8Oq7fhoPFYobl8SDUCcwJo1G7GlWDtUo0u5SLOmygd6ln t436fEo3LHg3EZl00U1T1+LbHucxcfWh+yNpha/sWlmNy7rQGpWwAb400/AKE+pjZIwy GkgQ== X-Gm-Message-State: ACgBeo2amKVQkaj6KnYcI9O7lGtNtO+BkewTUxVnf9UqMbSGe9YuIXq6 ziPIGOydPwdJWK+PABbEai77QgMPn3DZ1A== X-Google-Smtp-Source: AA6agR4oP7gILeOf7q2jztl2r/3hf/XVY30s5vsWz4MEKOjLcEMOEx7QGiUErtF3zyX5Lg9JcJRwOA== X-Received: by 2002:a05:6000:1a53:b0:220:77d7:75f8 with SMTP id t19-20020a0560001a5300b0022077d775f8mr4482446wry.0.1659705197201; Fri, 05 Aug 2022 06:13:17 -0700 (PDT) Received: from max.int.rpsys.net ([2001:8b0:aba:5f3c:f483:fcb0:1452:5a5a]) by smtp.gmail.com with ESMTPSA id p12-20020a05600c204c00b003a51a0d35e7sm1908901wmg.37.2022.08.05.06.13.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Aug 2022 06:13:16 -0700 (PDT) From: Richard Purdie To: openembedded-core@lists.openembedded.org Subject: [PATCH 23/29] cargo: Drop cross-canadian variant and fix/use nativesdk Date: Fri, 5 Aug 2022 14:12:46 +0100 Message-Id: <20220805131252.3706794-23-richard.purdie@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220805131252.3706794-1-richard.purdie@linuxfoundation.org> References: <20220805131252.3706794-1-richard.purdie@linuxfoundation.org> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 05 Aug 2022 13:13:20 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/168957 The cargo-cross-candian variant made no sense as one version of cargo in the SDK can work for all targets. Replace it with nativesdk-cargo instead. Move the SDK env to rust-cross-canadian. Signed-off-by: Richard Purdie --- meta/conf/distro/include/maintainers.inc | 1 - .../packagegroup-rust-cross-canadian.bb | 3 +- .../cargo/cargo-cross-canadian.inc | 85 ------------------- .../cargo/cargo-cross-canadian_1.62.0.bb | 6 -- meta/recipes-devtools/cargo/cargo.inc | 5 ++ meta/recipes-devtools/cargo/cargo_1.62.0.bb | 1 + .../rust/rust-cross-canadian.inc | 37 ++++++++ 7 files changed, 44 insertions(+), 94 deletions(-) delete mode 100644 meta/recipes-devtools/cargo/cargo-cross-canadian.inc delete mode 100644 meta/recipes-devtools/cargo/cargo-cross-canadian_1.62.0.bb diff --git a/meta/conf/distro/include/maintainers.inc b/meta/conf/distro/include/maintainers.inc index e20275c6746..b563c517962 100644 --- a/meta/conf/distro/include/maintainers.inc +++ b/meta/conf/distro/include/maintainers.inc @@ -90,7 +90,6 @@ RECIPE_MAINTAINER:pn-bzip2 = "Denys Dmytriyenko " RECIPE_MAINTAINER:pn-ca-certificates = "Alexander Kanavin " RECIPE_MAINTAINER:pn-cairo = "Anuj Mittal " RECIPE_MAINTAINER:pn-cargo = "Randy MacLeod " -RECIPE_MAINTAINER:pn-cargo-cross-canadian-${TRANSLATED_TARGET_ARCH} = "Randy MacLeod " RECIPE_MAINTAINER:pn-cantarell-fonts = "Alexander Kanavin " RECIPE_MAINTAINER:pn-ccache = "Robert Yang " RECIPE_MAINTAINER:pn-cdrtools-native = "Yi Zhao " diff --git a/meta/recipes-core/packagegroups/packagegroup-rust-cross-canadian.bb b/meta/recipes-core/packagegroups/packagegroup-rust-cross-canadian.bb index 0d4f5ec9ef2..6d324002a1a 100644 --- a/meta/recipes-core/packagegroups/packagegroup-rust-cross-canadian.bb +++ b/meta/recipes-core/packagegroups/packagegroup-rust-cross-canadian.bb @@ -6,12 +6,11 @@ inherit cross-canadian packagegroup PACKAGEGROUP_DISABLE_COMPLEMENTARY = "1" RUST="rust-cross-canadian-${TRANSLATED_TARGET_ARCH}" -CARGO="cargo-cross-canadian-${TRANSLATED_TARGET_ARCH}" RUST_TOOLS="rust-tools-cross-canadian-${TRANSLATED_TARGET_ARCH}" RDEPENDS:${PN} = " \ ${@all_multilib_tune_values(d, 'RUST')} \ - ${@all_multilib_tune_values(d, 'CARGO')} \ + nativesdk-cargo \ rust-cross-canadian-src \ ${@all_multilib_tune_values(d, 'RUST_TOOLS')} \ " diff --git a/meta/recipes-devtools/cargo/cargo-cross-canadian.inc b/meta/recipes-devtools/cargo/cargo-cross-canadian.inc deleted file mode 100644 index a2fac929d45..00000000000 --- a/meta/recipes-devtools/cargo/cargo-cross-canadian.inc +++ /dev/null @@ -1,85 +0,0 @@ -SUMMARY = "Cargo, a package manager for Rust cross canadian flavor." - -RUST_ALTERNATE_EXE_PATH = "${STAGING_LIBDIR_NATIVE}/llvm-rust/bin/llvm-config" - -HOST_SYS = "${HOST_ARCH}-unknown-linux-gnu" -CARGO_RUST_TARGET_CCLD = "${RUST_BUILD_CCLD}" - -inherit rust-target-config -require cargo.inc - -CARGO = "${WORKDIR}/${CARGO_SNAPSHOT}/bin/cargo" -BASEDEPENDS:remove = "cargo-native" - -export RUST_TARGET_PATH="${WORKDIR}/targets/" - -RUSTLIB = " \ - -L ${STAGING_DIR_NATIVE}/${SDKPATHNATIVE}/usr/lib/${TARGET_SYS}/rustlib/${HOST_SYS}/lib \ -" - -DEPENDS += "rust-native \ - rust-cross-canadian-${TRANSLATED_TARGET_ARCH} \ - virtual/nativesdk-${HOST_PREFIX}compilerlibs \ - nativesdk-openssl nativesdk-zlib \ - virtual/nativesdk-libc \ -" - -inherit cross-canadian - -PN = "cargo-cross-canadian-${TRANSLATED_TARGET_ARCH}" - -RUST_TARGETGENS = "BUILD HOST" - -do_compile:prepend () { - PKG_CONFIG_PATH="${RECIPE_SYSROOT_NATIVE}/usr/lib/pkgconfig:${PKG_CONFIG_PATH}" -} - -create_sdk_wrapper () { - file="$1" - shift - - cat <<- EOF > "${file}" - #!/bin/sh - \$$1 \$@ - EOF - - chmod +x "$file" -} - -do_install () { - SYS_BINDIR=$(dirname ${D}${bindir}) - install -d "${SYS_BINDIR}" - install -m 755 "${B}/target/${CARGO_TARGET_SUBDIR}/cargo" "${SYS_BINDIR}" - for i in ${SYS_BINDIR}/*; do - chrpath -r "\$ORIGIN/../lib" ${i} - done - - # Uses SDK's CC as linker so linked binaries works out of box. - create_sdk_wrapper "${SYS_BINDIR}/target-rust-ccld" "CC" - - ENV_SETUP_DIR=${D}${base_prefix}/environment-setup.d - mkdir "${ENV_SETUP_DIR}" - ENV_SETUP_SH="${ENV_SETUP_DIR}/cargo.sh" - cat <<- EOF > "${ENV_SETUP_SH}" - export CARGO_HOME="\$OECORE_TARGET_SYSROOT/home/cargo" - mkdir -p "\$CARGO_HOME" - # Init the default target once, it might be otherwise user modified. - if [ ! -f "\$CARGO_HOME/config" ]; then - touch "\$CARGO_HOME/config" - echo "[build]" >> "\$CARGO_HOME/config" - echo 'target = "'${TARGET_SYS}'"' >> "\$CARGO_HOME/config" - echo '# TARGET_SYS' >> "\$CARGO_HOME/config" - echo '[target.'${TARGET_SYS}']' >> "\$CARGO_HOME/config" - echo 'linker = "target-rust-ccld"' >> "\$CARGO_HOME/config" - fi - - # Keep the below off as long as HTTP/2 is disabled. - export CARGO_HTTP_MULTIPLEXING=false - - export CARGO_HTTP_CAINFO="\$OECORE_NATIVE_SYSROOT/etc/ssl/certs/ca-certificates.crt" - EOF -} - -PKG_SYS_BINDIR = "${SDKPATHNATIVE}/usr/bin" -FILES:${PN} += "${base_prefix}/environment-setup.d ${PKG_SYS_BINDIR}" - diff --git a/meta/recipes-devtools/cargo/cargo-cross-canadian_1.62.0.bb b/meta/recipes-devtools/cargo/cargo-cross-canadian_1.62.0.bb deleted file mode 100644 index 63fd69107be..00000000000 --- a/meta/recipes-devtools/cargo/cargo-cross-canadian_1.62.0.bb +++ /dev/null @@ -1,6 +0,0 @@ -require recipes-devtools/rust/rust-source.inc -require recipes-devtools/rust/rust-snapshot.inc - -FILESEXTRAPATHS:prepend := "${THISDIR}/cargo-${PV}:" - -require cargo-cross-canadian.inc diff --git a/meta/recipes-devtools/cargo/cargo.inc b/meta/recipes-devtools/cargo/cargo.inc index 978504052b9..e34554a9d78 100644 --- a/meta/recipes-devtools/cargo/cargo.inc +++ b/meta/recipes-devtools/cargo/cargo.inc @@ -56,3 +56,8 @@ export LIBSSH2_SYS_USE_PKG_CONFIG = "1" # so we must use the locally set up snapshot to bootstrap the build. BASEDEPENDS:remove:class-native = "cargo-native" CARGO:class-native = "${WORKDIR}/${CARGO_SNAPSHOT}/bin/cargo" + +DEPENDS:append:class-nativesdk = " nativesdk-rust" +RUSTLIB:append:class-nativesdk = " -L ${STAGING_DIR_HOST}/${SDKPATHNATIVE}/usr/lib/rustlib/${RUST_HOST_SYS}/lib" + + diff --git a/meta/recipes-devtools/cargo/cargo_1.62.0.bb b/meta/recipes-devtools/cargo/cargo_1.62.0.bb index eee58fc2452..5c8527708cb 100644 --- a/meta/recipes-devtools/cargo/cargo_1.62.0.bb +++ b/meta/recipes-devtools/cargo/cargo_1.62.0.bb @@ -2,3 +2,4 @@ require recipes-devtools/rust/rust-source.inc require recipes-devtools/rust/rust-snapshot.inc require cargo.inc BBCLASSEXTEND = "native nativesdk" +RUSTLIB_DEP:class-nativesdk = "" \ No newline at end of file diff --git a/meta/recipes-devtools/rust/rust-cross-canadian.inc b/meta/recipes-devtools/rust/rust-cross-canadian.inc index 8bbbd61bdc3..677bd8842c6 100644 --- a/meta/recipes-devtools/rust/rust-cross-canadian.inc +++ b/meta/recipes-devtools/rust/rust-cross-canadian.inc @@ -16,6 +16,18 @@ do_compile () { rust_runx build --stage 2 } +create_sdk_wrapper () { + file="$1" + shift + + cat <<- EOF > "${file}" + #!/bin/sh + \$$1 \$@ + EOF + + chmod +x "$file" +} + do_install () { # Rust requires /usr/lib to contain the libs. # Similar story is with /usr/bin ruquiring `lib` to be at the same level. @@ -51,6 +63,11 @@ do_install () { # Remove executable bit from any files so then SDK doesn't try to relocate. chmod -R -x+X ${SRC_DIR} + + # Uses SDK's CC as linker so linked binaries works out of box. + install -d ${SYS_BINDIR} + create_sdk_wrapper "${SYS_BINDIR}/target-rust-ccld" "CC" + ENV_SETUP_DIR=${D}${base_prefix}/environment-setup.d mkdir "${ENV_SETUP_DIR}" ENV_SETUP_SH="${ENV_SETUP_DIR}/rust.sh" @@ -61,6 +78,26 @@ do_install () { EOF chown -R root.root ${D} + + ENV_SETUP_SH="${ENV_SETUP_DIR}/cargo.sh" + cat <<- EOF > "${ENV_SETUP_SH}" + export CARGO_HOME="\$OECORE_TARGET_SYSROOT/home/cargo" + mkdir -p "\$CARGO_HOME" + # Init the default target once, it might be otherwise user modified. + if [ ! -f "\$CARGO_HOME/config" ]; then + touch "\$CARGO_HOME/config" + echo "[build]" >> "\$CARGO_HOME/config" + echo 'target = "'${RUST_TARGET_SYS}'"' >> "\$CARGO_HOME/config" + echo '# TARGET_SYS' >> "\$CARGO_HOME/config" + echo '[target.'${RUST_TARGET_SYS}']' >> "\$CARGO_HOME/config" + echo 'linker = "target-rust-ccld"' >> "\$CARGO_HOME/config" + fi + + # Keep the below off as long as HTTP/2 is disabled. + export CARGO_HTTP_MULTIPLEXING=false + + export CARGO_HTTP_CAINFO="\$OECORE_NATIVE_SYSROOT/etc/ssl/certs/ca-certificates.crt" + EOF } PKG_SYS_LIBDIR = "${SDKPATHNATIVE}/usr/lib" From patchwork Fri Aug 5 13:12:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 11013 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 8D96AC25B08 for ; Fri, 5 Aug 2022 13:13:20 +0000 (UTC) Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) by mx.groups.io with SMTP id smtpd.web12.6767.1659705175208683315 for ; Fri, 05 Aug 2022 06:13:19 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=J1MkEvYl; spf=pass (domain: linuxfoundation.org, ip: 209.85.221.53, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wr1-f53.google.com with SMTP id l4so3179590wrm.13 for ; Fri, 05 Aug 2022 06:13:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc; bh=DTo5j2e7SUYxAIASJznUSvw/QNvpiYxFi4QlTtDlUwc=; b=J1MkEvYlXHLaSz1YLtnob19fkr4VzSPZjb4SNCD7hjwmlA3bhR6wOi3ipresk5rZwR 4LSW4xv3N4PVqKlLxw1aSrCzTPYDYse1o5Zp9oLvPAMZnKOrA9qjp8F2xKwKzf0EXYCq f7y2mWD0BAeKxR8rKC8VHiK1OZZKjRAXhq4NQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc; bh=DTo5j2e7SUYxAIASJznUSvw/QNvpiYxFi4QlTtDlUwc=; b=DoXIsMK+YHG6mDek6x2yIWfZTB4OI0P6DWILdaDoqDCqGLTcONBoUj5rbjNx4iXcac r9lLKyqBSRzehe6ar8IV6Ol7I1fDXzxRq4lAxcy2J7ZLj8eTaptoGNkQpvDy8QO0DK5T q+dKLABLBvzz7O4+PSqPN+cYtf17N169dWFwLeDYTL8QsVmj34s0BDxjuT2N2ul6rma1 VXC8VAWeRnfqMNrFIa973U1htOUtWEBNdEqpwtnT5uUoKc4KQbNoDjvRsk8cGK+gZe50 b3yfwP0JeiMC7/O2GwqxUvUy0HtqF4c6XcnUlwlc0CsyK1lBRU/Y9YWTxRc3SZU6HeOj Tn1A== X-Gm-Message-State: ACgBeo3903uE8yBqQrWgemy1RZ9GVraVu0iAqbCnkNeZjMavGjVUxi38 7JlRpwBmvCez2OmfuVM8XqlhyjKl7xY8jA== X-Google-Smtp-Source: AA6agR4x1uRQ6kC1VPMF3Sqd+G9kAhZWs3vUnLPshBpB5yrAcYeQ0ol83eQdXtEwuAHJXT8QxKFKzg== X-Received: by 2002:a5d:5601:0:b0:220:7144:2938 with SMTP id l1-20020a5d5601000000b0022071442938mr4581005wrv.50.1659705198545; Fri, 05 Aug 2022 06:13:18 -0700 (PDT) Received: from max.int.rpsys.net ([2001:8b0:aba:5f3c:f483:fcb0:1452:5a5a]) by smtp.gmail.com with ESMTPSA id p12-20020a05600c204c00b003a51a0d35e7sm1908901wmg.37.2022.08.05.06.13.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Aug 2022 06:13:18 -0700 (PDT) From: Richard Purdie To: openembedded-core@lists.openembedded.org Subject: [PATCH 24/29] rust-common: Set rustlibdir to match target expectation Date: Fri, 5 Aug 2022 14:12:47 +0100 Message-Id: <20220805131252.3706794-24-richard.purdie@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220805131252.3706794-1-richard.purdie@linuxfoundation.org> References: <20220805131252.3706794-1-richard.purdie@linuxfoundation.org> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 05 Aug 2022 13:13:20 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/168958 Signed-off-by: Richard Purdie --- meta/classes/rust-common.bbclass | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meta/classes/rust-common.bbclass b/meta/classes/rust-common.bbclass index 516b258c15e..8ee05f57f86 100644 --- a/meta/classes/rust-common.bbclass +++ b/meta/classes/rust-common.bbclass @@ -2,12 +2,12 @@ inherit python3native inherit rust-target-config # Common variables used by all Rust builds -export rustlibdir = "${libdir}/rust" +export rustlibdir = "${libdir}/rustlib/${RUST_HOST_SYS}/lib" FILES:${PN} += "${rustlibdir}/*.so" FILES:${PN}-dev += "${rustlibdir}/*.rlib ${rustlibdir}/*.rmeta" FILES:${PN}-dbg += "${rustlibdir}/.debug" -RUSTLIB = "-L ${STAGING_LIBDIR}/rust" +RUSTLIB = "-L ${STAGING_DIR_HOST}${rustlibdir}" RUST_DEBUG_REMAP = "--remap-path-prefix=${WORKDIR}=/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR}" RUSTFLAGS += "${RUSTLIB} ${RUST_DEBUG_REMAP}" RUSTLIB_DEP ?= "libstd-rs" From patchwork Fri Aug 5 13:12:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 11021 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 9DE5EC25B08 for ; Fri, 5 Aug 2022 13:13:30 +0000 (UTC) Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) by mx.groups.io with SMTP id smtpd.web10.6825.1659705185985244244 for ; Fri, 05 Aug 2022 06:13:20 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=cEkxndDI; spf=pass (domain: linuxfoundation.org, ip: 209.85.221.48, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wr1-f48.google.com with SMTP id bv3so3223126wrb.5 for ; Fri, 05 Aug 2022 06:13:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc; bh=CF3mxMtOl/AMFTtFQaFajW6zuCrxI6fPjDU7urA9OeQ=; b=cEkxndDI/smxnEA7J/IHLcqMYUYqkCGhqs7ypIyc9g79wIxdBOYwpmKge+Zg1B0shU h4Fm+ty9kWKdq3IjuywAJVG4kAPe/zck26FM5J831wyUh0dJBo9lFbzzBfgMEkPMle5J 2FtvWxwjNZvpcSb8oD/APam8Na5CBMXhawzwA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc; bh=CF3mxMtOl/AMFTtFQaFajW6zuCrxI6fPjDU7urA9OeQ=; b=Egxd6VmuVASVJW3qBwzLxP4SdLiqq5Ayg/CYRZQ6EKuFbaDTtlY8Gro6ZE71IXutpT FLr5jthEDc3eddm/VTnKHOx9+Dd5Tz4nI7Td4bIDTb1/pSFuXU8+bcHgcjlFlLvJUlAJ vmxCeT6Offrdx/dvP42Xiw52F6YtWUk/af2PCrhJTxwmbME9ZPJHkGFJTdRBHbqXXM9k rpONj9ul8dXSWPnXwH8307j7BkvJTXuS/uIpKdFmO/gJujQy9d2L1xaVTDqMMkWOlThb 605zgQEfN+U1LuCktwb6SORWYzjkL8vqPs6lhRf1hm+yQYhbXtMA0nKcCRDhaOeMrASY R+fA== X-Gm-Message-State: ACgBeo1H/7zZ8XhDqAsAaTG01CCmmFla/KNCUbfZPEQkGg3sBOvhQIvv RrOJxqsv2Ij/uVzvru6iBsrv1kMqLztQng== X-Google-Smtp-Source: AA6agR56vjDCzhkcfPGrreztCDouwrxOOio3hxboNjEo/MmBQcoP2GD+FPPXKhRkNXp3SACgHfgKCQ== X-Received: by 2002:adf:e112:0:b0:21d:7195:3a8d with SMTP id t18-20020adfe112000000b0021d71953a8dmr4472332wrz.371.1659705199368; Fri, 05 Aug 2022 06:13:19 -0700 (PDT) Received: from max.int.rpsys.net ([2001:8b0:aba:5f3c:f483:fcb0:1452:5a5a]) by smtp.gmail.com with ESMTPSA id p12-20020a05600c204c00b003a51a0d35e7sm1908901wmg.37.2022.08.05.06.13.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Aug 2022 06:13:18 -0700 (PDT) From: Richard Purdie To: openembedded-core@lists.openembedded.org Subject: [PATCH 25/29] rust-cross-canadian: Simplify and fix Date: Fri, 5 Aug 2022 14:12:48 +0100 Message-Id: <20220805131252.3706794-25-richard.purdie@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220805131252.3706794-1-richard.purdie@linuxfoundation.org> References: <20220805131252.3706794-1-richard.purdie@linuxfoundation.org> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 05 Aug 2022 13:13:30 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/168959 Since a copy of rust can target any target and doesn't need to be target specific, we can simplify rust-cross-canadian to simply contain the json configuration and envirionment setup scripts. Signed-off-by: Richard Purdie --- .../rust/rust-cross-canadian-common.inc | 49 -------------- .../rust/rust-cross-canadian.inc | 65 +++---------------- .../rust/rust-cross-canadian_1.62.0.bb | 8 +-- 3 files changed, 12 insertions(+), 110 deletions(-) delete mode 100644 meta/recipes-devtools/rust/rust-cross-canadian-common.inc diff --git a/meta/recipes-devtools/rust/rust-cross-canadian-common.inc b/meta/recipes-devtools/rust/rust-cross-canadian-common.inc deleted file mode 100644 index 34020ff6ff4..00000000000 --- a/meta/recipes-devtools/rust/rust-cross-canadian-common.inc +++ /dev/null @@ -1,49 +0,0 @@ - -RUST_ALTERNATE_EXE_PATH = "${STAGING_LIBDIR_NATIVE}/llvm-rust/bin/llvm-config" - -require rust.inc - -DEPENDS += "rust-llvm (=${PV})" - -inherit cross-canadian - -DEPENDS += " \ - virtual/${HOST_PREFIX}gcc-crosssdk \ - virtual/nativesdk-libc rust-llvm-native \ - virtual/${TARGET_PREFIX}compilerlibs \ - virtual/nativesdk-${HOST_PREFIX}compilerlibs \ - gcc-cross-${TARGET_ARCH} \ - " - -# The host tools are likely not to be able to do the necessary operation on -# the target architecturea. Alternatively one could check compatibility -# between host/target. -EXCLUDE_FROM_SHLIBS_${RUSTLIB_TARGET_PN} = "1" - -DEBUG_PREFIX_MAP = "-fdebug-prefix-map=${WORKDIR}=/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR} \ - -fdebug-prefix-map=${STAGING_DIR_HOST}= \ - -fdebug-prefix-map=${STAGING_DIR_NATIVE}= \ - " - -RUST_TARGETGENS = "BUILD HOST TARGET" - -INHIBIT_DEFAULT_RUST_DEPS = "1" - -export WRAPPER_TARGET_CC = "${CCACHE}${TARGET_PREFIX}gcc --sysroot=${STAGING_DIR_TARGET} ${TARGET_CC_ARCH} ${SECURITY_NOPIE_CFLAGS}" -export WRAPPER_TARGET_CXX = "${CCACHE}${TARGET_PREFIX}g++ --sysroot=${STAGING_DIR_TARGET} ${TARGET_CC_ARCH} ${SECURITY_NOPIE_CFLAGS}" -export WRAPPER_TARGET_CCLD = "${TARGET_PREFIX}gcc --sysroot=${STAGING_DIR_TARGET} ${TARGET_CC_ARCH} ${SECURITY_NOPIE_CFLAGS}" -export WRAPPER_TARGET_LDFLAGS = "${TARGET_LDFLAGS}" -export WRAPPER_TARGET_AR = "${TARGET_PREFIX}ar" - -python do_configure:prepend() { - targets = [d.getVar("TARGET_SYS", True), "{}-unknown-linux-gnu".format(d.getVar("HOST_ARCH", True))] - hosts = ["{}-unknown-linux-gnu".format(d.getVar("HOST_ARCH", True))] -} - -INSANE_SKIP:${RUSTLIB_TARGET_PN} = "file-rdeps arch ldflags" -SKIP_FILEDEPS:${RUSTLIB_TARGET_PN} = "1" - -INHIBIT_PACKAGE_DEBUG_SPLIT = "1" -INHIBIT_PACKAGE_STRIP = "1" -INHIBIT_SYSROOT_STRIP = "1" - diff --git a/meta/recipes-devtools/rust/rust-cross-canadian.inc b/meta/recipes-devtools/rust/rust-cross-canadian.inc index 677bd8842c6..2b09661542d 100644 --- a/meta/recipes-devtools/rust/rust-cross-canadian.inc +++ b/meta/recipes-devtools/rust/rust-cross-canadian.inc @@ -1,20 +1,11 @@ - -require rust-cross-canadian-common.inc - -RUSTLIB_TARGET_PN = "rust-cross-canadian-rustlib-target-${TRANSLATED_TARGET_ARCH}" -RUSTLIB_HOST_PN = "rust-cross-canadian-rustlib-host-${TRANSLATED_TARGET_ARCH}" -RUSTLIB_SRC_PN = "rust-cross-canadian-src" -RUSTLIB_PKGS = "${RUSTLIB_SRC_PN} ${RUSTLIB_TARGET_PN} ${RUSTLIB_HOST_PN}" PN = "rust-cross-canadian-${TRANSLATED_TARGET_ARCH}" -PACKAGES = "${RUSTLIB_PKGS} ${PN}" -RDEPENDS:${PN} += "${RUSTLIB_PKGS}" +inherit rust-target-config +inherit rust-common -# The default behaviour of x.py changed in 1.47+ so now we need to -# explicitly ask for the stage 2 compiler to be assembled. -do_compile () { - rust_runx build --stage 2 -} +LICENSE = "MIT" + +MODIFYTOS = "0" create_sdk_wrapper () { file="$1" @@ -30,39 +21,14 @@ create_sdk_wrapper () { do_install () { # Rust requires /usr/lib to contain the libs. - # Similar story is with /usr/bin ruquiring `lib` to be at the same level. # The required structure is retained for simplicity. SYS_LIBDIR=$(dirname ${D}${libdir}) SYS_BINDIR=$(dirname ${D}${bindir}) RUSTLIB_DIR=${SYS_LIBDIR}/${TARGET_SYS}/rustlib - install -d "${SYS_BINDIR}" - cp build/${SNAPSHOT_BUILD_SYS}/stage2/bin/* ${SYS_BINDIR} - for i in ${SYS_BINDIR}/*; do - chrpath -r "\$ORIGIN/../lib" ${i} - done - - install -d "${D}${libdir}" - cp -pRd build/${SNAPSHOT_BUILD_SYS}/stage2/lib/${TARGET_SYS}/*.so ${SYS_LIBDIR} - cp -pRd build/${SNAPSHOT_BUILD_SYS}/stage2/lib/${TARGET_SYS}/rustlib ${RUSTLIB_DIR} - - for i in ${SYS_LIBDIR}/*.so; do - chrpath -r "\$ORIGIN/../lib" ${i} - done - for i in ${RUSTLIB_DIR}/*/lib/*.so; do - chrpath -d ${i} - done - - install -m 0644 "${WORKDIR}/targets/${TARGET_SYS}.json" "${RUSTLIB_DIR}" - - SRC_DIR=${RUSTLIB_DIR}/src/rust - install -d ${SRC_DIR}/src/llvm-project - cp -R --no-dereference build/${SNAPSHOT_BUILD_SYS}/stage2/lib/rustlib/src/rust/src/llvm-project/libunwind ${SRC_DIR}/src/llvm-project - cp -R --no-dereference build/${SNAPSHOT_BUILD_SYS}/stage2/lib/rustlib/src/rust/library ${SRC_DIR} - cp --no-dereference build/${SNAPSHOT_BUILD_SYS}/stage2/lib/rustlib/src/rust/Cargo.lock ${SRC_DIR} - # Remove executable bit from any files so then SDK doesn't try to relocate. - chmod -R -x+X ${SRC_DIR} - + install -d ${RUSTLIB_DIR} + install -m 0644 "${RUST_TARGETS_DIR}/${RUST_HOST_SYS}.json" "${RUSTLIB_DIR}" + install -m 0644 "${RUST_TARGETS_DIR}/${RUST_TARGET_SYS}.json" "${RUSTLIB_DIR}" # Uses SDK's CC as linker so linked binaries works out of box. install -d ${SYS_BINDIR} @@ -73,7 +39,7 @@ do_install () { ENV_SETUP_SH="${ENV_SETUP_DIR}/rust.sh" cat <<- EOF > "${ENV_SETUP_SH}" - export RUSTFLAGS="--sysroot=\$OECORE_NATIVE_SYSROOT/usr -C link-arg=--sysroot=\$OECORE_TARGET_SYSROOT -L\$OECORE_NATIVE_SYSROOT/usr/lib/${TARGET_SYS}/rustlib/${TARGET_SYS}/lib" + export RUSTFLAGS="--sysroot=\$OECORE_TARGET_SYSROOT/usr -C link-arg=--sysroot=\$OECORE_TARGET_SYSROOT" export RUST_TARGET_PATH="\$OECORE_NATIVE_SYSROOT/usr/lib/${TARGET_SYS}/rustlib" EOF @@ -100,16 +66,5 @@ do_install () { EOF } -PKG_SYS_LIBDIR = "${SDKPATHNATIVE}/usr/lib" -PKG_SYS_BINDIR = "${SDKPATHNATIVE}/usr/bin" -PKG_RUSTLIB_DIR = "${PKG_SYS_LIBDIR}/${TARGET_SYS}/rustlib" -FILES:${PN} = "${PKG_SYS_LIBDIR}/*.so ${PKG_SYS_BINDIR} ${base_prefix}/environment-setup.d" -FILES:${RUSTLIB_TARGET_PN} = "${PKG_RUSTLIB_DIR}/${TARGET_SYS} ${PKG_RUSTLIB_DIR}/${TARGET_SYS}.json" -FILES:${RUSTLIB_HOST_PN} = "${PKG_RUSTLIB_DIR}/${BUILD_ARCH}-unknown-linux-gnu" -FILES:${RUSTLIB_SRC_PN} = "${PKG_RUSTLIB_DIR}/src" - -SUMMARY:${RUSTLIB_TARGET_PN} = "Rust cross canadian libaries for ${TARGET_SYS}" -SUMMARY:${RUSTLIB_HOST_PN} = "Rust cross canadian libaries for ${HOST_SYS}" -SUMMARY:${RUSTLIB_SRC_PN} = "Rust standard library sources for cross canadian toolchain" -SUMMARY:${PN} = "Rust crost canadian compiler" +FILES:${PN} += "${base_prefix}/environment-setup.d" diff --git a/meta/recipes-devtools/rust/rust-cross-canadian_1.62.0.bb b/meta/recipes-devtools/rust/rust-cross-canadian_1.62.0.bb index 766912c019b..55865238ab4 100644 --- a/meta/recipes-devtools/rust/rust-cross-canadian_1.62.0.bb +++ b/meta/recipes-devtools/rust/rust-cross-canadian_1.62.0.bb @@ -1,6 +1,2 @@ -require rust-cross-canadian.inc -require rust-source.inc -require rust-snapshot.inc - -FILESEXTRAPATHS:prepend := "${THISDIR}/rust:" - +inherit cross-canadian +require rust-cross-canadian.inc \ No newline at end of file From patchwork Fri Aug 5 13:12:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 11019 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 AB9EEC25B06 for ; Fri, 5 Aug 2022 13:13:30 +0000 (UTC) Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) by mx.groups.io with SMTP id smtpd.web09.6782.1659705187235305448 for ; Fri, 05 Aug 2022 06:13:21 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=NWpvg9hX; spf=pass (domain: linuxfoundation.org, ip: 209.85.221.43, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wr1-f43.google.com with SMTP id n4so1463766wrp.10 for ; Fri, 05 Aug 2022 06:13:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc; bh=YvVtFmNbCCIGtfv/oEpDjZ3dJLERO4sxs9W/GGL7i2c=; b=NWpvg9hXxzkQ+158eOX5hXB1jV400bGkOhnK8+KCdJAHQtH+r4SYemp/M7XMvsJGgp uFrXxqJ6nrP/CU/Ch9EDQy2sGAvYZEaADTVgu49R2dKi8F+CeLvNImiywKiQxJG0FKDi SE3rkwHLYRMQX2Ske3U8ezLuvoAX4qy3HEjtM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc; bh=YvVtFmNbCCIGtfv/oEpDjZ3dJLERO4sxs9W/GGL7i2c=; b=uQPS37rp+BN/UbyoucCSgC2xY9Ndwoo69vYzOEkFoeOO3GmvtonWBkjci4Y/NcHZyg kj+/vMaOMJEz/75VFgEjZyB3/XrEv+CSIRAsjFJFD7GfY1ClMpqGWywA1pJgapqyCnbd 1eWYokk8m4obo2MAjhGVbF6RcVbxtWRUT4u1pKzlNp+42M6EK5N2UWhcxhshONhPzB/2 N+HAk0T1+S1Ca2PWB48xlqmjbMctdUU8bdBZbH6m6QdD0FzPluNzER4XWI1CKJePKBVW FhlNxTbftmL+9GQnRuexLf51UZZUefM8h6+sgGBeEgLlSIVgld3rS35u+l6h4ZX2vlbM OwTw== X-Gm-Message-State: ACgBeo3wWrjTELpgy+P6hpv+6VDIBkHDvPaQgZTFt1cj9ITz0dM4qzAm JEn/yVZmxZ+x+fFLeFRYrsMO4LU0+fdmSw== X-Google-Smtp-Source: AA6agR52iPFexd9DcuxoJTH8A8jOUnqK0TPuVitkhPp9UVPHdun2MxcUiQBVmdR7xzp3oFpxp/w/XA== X-Received: by 2002:a05:6000:3c6:b0:220:5efd:423c with SMTP id b6-20020a05600003c600b002205efd423cmr4475663wrg.214.1659705200201; Fri, 05 Aug 2022 06:13:20 -0700 (PDT) Received: from max.int.rpsys.net ([2001:8b0:aba:5f3c:f483:fcb0:1452:5a5a]) by smtp.gmail.com with ESMTPSA id p12-20020a05600c204c00b003a51a0d35e7sm1908901wmg.37.2022.08.05.06.13.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Aug 2022 06:13:19 -0700 (PDT) From: Richard Purdie To: openembedded-core@lists.openembedded.org Subject: [PATCH 26/29] rust: Drop cross/crosssdk Date: Fri, 5 Aug 2022 14:12:49 +0100 Message-Id: <20220805131252.3706794-26-richard.purdie@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220805131252.3706794-1-richard.purdie@linuxfoundation.org> References: <20220805131252.3706794-1-richard.purdie@linuxfoundation.org> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 05 Aug 2022 13:13:30 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/168960 Now that target config json is provided by rust-target-config.bbclass, the need for the cross and crosssdk recipes is removed. Drop them and simplify dependencies accordingly. Signed-off-by: Richard Purdie --- meta/classes/cargo.bbclass | 4 +- meta/classes/rust.bbclass | 2 +- meta/conf/distro/include/maintainers.inc | 2 - meta/recipes-devtools/rust/rust-cross.inc | 47 ------------------- .../rust/rust-cross_1.62.0.bb | 8 ---- .../rust/rust-crosssdk_1.62.0.bb | 8 ---- 6 files changed, 3 insertions(+), 68 deletions(-) delete mode 100644 meta/recipes-devtools/rust/rust-cross.inc delete mode 100644 meta/recipes-devtools/rust/rust-cross_1.62.0.bb delete mode 100644 meta/recipes-devtools/rust/rust-crosssdk_1.62.0.bb diff --git a/meta/classes/cargo.bbclass b/meta/classes/cargo.bbclass index 2475d05b3d2..4bfcfe5fc65 100644 --- a/meta/classes/cargo.bbclass +++ b/meta/classes/cargo.bbclass @@ -13,8 +13,8 @@ CARGO = "cargo" BASEDEPENDS:append = " cargo-native" # Ensure we get the right rust variant -DEPENDS:append:class-target = " virtual/${TARGET_PREFIX}rust ${RUSTLIB_DEP}" -DEPENDS:append:class-nativesdk = " virtual/${TARGET_PREFIX}rust ${RUSTLIB_DEP}" +DEPENDS:append:class-target = " rust-native ${RUSTLIB_DEP}" +DEPENDS:append:class-nativesdk = " rust-native ${RUSTLIB_DEP}" DEPENDS:append:class-native = " rust-native" # Enable build separation diff --git a/meta/classes/rust.bbclass b/meta/classes/rust.bbclass index f20e063c5be..2639cecfd43 100644 --- a/meta/classes/rust.bbclass +++ b/meta/classes/rust.bbclass @@ -10,7 +10,7 @@ def rust_base_dep(d): deps = "" if not d.getVar('INHIBIT_DEFAULT_RUST_DEPS'): if (d.getVar('HOST_SYS') != d.getVar('BUILD_SYS')): - deps += " virtual/${TARGET_PREFIX}rust ${RUSTLIB_DEP}" + deps += " rust-native ${RUSTLIB_DEP}" else: deps += " rust-native" return deps diff --git a/meta/conf/distro/include/maintainers.inc b/meta/conf/distro/include/maintainers.inc index b563c517962..80dfd6eb473 100644 --- a/meta/conf/distro/include/maintainers.inc +++ b/meta/conf/distro/include/maintainers.inc @@ -717,8 +717,6 @@ RECIPE_MAINTAINER:pn-rt-tests = "Alexander Kanavin " RECIPE_MAINTAINER:pn-ruby = "Ross Burton " RECIPE_MAINTAINER:pn-run-postinsts = "Ross Burton " RECIPE_MAINTAINER:pn-rust = "Randy MacLeod " -RECIPE_MAINTAINER:pn-rust-cross-${TUNE_PKGARCH}-${TCLIBC} = "Randy MacLeod " -RECIPE_MAINTAINER:pn-rust-crosssdk-${SDK_ARCH}-glibc = "Randy MacLeod " RECIPE_MAINTAINER:pn-rust-cross-canadian-${TRANSLATED_TARGET_ARCH} = "Randy MacLeod " RECIPE_MAINTAINER:pn-rust-hello-world = "Randy MacLeod " RECIPE_MAINTAINER:pn-rust-llvm = "Randy MacLeod " diff --git a/meta/recipes-devtools/rust/rust-cross.inc b/meta/recipes-devtools/rust/rust-cross.inc deleted file mode 100644 index ab538e6659b..00000000000 --- a/meta/recipes-devtools/rust/rust-cross.inc +++ /dev/null @@ -1,47 +0,0 @@ -RUST_TARGETGENS = "BUILD HOST TARGET" - -# Otherwise we'll depend on what we provide -INHIBIT_DEFAULT_RUST_DEPS = "1" - -# Unlike native (which nicely maps it's DEPENDS) cross wipes them out completely. -# Generally, we (and cross in general) need the same things that native needs, -# so it might make sense to take it's mapping. For now, though, we just mention -# the bits we need explicitly. -DEPENDS += "rust-llvm-native" -DEPENDS += "rust-native" - -# In the cross compilation case, rustc doesn't seem to get the rpath quite -# right. It manages to include '../../lib/${TARGET_PREFIX}', but doesn't -# include the '../../lib' (ie: relative path from cross_bindir to normal -# libdir. As a result, we end up not being able to properly reference files in normal ${libdir}. -# Most of the time this happens to work fine as the systems libraries are -# subsituted, but sometimes a host system will lack a library, or the right -# version of a library (libtinfo was how I noticed this). -# -# FIXME: this should really be fixed in rust itself. -# FIXME: using hard-coded relative paths is wrong, we should ask bitbake for -# the relative path between 2 of it's vars. -HOST_POST_LINK_ARGS:append = " -Wl,-rpath=../../lib" -BUILD_POST_LINK_ARGS:append = " -Wl,-rpath=../../lib" - -# We need the same thing for the calls to the compiler when building the runtime crap -TARGET_CC_ARCH:append = " --sysroot=${STAGING_DIR_TARGET}" - -do_rust_setup_snapshot () { -} - -do_configure () { -} - -do_compile () { -} - -do_install () { - mkdir -p ${D}${prefix}/${base_libdir_native}/rustlib - cp ${WORKDIR}/targets/${TARGET_SYS}.json ${D}${prefix}/${base_libdir_native}/rustlib -} - -rust_cross_sysroot_preprocess() { - sysroot_stage_dir ${D}${prefix}/${base_libdir_native}/rustlib ${SYSROOT_DESTDIR}${prefix}/${base_libdir_native}/rustlib -} -SYSROOT_PREPROCESS_FUNCS += "rust_cross_sysroot_preprocess" diff --git a/meta/recipes-devtools/rust/rust-cross_1.62.0.bb b/meta/recipes-devtools/rust/rust-cross_1.62.0.bb deleted file mode 100644 index 5358d98da85..00000000000 --- a/meta/recipes-devtools/rust/rust-cross_1.62.0.bb +++ /dev/null @@ -1,8 +0,0 @@ -require rust.inc -inherit cross -require rust-cross.inc -require rust-source.inc - -DEPENDS += "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}compilerlibs virtual/libc" -PROVIDES = "virtual/${TARGET_PREFIX}rust" -PN = "rust-cross-${TUNE_PKGARCH}-${TCLIBC}" diff --git a/meta/recipes-devtools/rust/rust-crosssdk_1.62.0.bb b/meta/recipes-devtools/rust/rust-crosssdk_1.62.0.bb deleted file mode 100644 index 6ea8cb09b21..00000000000 --- a/meta/recipes-devtools/rust/rust-crosssdk_1.62.0.bb +++ /dev/null @@ -1,8 +0,0 @@ -require rust.inc -inherit crosssdk -require rust-cross.inc -require rust-source.inc - -DEPENDS += "virtual/${TARGET_PREFIX}gcc-crosssdk virtual/nativesdk-${TARGET_PREFIX}compilerlibs virtual/nativesdk-libc" -PROVIDES = "virtual/nativesdk-${TARGET_PREFIX}rust" -PN = "rust-crosssdk-${TUNE_PKGARCH}-${RUST_LIBC}" From patchwork Fri Aug 5 13:12:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 11022 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 A510FC3F6B0 for ; Fri, 5 Aug 2022 13:13:30 +0000 (UTC) Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) by mx.groups.io with SMTP id smtpd.web08.6587.1659705194196225206 for ; Fri, 05 Aug 2022 06:13:22 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=cS2pF62y; spf=pass (domain: linuxfoundation.org, ip: 209.85.221.42, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wr1-f42.google.com with SMTP id z12so3198939wrs.9 for ; Fri, 05 Aug 2022 06:13:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc; bh=y0ve12D39bRmmYrhsYXl/+Abja7M75/GLceNbyjevrA=; b=cS2pF62yXF1KcShSrW8gkFy9v77fQXmfLV2UVnHdUpP5+EXixwC1WkWDu8dvW1+c27 MfUlRfEvETQO/QOt0MNmmGLX7iq1FsBAEkolwRZujmg6dr0C2jN6FN5VSZel8ZJ9WZe7 GQg8GghFh7arcWU8reeMRwsZQsseyG3qVKatw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc; bh=y0ve12D39bRmmYrhsYXl/+Abja7M75/GLceNbyjevrA=; b=DzAw1hkWZ1z61hXiYwbwsudtlQrDCDGHh8VCqC6A4IomMbh4T42EI7l+5h/O4pb+0d kQ0JjZVGQxxeunN0bApzZrgwTooapBHVnXimtL0Jh4uxSEXFQ9ufCd9PJAXJ2mDza9F0 yiihbkhukeeuo3WHrkGr/RBc4M2Z/2aSfCmxnWAWwvUBWDByJiO1vLmRxJH9C41dXAZ9 xy5BLcjR2WidU25WEx0VAdHsyYK2P7GFPUqDhyoYZINCvsKQh7M+d1++/am1z3CCiSd+ f0HOX8pf23ihFOUH4lnoKTOMatlT5nYrURDx7e6FTekEAyIDwktoaoqAtXjKYfQyZWDT HxOA== X-Gm-Message-State: ACgBeo3EBdnbrcpdR0Y2PQVC5Nkfvg/tT308sJq13BW2h9+rC91v1vs4 zh5zEL9X5Kg8bXC0awryyjCFj0LnOURYVg== X-Google-Smtp-Source: AA6agR5RtR437MpWdmxsUfOStjDW6Udy45PftGPf4ESlHrGH8lQfC9kuBqw+PyaGZbKNJjoSc300OA== X-Received: by 2002:a5d:4b03:0:b0:220:6b87:8f0f with SMTP id v3-20020a5d4b03000000b002206b878f0fmr4378566wrq.534.1659705201493; Fri, 05 Aug 2022 06:13:21 -0700 (PDT) Received: from max.int.rpsys.net ([2001:8b0:aba:5f3c:f483:fcb0:1452:5a5a]) by smtp.gmail.com with ESMTPSA id p12-20020a05600c204c00b003a51a0d35e7sm1908901wmg.37.2022.08.05.06.13.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Aug 2022 06:13:21 -0700 (PDT) From: Richard Purdie To: openembedded-core@lists.openembedded.org Subject: [PATCH 27/29] rust: Enable nativesdk and target builds + replace rust-tools-cross-canadian Date: Fri, 5 Aug 2022 14:12:50 +0100 Message-Id: <20220805131252.3706794-27-richard.purdie@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220805131252.3706794-1-richard.purdie@linuxfoundation.org> References: <20220805131252.3706794-1-richard.purdie@linuxfoundation.org> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 05 Aug 2022 13:13:30 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/168961 Enable rust target builds as well as nativesdk-rust for the sdk. Merge the builds of rust-tools components into the rust build, packaged separately since this is a lot more efficient and saves rebuilding core rust multiple times. The tools are not target specific so nativesdk-rust-tools suffices and we can drop the cross canadian piece. Signed-off-by: Richard Purdie --- meta/conf/distro/include/maintainers.inc | 1 - .../packagegroup-rust-cross-canadian.bb | 6 +- meta/recipes-devtools/rust/rust-target.inc | 2 +- .../rust/rust-tools-cross-canadian.inc | 38 ---------- .../rust/rust-tools-cross-canadian_1.62.0.bb | 6 -- meta/recipes-devtools/rust/rust.inc | 13 +--- meta/recipes-devtools/rust/rust_1.62.0.bb | 69 +++++++++++++++++-- 7 files changed, 70 insertions(+), 65 deletions(-) delete mode 100644 meta/recipes-devtools/rust/rust-tools-cross-canadian.inc delete mode 100644 meta/recipes-devtools/rust/rust-tools-cross-canadian_1.62.0.bb diff --git a/meta/conf/distro/include/maintainers.inc b/meta/conf/distro/include/maintainers.inc index 80dfd6eb473..c0c38dfc165 100644 --- a/meta/conf/distro/include/maintainers.inc +++ b/meta/conf/distro/include/maintainers.inc @@ -720,7 +720,6 @@ RECIPE_MAINTAINER:pn-rust = "Randy MacLeod " RECIPE_MAINTAINER:pn-rust-cross-canadian-${TRANSLATED_TARGET_ARCH} = "Randy MacLeod " RECIPE_MAINTAINER:pn-rust-hello-world = "Randy MacLeod " RECIPE_MAINTAINER:pn-rust-llvm = "Randy MacLeod " -RECIPE_MAINTAINER:pn-rust-tools-cross-canadian-${TRANSLATED_TARGET_ARCH} = "Randy MacLeod " RECIPE_MAINTAINER:pn-rxvt-unicode = "Unassigned " RECIPE_MAINTAINER:pn-sato-screenshot = "Ross Burton " RECIPE_MAINTAINER:pn-sato-icon-theme = "Richard Purdie " diff --git a/meta/recipes-core/packagegroups/packagegroup-rust-cross-canadian.bb b/meta/recipes-core/packagegroups/packagegroup-rust-cross-canadian.bb index 6d324002a1a..42f85f0eb38 100644 --- a/meta/recipes-core/packagegroups/packagegroup-rust-cross-canadian.bb +++ b/meta/recipes-core/packagegroups/packagegroup-rust-cross-canadian.bb @@ -6,12 +6,12 @@ inherit cross-canadian packagegroup PACKAGEGROUP_DISABLE_COMPLEMENTARY = "1" RUST="rust-cross-canadian-${TRANSLATED_TARGET_ARCH}" -RUST_TOOLS="rust-tools-cross-canadian-${TRANSLATED_TARGET_ARCH}" RDEPENDS:${PN} = " \ ${@all_multilib_tune_values(d, 'RUST')} \ + nativesdk-rust \ nativesdk-cargo \ - rust-cross-canadian-src \ - ${@all_multilib_tune_values(d, 'RUST_TOOLS')} \ + nativesdk-rust-tools-clippy \ + nativesdk-rust-tools-rustfmt \ " diff --git a/meta/recipes-devtools/rust/rust-target.inc b/meta/recipes-devtools/rust/rust-target.inc index 3f637b3ba54..dce2b47517b 100644 --- a/meta/recipes-devtools/rust/rust-target.inc +++ b/meta/recipes-devtools/rust/rust-target.inc @@ -7,4 +7,4 @@ INHIBIT_DEFAULT_RUST_DEPS:class-native = "1" # We don't need to depend on gcc-native because yocto assumes it exists PROVIDES:class-native = "virtual/${TARGET_PREFIX}rust" -BBCLASSEXTEND = "native" +BBCLASSEXTEND = "native nativesdk" diff --git a/meta/recipes-devtools/rust/rust-tools-cross-canadian.inc b/meta/recipes-devtools/rust/rust-tools-cross-canadian.inc deleted file mode 100644 index f0358551ae2..00000000000 --- a/meta/recipes-devtools/rust/rust-tools-cross-canadian.inc +++ /dev/null @@ -1,38 +0,0 @@ - -require rust-cross-canadian-common.inc - -RUST_TOOLS_CLIPPY_PN = "rust-tools-clippy-cross-canadian-${TRANSLATED_TARGET_ARCH}" -RUST_TOOLS_RUSTFMT_PN = "rust-tools-rustfmt-cross-canadian-${TRANSLATED_TARGET_ARCH}" -RUST_TOOLS_PKGS = "${RUST_TOOLS_CLIPPY_PN} ${RUST_TOOLS_RUSTFMT_PN}" -PN = "rust-tools-cross-canadian-${TRANSLATED_TARGET_ARCH}" - -PACKAGES = "${RUST_TOOLS_CLIPPY_PN} ${RUST_TOOLS_RUSTFMT_PN} ${PN}" -RDEPENDS:${PN} += "${RUST_TOOLS_PKGS}" - -do_compile () { - rust_runx build --stage 2 src/tools/clippy - rust_runx build --stage 2 src/tools/rustfmt -} - -do_install () { - SYS_BINDIR=$(dirname ${D}${bindir}) - - install -d "${SYS_BINDIR}" - cp build/${SNAPSHOT_BUILD_SYS}/stage2-tools-bin/* ${SYS_BINDIR} - for i in ${SYS_BINDIR}/*; do - chrpath -r "\$ORIGIN/../lib" ${i} - done - - chown -R root.root ${D} -} - -ALLOW_EMPTY:${PN} = "1" - -PKG_SYS_BINDIR = "${SDKPATHNATIVE}/usr/bin" -FILES:${RUST_TOOLS_CLIPPY_PN} = "${PKG_SYS_BINDIR}/cargo-clippy ${PKG_SYS_BINDIR}/clippy-driver" -FILES:${RUST_TOOLS_RUSTFMT_PN} = "${PKG_SYS_BINDIR}/rustfmt" - -SUMMARY:${PN} = "Rust helper tools" -SUMMARY:${RUST_TOOLS_CLIPPY_PN} = "A collection of lints to catch common mistakes and improve your Rust code" -SUMMARY:${RUST_TOOLS_RUSTFMT_PN} = "A tool for formatting Rust code according to style guidelines" - diff --git a/meta/recipes-devtools/rust/rust-tools-cross-canadian_1.62.0.bb b/meta/recipes-devtools/rust/rust-tools-cross-canadian_1.62.0.bb deleted file mode 100644 index 2d809d68f52..00000000000 --- a/meta/recipes-devtools/rust/rust-tools-cross-canadian_1.62.0.bb +++ /dev/null @@ -1,6 +0,0 @@ -require rust-tools-cross-canadian.inc -require rust-source.inc -require rust-snapshot.inc - -FILESEXTRAPATHS:prepend := "${THISDIR}/rust:" - diff --git a/meta/recipes-devtools/rust/rust.inc b/meta/recipes-devtools/rust/rust.inc index 7c16b8165bb..1c8fe225fd4 100644 --- a/meta/recipes-devtools/rust/rust.inc +++ b/meta/recipes-devtools/rust/rust.inc @@ -9,6 +9,7 @@ inherit cargo_common DEPENDS += "file-native python3-native" DEPENDS:append:class-native = " rust-llvm-native" +DEPENDS:append:class-nativesdk = " nativesdk-rust-llvm" S = "${RUSTSRC}" @@ -202,18 +203,6 @@ rust_do_install () { rm -f ${D}${libdir}/rustlib/src/rust } -rust_install_targets() { - # Install our custom target.json files - local td="${D}${libdir}/rustlib/" - install -d "$td" - for tgt in "${WORKDIR}/targets/"* ; do - install -m 0644 "$tgt" "$td" - done -} - - do_install () { rust_do_install - rust_install_targets } -# ex: sts=4 et sw=4 ts=8 diff --git a/meta/recipes-devtools/rust/rust_1.62.0.bb b/meta/recipes-devtools/rust/rust_1.62.0.bb index b505ad46caf..81923c33313 100644 --- a/meta/recipes-devtools/rust/rust_1.62.0.bb +++ b/meta/recipes-devtools/rust/rust_1.62.0.bb @@ -3,19 +3,80 @@ require rust-source.inc require rust-snapshot.inc INSANE_SKIP:${PN}:class-native = "already-stripped" +FILES:${PN} += "${libdir}/rustlib" +FILES:${PN} += "${libdir}/*.so" +FILES:${PN}-dev = "" do_compile () { rust_runx build --stage 2 } +do_compile:append:class-target () { + rust_runx build --stage 2 src/tools/clippy + rust_runx build --stage 2 src/tools/rustfmt +} + +do_compile:append:class-nativesdk () { + rust_runx build --stage 2 src/tools/clippy + rust_runx build --stage 2 src/tools/rustfmt +} + +ALLOW_EMPTY:${PN} = "1" + +PACKAGES =+ "${PN}-tools-clippy ${PN}-tools-rustfmt" +FILES:${PN}-tools-clippy = "${bindir}/cargo-clippy ${bindir}/clippy-driver" +FILES:${PN}-tools-rustfmt = "${bindir}/rustfmt" +RDEPENDS:${PN}-tools-clippy = "${PN}" +RDEPENDS:${PN}-tools-rustfmt = "${PN}" + +SUMMARY:${PN}-tools-clippy = "A collection of lints to catch common mistakes and improve your Rust code" +SUMMARY:${PN}-tools-rustfmt = "A tool for formatting Rust code according to style guidelines" + rust_do_install() { rust_runx install } -python () { - pn = d.getVar('PN') +rust_do_install:class-nativesdk() { + export PSEUDO_UNLOAD=1 + rust_runx install + unset PSEUDO_UNLOAD + + install -d ${D}${bindir} + for i in cargo-clippy clippy-driver rustfmt; do + cp build/${RUST_BUILD_SYS}/stage2-tools-bin/$i ${D}${bindir} + chrpath -r "\$ORIGIN/../lib" ${D}${bindir}/$i + done - if not pn.endswith("-native"): - raise bb.parse.SkipRecipe("Rust recipe doesn't work for target builds at this time. Fixes welcome.") + chown root:root ${D}/ -R + rm ${D}${libdir}/rustlib/uninstall.sh + rm ${D}${libdir}/rustlib/install.log + rm ${D}${libdir}/rustlib/manifest* } +rust_do_install:class-target() { + export PSEUDO_UNLOAD=1 + rust_runx install + unset PSEUDO_UNLOAD + + install -d ${D}${bindir} + for i in cargo-clippy clippy-driver rustfmt; do + cp build/${RUST_BUILD_SYS}/stage2-tools-bin/$i ${D}${bindir} + chrpath -r "\$ORIGIN/../lib" ${D}${bindir}/$i + done + + chown root:root ${D}/ -R + rm ${D}${libdir}/rustlib/uninstall.sh + rm ${D}${libdir}/rustlib/install.log + rm ${D}${libdir}/rustlib/manifest* +} + +# see recipes-devtools/gcc/gcc/0018-Add-ssp_nonshared-to-link-commandline-for-musl-targe.patch +# we need to link with ssp_nonshared on musl to avoid "undefined reference to `__stack_chk_fail_local'" +# when building MACHINE=qemux86 for musl +WRAPPER_TARGET_EXTRALD:libc-musl = "-lssp_nonshared" + +RUSTLIB_DEP:class-nativesdk = "" + +# musl builds include libunwind.a +INSANE_SKIP:${PN} = "staticdev" + From patchwork Fri Aug 5 13:12:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 11018 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 98420C00140 for ; Fri, 5 Aug 2022 13:13:30 +0000 (UTC) Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) by mx.groups.io with SMTP id smtpd.web09.6784.1659705204598702671 for ; Fri, 05 Aug 2022 06:13:24 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=HXIaZNYL; spf=pass (domain: linuxfoundation.org, ip: 209.85.221.48, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wr1-f48.google.com with SMTP id j7so3244613wrh.3 for ; Fri, 05 Aug 2022 06:13:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc; bh=FzQaM6/rmtzt6T/OCSfSg5vmddTGe5xUsss1tR3cyas=; b=HXIaZNYLahjtRzVooUXxhf2KWJqU3p1bXeMK0oW6DF3QZB45rkZIYmGHk5fbaaDOzI crwmY/PhmHTQo/6dLVkt8d2UiekV9fXFh3NDngqC0Wd9CNvuVnBc/fC7H0ANQ9IYxsXO CHrQwJBUvIA1xo8f+e1Ib+4y4V0nfZYqjAOH8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc; bh=FzQaM6/rmtzt6T/OCSfSg5vmddTGe5xUsss1tR3cyas=; b=IJJxUPp7QwEK3DNUaZQbfWBZMI+/4jeevMY3OPHhhqAxZmidrH7+exDQ9+5s2aBS3J 7geMGWCZMyR1ApPewFB8fAhLq4xeBXTTCG7fg5XAIhdEbw6p/O5fmiNw2PP521O1grX8 vWf4t7QRRmrRvl+1jFljabdkNXywZ2GqGzNmjF5mJtZu8vISs7gpyBfxV1lUQ2rIITq7 xzpk4jeWk1oW0/nN65hP6B1WsU2koEzKC+g2+Etzz63rBzQqCQwuwzbTubrEOKoQIIzp 2Lven7ZFYxJSy7E7mn4nxpsowavNWirrEKOEu8uRDe/EI06UwaO09CcrBrssbbXBKlRQ C0Sg== X-Gm-Message-State: ACgBeo3CdZ3lXU304d4GoCahHr3l/XYT2Zeoqs1IhHIzcB2o5GLdSAyp gGvbIYvEXniP5KTqWsFgNAkQa22sbdtQaA== X-Google-Smtp-Source: AA6agR4BPl5ZL+bp3uLfWhADu2quaIlm5Jpw5GmHM/J5T7ep26ma53aRFyeqPJtUpiT5uOk3CdID9w== X-Received: by 2002:a5d:6241:0:b0:21e:f97f:d0cb with SMTP id m1-20020a5d6241000000b0021ef97fd0cbmr4376528wrv.37.1659705202833; Fri, 05 Aug 2022 06:13:22 -0700 (PDT) Received: from max.int.rpsys.net ([2001:8b0:aba:5f3c:f483:fcb0:1452:5a5a]) by smtp.gmail.com with ESMTPSA id p12-20020a05600c204c00b003a51a0d35e7sm1908901wmg.37.2022.08.05.06.13.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Aug 2022 06:13:22 -0700 (PDT) From: Richard Purdie To: openembedded-core@lists.openembedded.org Subject: [PATCH 28/29] rust: Fix musl builds Date: Fri, 5 Aug 2022 14:12:51 +0100 Message-Id: <20220805131252.3706794-28-richard.purdie@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220805131252.3706794-1-richard.purdie@linuxfoundation.org> References: <20220805131252.3706794-1-richard.purdie@linuxfoundation.org> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 05 Aug 2022 13:13:30 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/168962 Musl targets need a sysroot set to find the musl static libraries. Set this appropriately in musl builds. Signed-off-by: Richard Purdie --- meta/recipes-devtools/rust/rust.inc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/meta/recipes-devtools/rust/rust.inc b/meta/recipes-devtools/rust/rust.inc index 1c8fe225fd4..d0f7467a887 100644 --- a/meta/recipes-devtools/rust/rust.inc +++ b/meta/recipes-devtools/rust/rust.inc @@ -83,6 +83,8 @@ python do_configure() { config.set(host_section, "cxx", e(d.expand("${RUST_TARGET_CXX}"))) config.set(host_section, "cc", e(d.expand("${RUST_TARGET_CC}"))) + if "musl" in host_section: + config.set(host_section, "musl-root", e(d.expand("${STAGING_DIR_HOST}${exec_prefix}"))) # If we don't do this rust-native will compile it's own llvm for BUILD. # [target.${BUILD_ARCH}-unknown-linux-gnu] From patchwork Fri Aug 5 13:12:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 11020 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 A5136C48BE4 for ; Fri, 5 Aug 2022 13:13:30 +0000 (UTC) Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) by mx.groups.io with SMTP id smtpd.web09.6785.1659705205728996451 for ; Fri, 05 Aug 2022 06:13:26 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=T9W6CdX0; spf=pass (domain: linuxfoundation.org, ip: 209.85.221.45, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wr1-f45.google.com with SMTP id z17so3227787wrq.4 for ; Fri, 05 Aug 2022 06:13:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc; bh=8njVWIB42DTFJ4e46cdOmMEnu5wx7q5RlwC7hZ5ZGuA=; b=T9W6CdX0jKSiKDruyZ3a47rsgAgzzytFW6FuACjz6Qk1ZI3CHPNoP1hF/Ltn0y+nGW FBCuHrHNxgjCq2rkJw+aQuBbVOW9Y/ynGhdCNe0YDH/ZiBa2NZEBrNmSbvdC4GORdIs1 eOSWBY2V5buXSD0OijW+sxoFvKPn0VsoQ7+Yc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc; bh=8njVWIB42DTFJ4e46cdOmMEnu5wx7q5RlwC7hZ5ZGuA=; b=KnUudIZ6Snx+tQn3P+CL8A0rZif8ecbKz9i75OyRL+XEeY3vMyOc3tWaAFFTcersjO pGMCY4LAxab/OlaazklkmfOBJEBKcLtxC1OORiMASECNF5SywYuPjmAce7kGf9MkM6wI T4ix2PCQqIruThBze1sq5WeiHS/5TGyoNL9mjL/VTfK7ygZBUXfjqiYwv1/pBKHaknV8 Wtg3dc1RpgAx0Nv+pt1JISgWQUaiWXSzYEs3ebXKUHuUaeJK/9XOXxKV7SyBPIH77cL/ /kTzoqGxex9l3UIKdUISx3p8/s6P2t99sDJJVF1ETAPojGLfxPW5kuNyTABhUs9qoYhF iByw== X-Gm-Message-State: ACgBeo2RQW0+cIEfBriqOvEYBi5q4bcQE2qWjJ9VTJDMnGxyrB2b6YIx /Ghb0iSwoHiY237Qdtk+5+RLVhfmzW8FRQ== X-Google-Smtp-Source: AA6agR4XyE1iORuiL4VjIcpIA1AMDce1slZzwanTzvsSm2c6SwM8DktB+7ymaiq7woqYWEjBVE9LEQ== X-Received: by 2002:a5d:40c7:0:b0:220:6407:6fc2 with SMTP id b7-20020a5d40c7000000b0022064076fc2mr4307974wrq.352.1659705204026; Fri, 05 Aug 2022 06:13:24 -0700 (PDT) Received: from max.int.rpsys.net ([2001:8b0:aba:5f3c:f483:fcb0:1452:5a5a]) by smtp.gmail.com with ESMTPSA id p12-20020a05600c204c00b003a51a0d35e7sm1908901wmg.37.2022.08.05.06.13.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Aug 2022 06:13:23 -0700 (PDT) From: Richard Purdie To: openembedded-core@lists.openembedded.org Subject: [PATCH 29/29] rust: Ensure buildpaths are handled in debug symbols correctly Date: Fri, 5 Aug 2022 14:12:52 +0100 Message-Id: <20220805131252.3706794-29-richard.purdie@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220805131252.3706794-1-richard.purdie@linuxfoundation.org> References: <20220805131252.3706794-1-richard.purdie@linuxfoundation.org> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 05 Aug 2022 13:13:30 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/168963 To ensure buildpaths aren't encoded in the debug symbol output, ensure we pass our prefix remapping compiler options in. Signed-off-by: Richard Purdie --- meta/recipes-devtools/rust/rust.inc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/meta/recipes-devtools/rust/rust.inc b/meta/recipes-devtools/rust/rust.inc index d0f7467a887..7e302b59929 100644 --- a/meta/recipes-devtools/rust/rust.inc +++ b/meta/recipes-devtools/rust/rust.inc @@ -177,6 +177,8 @@ rust_runx () { unset CXXFLAGS unset CPPFLAGS + export RUSTFLAGS="${RUST_DEBUG_REMAP}" + # Copy the natively built llvm-config into the target so we can run it. Horrible, # but works! if [ ${RUST_ALTERNATE_EXE_PATH_NATIVE} != ${RUST_ALTERNATE_EXE_PATH} ]; then