Further changes needed for musl to work.
env needs to be set to "musl" for unwinding work properly.
Also the llvm target should end with "-musl" and not "-gnu".
Since commit 06a138a ("rust: drop custom target finding patch"), rustc
is no longer self-sufficient in finding its target specifications. Any
usage of rustc needs RUST_TARGET_PATH set in the environment.
Move the declaration to rust-common.bbclass and add the export to
rust-bin where rustc is invoked.
Switch the build process to using Rust's new build system called
rustbuild. At the same time stop using jemalloc on all platforms and
switch to the system allocator since that was simplier to do.
For similar reasons to the C and linker wrappers, using rustbuild
requires a C++ wrapper to ensure that the right flags that Yocto needs
are passed to the underlying compiler.
The -C crate_hash option does not work if multiple versions of the same
crate are being linked into a binary. This can happen if different
dependencies depend on different versions of the same crate. The -C
crate_hash argument causes all versions of a given crate to have the
same crate hash which in turn causes the compiler to select the wrong
one internally and crash. This works around issue #126 for Cargo builds
but does not fix the underlying cause.