diff mbox series

[v5,14/15] make-mod-scripts: fix for buildpath issues with rust-out-of-tree compilation

Message ID 20260129163910.2612040-15-Harish.Sadineni@windriver.com
State Changes Requested
Headers show
Series Enable rust support for linux kernel | expand

Commit Message

Harish Sadineni Jan. 29, 2026, 4:39 p.m. UTC
From: Harish Sadineni <Harish.Sadineni@windriver.com>

Fixes buildpath issues when compiling rust-out-of-tree recipe.

Signed-off-by: Harish Sadineni <Harish.Sadineni@windriver.com>
---
 .../make-mod-scripts/make-mod-scripts_1.0.bb              | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Paul Barker Feb. 4, 2026, 12:08 p.m. UTC | #1
On Thu, 2026-01-29 at 08:39 -0800, Sadineni, Harish via
lists.openembedded.org wrote:
> From: Harish Sadineni <Harish.Sadineni@windriver.com>
> 
> Fixes buildpath issues when compiling rust-out-of-tree recipe.
> 
> Signed-off-by: Harish Sadineni <Harish.Sadineni@windriver.com>
> ---
>  .../make-mod-scripts/make-mod-scripts_1.0.bb              | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb b/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb
> index 874e16e642..d6b2178767 100644
> --- a/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb
> +++ b/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb
> @@ -36,3 +36,11 @@ do_configure() {
>  		-C ${STAGING_KERNEL_DIR} O=${STAGING_KERNEL_BUILDDIR} $t
>  	done
>  }
> +
> +RUST_DEBUG_REMAP ?= "--remap-path-prefix=${TMPDIR}/work-shared=${TARGET_DBGSRC_DIR} \
> +                     --remap-path-prefix=${TMPDIR}/work=${TARGET_DBGSRC_DIR} \
> +"
> +KRUSTFLAGS:append = " ${RUST_DEBUG_REMAP}"
> +EXTRA_OEMAKE:append = " ${@bb.utils.contains('DISTRO_FEATURES', 'rust-kernel', \
> +                                             ' KRUSTFLAGS="${KRUSTFLAGS}"', '',d)}"
> +
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#230155): https://lists.openembedded.org/g/openembedded-core/message/230155
> Mute This Topic: https://lists.openembedded.org/mt/117528985/1826184
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [paul@pbarker.dev]
> -=-=-=-=-=-=-=-=-=-=-=-
> 

Looking at this, and the other uses of KRUSTFLAGS, could we just set
KRUSTFLAGS and add it to EXTRA_OEMAKE unconditionally in each recipe
where it is needed? There should be no harm in setting KRUSTFLAGS if no
Rust code actually gets built. For modules, this can be done in
module-rust.bbclass instead of in each Rust module recipe.

Best regards,
diff mbox series

Patch

diff --git a/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb b/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb
index 874e16e642..d6b2178767 100644
--- a/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb
+++ b/meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb
@@ -36,3 +36,11 @@  do_configure() {
 		-C ${STAGING_KERNEL_DIR} O=${STAGING_KERNEL_BUILDDIR} $t
 	done
 }
+
+RUST_DEBUG_REMAP ?= "--remap-path-prefix=${TMPDIR}/work-shared=${TARGET_DBGSRC_DIR} \
+                     --remap-path-prefix=${TMPDIR}/work=${TARGET_DBGSRC_DIR} \
+"
+KRUSTFLAGS:append = " ${RUST_DEBUG_REMAP}"
+EXTRA_OEMAKE:append = " ${@bb.utils.contains('DISTRO_FEATURES', 'rust-kernel', \
+                                             ' KRUSTFLAGS="${KRUSTFLAGS}"', '',d)}"
+