From patchwork Wed Oct 16 15:07:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Bader X-Patchwork-Id: 1998115 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XTDqP41lyz1xvV for ; Thu, 17 Oct 2024 02:08:00 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1t15cr-00026n-DD; Wed, 16 Oct 2024 15:07:49 +0000 Received: from smtp-relay-canonical-1.internal ([10.131.114.174] helo=smtp-relay-canonical-1.canonical.com) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1t15co-00026O-Ob for kernel-team@lists.ubuntu.com; Wed, 16 Oct 2024 15:07:46 +0000 Received: from canonical.com (2.general.smb.uk.vpn [10.172.193.29]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-1.canonical.com (Postfix) with ESMTPSA id 638893F37C for ; Wed, 16 Oct 2024 15:07:46 +0000 (UTC) From: Stefan Bader To: kernel-team@lists.ubuntu.com Subject: [SRU O/U][PATCH 1/1] UBUNTU: [Packaging] Allow rust overrides Date: Wed, 16 Oct 2024 17:07:44 +0200 Message-Id: <20241016150744.242464-2-stefan.bader@canonical.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241016150744.242464-1-stefan.bader@canonical.com> References: <20241016150744.242464-1-stefan.bader@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" BugLink: https://bugs.launchpad.net/bugs/2084693 The rustc compiler and friends should be matching certain versions when compiling a backported kernel. Backports of the tools do not use the same namespace as the native versions in order to co-exist. For that reason we need a method to pass in the exact name of the rustc, rustfmt, and bindgen to use. This change should be picked up by oracular and later in the main source to allow this to be done in any derivative and backport. Signed-off-by: Stefan Bader --- debian/rules.d/0-common-vars.mk | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/debian/rules.d/0-common-vars.mk b/debian/rules.d/0-common-vars.mk index 93f90c7198c1..3b8ebcab5291 100644 --- a/debian/rules.d/0-common-vars.mk +++ b/debian/rules.d/0-common-vars.mk @@ -87,6 +87,9 @@ CROSS_COMPILE ?= $(DEB_HOST_GNU_TYPE)- # $(DEBIAN)/rules.d/hooks.mk and $(DEBIAN)/rules.d/$(arch).mk files # export gcc?=gcc-14 +export rustc?=rustc +export rustfmt?=rustfmt +export bindgen?=bindgen GCC_BUILD_DEPENDS=\ $(gcc), $(gcc)-aarch64-linux-gnu [arm64] , $(gcc)-arm-linux-gnueabihf [armhf] , $(gcc)-powerpc64le-linux-gnu [ppc64el] , $(gcc)-riscv64-linux-gnu [riscv64] , $(gcc)-s390x-linux-gnu [s390x] , $(gcc)-x86-64-linux-gnu [amd64] , abidir := $(CURDIR)/$(DEBIAN)/__abi.current/$(arch) @@ -197,6 +200,10 @@ kmake = make ARCH=$(build_arch) \ CROSS_COMPILE=$(CROSS_COMPILE) \ HOSTCC=$(HOSTCC) \ CC=$(CROSS_COMPILE)$(gcc) \ + RUSTC=$(rustc) \ + HOSTRUSTC=$(rustc) \ + RUSTFMT=$(rustfmt) \ + BINDGEN=$(bindgen) \ KERNELRELEASE=$(abi_release)-$(target_flavour) \ CONFIG_DEBUG_SECTION_MISMATCH=y \ KBUILD_BUILD_VERSION="$(uploadnum)" \