I think Adrian made the most progress in addressing this problem, so
you should discuss/cooperate with him.

Alex

On Mon, 2 Oct 2023 at 13:12, Kasper <[email protected]> wrote:
>
> Hi Alexander
>
> I am in the same team as Sean, and we really like the way it is solved in 
> Rust/Cargo.
> However, we have the issue also for C++, and as you state there is no obvious 
> solution.
> We are using cmaake for our C+++ projects and are discussing if a solution is 
> to try to make
> a cmake toolchain file for the oesdk environment as well.
> If you have any experience/input it would be highly appreciated.
>
> Br
> Kasper
>
> On September 28, 2023 at 2:47:27 pm +02:00, Alexander Kanavin 
> <[email protected]> wrote:
>
> This seems like a good change (being able to easily run items built
> with c/c++ tolchains in yocto SDKs is a problem no one has
> satisfactorily resolved, and it's nice that rust got this right), but
> can you expand the test in meta/lib/oeqa/sdk/cases/rust.py to cover
> possible target options such as this one?
>
> Alex
>
> On Thu, 28 Sept 2023 at 10:10, Sean Nyekjaer <[email protected]> wrote:
>
>
> This will enable us to build and run rust programs on the sdk host.
>
> % cargo run --target x86_64-oesdk-linux-gnu -vv
> Fresh hello v0.1.0 (~/development/hello)
> Finished dev [unoptimized + debuginfo] target(s) in 0.02s
> Running `/usr/local/sdk/sysroots/x86_64-oesdk-linux/lib/ld-linux-x86-64.so.2 
> target/x86_64-oesdk-linux-gnu/debug/hello`
> Hello, world
>
> Signed-off-by: Sean Nyekjaer <[email protected]>
> ---
> meta/recipes-devtools/rust/rust-cross-canadian.inc | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/meta/recipes-devtools/rust/rust-cross-canadian.inc 
> b/meta/recipes-devtools/rust/rust-cross-canadian.inc
> index d25646237c..5b89216658 100644
> --- a/meta/recipes-devtools/rust/rust-cross-canadian.inc
> +++ b/meta/recipes-devtools/rust/rust-cross-canadian.inc
> @@ -55,9 +55,12 @@ do_install () {
> RUST_ENV_SETUP_SH="${ENV_SETUP_DIR}/rust.sh"
>
> RUST_TARGET_TRIPLE=`echo ${RUST_TARGET_SYS} | tr '[:lower:]' '[:upper:]' | 
> sed 's/-/_/g'`
> + RUST_HOST_TRIPLE=`echo ${RUST_HOST_SYS} | tr '[:lower:]' '[:upper:]' | sed 
> 's/-/_/g'`
> + SDKARCH=`echo ${SDK_ARCH} | 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_TARGET_${RUST_HOST_TRIPLE}_RUNNER="\$OECORE_NATIVE_SYSROOT/lib/ld-linux-${SDKARCH}.so.2"
> export 
> RUST_TARGET_PATH="\$OECORE_NATIVE_SYSROOT/usr/lib/${TARGET_SYS}/rustlib"
> EOF
>
> --
> 2.42.0
>
>
> 
>
>
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#188711): 
https://lists.openembedded.org/g/openembedded-core/message/188711
Mute This Topic: https://lists.openembedded.org/mt/101633983/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to