ACK/Cmnt: [SRU O/U][PATCH 1/1] UBUNTU: [Packaging] Allow rust overrides

John Cabaj john.cabaj at canonical.com
Fri Oct 25 13:29:26 UTC 2024


On 10/16/24 10:07 AM, Stefan Bader wrote:
> 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 <stefan.bader at canonical.com>
> ---
>   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] <cross>, $(gcc)-arm-linux-gnueabihf [armhf] <cross>, $(gcc)-powerpc64le-linux-gnu [ppc64el] <cross>, $(gcc)-riscv64-linux-gnu [riscv64] <cross>, $(gcc)-s390x-linux-gnu [s390x] <cross>, $(gcc)-x86-64-linux-gnu [amd64] <cross>,
>   
>   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) \

Do we also need a RUST_LIB_SRC here? Or was that only for previous 
incarnations of adding rust support to rules?


Thanks,
John

>   	KERNELRELEASE=$(abi_release)-$(target_flavour) \
>   	CONFIG_DEBUG_SECTION_MISMATCH=y \
>   	KBUILD_BUILD_VERSION="$(uploadnum)" \




More information about the kernel-team mailing list