All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: Harish.Sadineni@windriver.com, openembedded-core@lists.openembedded.org
Cc: Sundeep.Kokkonda@windriver.com
Subject: Re: [OE-core] [PATCH v2 1/3] rust-cross-canadian: install target-specific env scripts and fix rustlib lookup
Date: Thu, 20 Aug 2026 09:54:09 +0100	[thread overview]
Message-ID: <d489c96976fb770d0499ef325cedf7e085dcc775.camel@linuxfoundation.org> (raw)
In-Reply-To: <20260807093116.3680514-1-Harish.Sadineni@windriver.com>

On Fri, 2026-08-07 at 02:31 -0700, Sadineni, Harish via lists.openembedded.org wrote:
> From: Harish Sadineni <Harish.Sadineni@windriver.com>
> 
> YOCTO [#15061]
> 
> Fixes 32-bit Cargo build failures when using multilib-enabled SDKs.
> 
> Store the generated environment setup script in a target-specific
> subdirectory so that sourcing the SDK environment always loads the
> matching script for the selected target, avoiding accidental reuse of
> the 64-bit configuration when building for a 32-bit target.
> 
> Also update `CARGO_TARGET_<TRIPLE>_RUSTFLAGS` to add an explicit
> `-L` search path to the target `rustlib` directory inside the sysroot.
> This ensures Cargo can locate the correct target-specific Rust libraries
> during cross-compilation with the cross-canadian toolchain.
> 
> Signed-off-by: Harish Sadineni <Harish.Sadineni@windriver.com>
> ---
>  meta/recipes-devtools/rust/rust-cross-canadian.inc | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/meta/recipes-devtools/rust/rust-cross-canadian.inc b/meta/recipes-devtools/rust/rust-cross-canadian.inc
> index f083bcda82..bdc63e221f 100644
> --- a/meta/recipes-devtools/rust/rust-cross-canadian.inc
> +++ b/meta/recipes-devtools/rust/rust-cross-canadian.inc
> @@ -51,15 +51,17 @@ do_install () {
>      chmod +x "$outfile"
>      create_sdk_wrapper "${SYS_BINDIR}/target-rust-ccld-wrapper" "CC"
>  
> -    ENV_SETUP_DIR=${D}${base_prefix}/environment-setup.d
> -    mkdir "${ENV_SETUP_DIR}"
> +    ENV_SETUP_DIR=${D}${base_prefix}/environment-setup.d/${TARGET_SYS}
> +    mkdir -p "${ENV_SETUP_DIR}"
>      RUST_ENV_SETUP_SH="${ENV_SETUP_DIR}/${RUST_TARGET_SYS}_rust.sh"
>  
>      RUST_TARGET_TRIPLE=`echo ${RUST_TARGET_SYS} | tr '[:lower:]' '[:upper:]' | sed 's/-/_/g'`
>  
>      cat <<- EOF > "${RUST_ENV_SETUP_SH}"
> -	export CARGO_TARGET_${RUST_TARGET_TRIPLE}_RUSTFLAGS="--sysroot=\$OECORE_TARGET_SYSROOT/usr -C link-arg=--sysroot=\$OECORE_TARGET_SYSROOT"
> -	export CARGO_BUILD_TARGET="${RUST_TARGET_SYS}"
> +	export RUST_TARGET_SYS_VALUE="${RUST_TARGET_SYS}"
> +	LIB_PATH="\$OECORE_TARGET_SYSROOT/usr/${baselib}/rustlib/${RUST_TARGET_SYS}/lib"
> +	export CARGO_TARGET_${RUST_TARGET_TRIPLE}_RUSTFLAGS="--sysroot=\$OECORE_TARGET_SYSROOT/usr -C link-arg=--sysroot=\$OECORE_TARGET_SYSROOT -L \$LIB_PATH"
> +        export CARGO_BUILD_TARGET="${RUST_TARGET_SYS}"
>  	export RUST_TARGET_PATH="\$OECORE_NATIVE_SYSROOT/usr/lib/${TARGET_SYS}/rustlib"
>  	EOF

I'm a bit confused here. The script in question already has
${RUST_TARGET_SYS} in its name, so it is already target specific. Why
do we need to move it to a target specific directory?

Cheers,

Richard



  parent reply	other threads:[~2026-08-20  8:54 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-07  9:31 [PATCH v2 1/3] rust-cross-canadian: install target-specific env scripts and fix rustlib lookup Harish.Sadineni
2026-08-07  9:31 ` [PATCH v2 2/3] toolchain-scripts: source target-specific environment setup scripts Harish.Sadineni
2026-09-07 21:56   ` [OE-core] " Richard Purdie
     [not found]   ` <18D328AC1287253A.77878@lists.openembedded.org>
2026-09-07 22:10     ` Richard Purdie
2026-08-07  9:31 ` [PATCH v2 3/3] oeqa/sdk/cases/rust.py: Expand test to verify cargo build builds for target Harish.Sadineni
2026-08-20  8:54 ` Richard Purdie [this message]
2026-08-21  8:55   ` [OE-core] [PATCH v2 1/3] rust-cross-canadian: install target-specific env scripts and fix rustlib lookup Harish Sadineni
2026-08-27 17:31     ` Richard Purdie
2026-09-07 18:17       ` Harish Sadineni

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d489c96976fb770d0499ef325cedf7e085dcc775.camel@linuxfoundation.org \
    --to=richard.purdie@linuxfoundation.org \
    --cc=Harish.Sadineni@windriver.com \
    --cc=Sundeep.Kokkonda@windriver.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.