ACK/Cmnt: [SRU O/U][PATCH 1/1] UBUNTU: [Packaging] Allow rust overrides
Stefan Bader
stefan.bader at canonical.com
Fri Oct 25 13:34:15 UTC 2024
On 25.10.24 15:29, John Cabaj wrote:
> 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?
I cannot say since I was not doing that. The above are just the
practical steps to get a build in noble which does not explode or
decides to have no rust available.
This patch is one step which I did for hwe-6.11 which creates the base
for enabling rust in the backport. So other backports might benefit.
-Stefan
>
>
> Thanks,
> John
>
>> KERNELRELEASE=$(abi_release)-$(target_flavour) \
>> CONFIG_DEBUG_SECTION_MISMATCH=y \
>> KBUILD_BUILD_VERSION="$(uploadnum)" \
>
>
--
- Stefan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_0xE8675DEECBEECEA3.asc
Type: application/pgp-keys
Size: 48643 bytes
Desc: OpenPGP public key
URL: <https://lists.ubuntu.com/archives/kernel-team/attachments/20241025/bc7e4f46/attachment-0001.key>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ubuntu.com/archives/kernel-team/attachments/20241025/bc7e4f46/attachment-0001.sig>
More information about the kernel-team
mailing list