Hi Sean,
> On 14 Jan 2025, at 08:21, Sean Nyekjaer via lists.openembedded.org
> <[email protected]> wrote:
>
> This fixes build errors when building rust bindings for C dependencies
> for the sdk host.
> This will allow us to build and run rust programs on the sdk host.
Can you also add a test case to exercise this, to ensure it doesn’t regress in
the future? meta/lib/oeqa/sdk/cases/rust.py has some minimal testing already
so adding more there would be great.
> --- a/meta/recipes-devtools/rust/rust-cross-canadian.inc
> +++ b/meta/recipes-devtools/rust/rust-cross-canadian.inc
> @@ -58,11 +58,13 @@ do_install () {
>
> 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'`
> + RUST_HOST_CC=`echo ${RUST_HOST_SYS} | sed 's/-/_/g'`
> SDKLOADER=${@bb.utils.contains('SDK_ARCH', 'x86_64',
> 'ld-linux-x86-64.so.2', '', d)}${@bb.utils.contains('SDK_ARCH', 'i686',
> 'ld-linux.so.2', '', d)}${@bb.utils.contains('SDK_ARCH', 'aarch64',
> 'ld-linux-aarch64.so.1', '', d)}${@bb.utils.contains('SDK_ARCH', 'ppc64le',
> 'ld64.so.2', '', d)}${@bb.utils.contains('SDK_ARCH', 'riscv64',
> 'ld-linux-riscv64-lp64d.so.1', '', d)}
>
> 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/${SDKLOADER}"
> + export CC_$RUST_HOST_CC="${CCACHE}${HOST_PREFIX}gcc"
> export
> RUST_TARGET_PATH="\$OECORE_NATIVE_SYSROOT/usr/lib/${TARGET_SYS}/rustlib”
> EOF
There’s another series on the list that rewrites this
(https://lore.kernel.org/openembedded-core/[email protected]/)
and moves some assignments to an environment file in rust.bb. I suspect the
same needs to happen here, so can you rebase on top of that patch (or wait for
that to be merged and rebase).
Thanks,
Ross
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#210150):
https://lists.openembedded.org/g/openembedded-core/message/210150
Mute This Topic: https://lists.openembedded.org/mt/110604319/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-