I am running into a problem that has me stumped. Rust programs, compiled under yocto, will compile without error and will compile properly for the target.
But when I have move the build outside of yocto, I am running into a hornet's nest of problems.
The 'linker' (for yocto) specified in the rust .cargo/config is:
linker = "gcc-sysroot"
But outside yocto it will produce an error saying it can not find 'gcc-sysroot' (and there is no export for it). However there are exports for ${CC} and --sysroot.
One other problem is if I set my 'default' for cargo as 'arm7-unknown-linux-gnueabihf' (which I have specified in .cargo.config as [target.armv7-unknown-linux-gnueabihf]) it complains can not find the rustc version.
$ rustup default stable-armv7-unknown-linux-gnueabihf
info: using existing install for 'stable-armv7-unknown-linux-gnueabihf'
info: default toolchain set to 'stable-armv7-unknown-linux-gnueabihf'
stable-armv7-unknown-linux-gnueabihf unchanged - (error reading rustc version)
and
$ rustup show
Default host: x86_64-unknown-linux-gnu
installed toolchains
--------------------
stable-armv7-unknown-linux-gnueabihf (default)
stable-x86_64-unknown-linux-gnu
active toolchain
----------------
stable-armv7-unknown-linux-gnueabihf (default)
(error reading rustc version)
And then If I attempt
$ cargo build --target=armv7-unknown-linux-gnueabihf --release
/home//.rustup/toolchains/stable-armv7-unknown-linux-gnueabihf/bin/cargo: 1: /home//.rustup/toolchains/stable-armv7-unknown-linux-gnueabihf/bin/cargo: Syntax error: word unexpected (expecting ")")
but if I rustup default stable-x86_64-unknown-linux-gnu. It will compile binaries for x86 and not my target which I would expect.
I am fairly new to rust. So if this seems like a noob question (it is !!!)
I feel it has something to do with defining 'gcc-sysroot' somewhere else.