Skip to content

Support external toolchains #76

@jmagnuson

Description

@jmagnuson

Currently, gcc-cross-${TARGET_ARCH} is hard-coded, resulting in failure if something like external-arm-toolchain is used instead:

ERROR: Nothing PROVIDES 'gcc-cross-arm' (but /home/jon/src/jmagnuson/yocto/rpi0/layers/meta-rust-bin/recipes-devtools/rust/rust-bin-cross_1.44.0.bb DEPENDS on or otherwise requires it)
gcc-cross-arm was skipped: PREFERRED_PROVIDER_virtual/arm-none-linux-gnueabihf-gcc set to external-arm-toolchain, not gcc-cross-arm
gcc-cross-arm was skipped: PREFERRED_PROVIDER_virtual/arm-none-linux-gnueabihf-gcc set to external-arm-toolchain, not gcc-cross-arm
gcc-cross-arm was skipped: PREFERRED_PROVIDER_virtual/arm-none-linux-gnueabihf-gcc set to external-arm-toolchain, not gcc-cross-arm
gcc-cross-arm was skipped: PREFERRED_PROVIDER_virtual/arm-none-linux-gnueabihf-gcc set to external-arm-toolchain, not gcc-cross-arm
NOTE: Runtime target 'hello-rust' is unbuildable, removing...
Missing or unbuildable dependency chain was: ['hello-rust', 'cargo-bin-cross-arm', 'rust-bin-cross-arm', 'gcc-cross-arm']
ERROR: Required build target 'packagegroup-rpi-test' has no buildable providers.
Missing or unbuildable dependency chain was: ['packagegroup-rpi-test', 'hello-rust', 'cargo-bin-cross-arm', 'rust-bin-cross-arm', 'gcc-cross-arm']

Patching directly works:

diff --git a/recipes-devtools/rust/rust-bin-cross.inc b/recipes-devtools/rust/rust-bin-cross.inc
index 25ca590..0145503 100644
--- a/recipes-devtools/rust/rust-bin-cross.inc
+++ b/recipes-devtools/rust/rust-bin-cross.inc
@@ -7,7 +7,7 @@ inherit cross
 inherit rust-common

 # Required to link binaries
-DEPENDS += "gcc-cross-${TARGET_ARCH}"
+DEPENDS += "external-${TARGET_ARCH}-toolchain"

 PN = "rust-bin-cross-${TARGET_ARCH}"

but the long-term solution would be to determine which to pull in at build time. Checking the environment for TCMODE or EXTERNAL_TOOLCHAIN could work, or possibly just using virtual/${TARGET_PREFIX}gcc itself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions