Because devtool inhibits all the normal bitbake fetchers, we can't mask crates.io.
Use EXTERNALSRC to detect if we're being built with devtool, and only mask
crates.io if we're not.
Fixes#195
When yocto is searching for lib dependencies it uses SONAMES and RPATHS to find
the right one. When we compile a rust package which dynamically links to rust's
libstd, yocto will not be able to find the matching dependency in shlib and
will complain with a warning. Even worse, if you have compiled go-runtime, the
build will find go-runtime as provider of libstd and will complain that you
missed a RDEPENDS to go-runtime - this is completely wrong obviously.
This patch adds SONAME to rust's stdlib. In this way yocto will create the
required provider and packages dynamically linking to it will be able to find
libstd-rs as a provider of stdlib.
Signed-off-by: Andrei Gherzan <andrei@resin.io>
Support for mips32 big (mips) and little endian (mipsel) for mips32
and mips32r2 cpus. The big endian target can be verified with the
qemumips machine.
The "target_c_int_width field is added to librustc_back since rust
1.22.0 because not all rust targets (e.g. msp430-none-elf, avr)
have 32-bit int types any more.
0.8.2 is the last version before the breaking "flags" keyword change.
For now, no_std crates need to be rlibs because rustc complains about
missing lang items on dylibs even though it would eventually be resolved
in the final link.
Ignore pub_use_of_private_extern_crate as there exists no version with
this fixed that uses the old API.
Patchelf should be reserved for when the ELF cannot be generated
correctly in the first place. This is not the case here because we have
control over the linker flags. The limitation is that -C link-args can
only be specified once, so consolidate the generation of link-args. Also
introduce some new intermediate variables in link-args generation for
customization.
Patchelf was running only in ${PKGD} because patching the ELF in ${D}
would cause objcopy to fail when splitting the debug sections. This is
not a problem when setting it correctly in the linker. The benefit is
that the rpath is correct in the sysroot as well.
This also switches the rpaths to be relative so that they work in both
the sysroot and the target in the same way.
Signed-off-by: Tyler Hall <tyler.hall@lexmark.com>
Signed-off-by: Steven Walter <swalter@lexmark.com>
Commit 864fe95 ("classes: create proper compiler and linker wrappers")
introduced wrapper scripts for the OE toolchain. Specifying the sysroot
manually ceased to function in rust-bin, so use the wrapper where rustc
is called directly.
This should be more reliable than trying to repeat what OE puts in the
$CC variable.
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.