The way LLVM builds its native utilities is not safe (it runs a
recursive cmake in the same work directory as the main instance). To
prevent those instances from stepping on each other, we'll build the two
native utilities separately before starting the main build.
Fixes issue #143
This is a fast case if the slave has a local checkout available so that
it doesn't have to do a full clone. The check unfortunately didn't take
into account all cases and failed on the new slave.
(cherry picked from commit d867f3d470)
Fix building a toolchain installer with bitbake
-c populate_sdk in packages compiler-rt,
compiler-rt-dev and compiler-rt-staticdev.
Signed-off-by: Leon Anavi <leon.anavi@konsulko.com>
Merges the changes in the morty branch into krogoth to get Rust 1.10.0
and Rust 1.12.1 into krogoth. Additionally this allows for Rust, Cargo
and any recipes to be built without internet access if they are defined
using cargo-bitbake. Fixes#87. Fixes#122.
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.
Reworked the source redirection to use directory source redirection like
I've done for Gentoo. This allows us to specify all crate dependencies
in the bitbake SRC_URI and have Yocto fetch them down using our crate
fetcher and then Cargo will build without reaching out to the network.
Redid how compiler-rt is built by using the Rust makefiles to build it
instead of compiler-rt's build system. Rust itself deviated from using
compiler-rt's build system and provided their own rules requiring the
source tree to be configured to use them.
We need the Rust snapshot (stage0) for the build environment not the
host environment. This is not affecting us currently because we are only
building native versions of this today but should improve the behavior
of #81 or if any Rust components are built for the target machine.
Since we no longer use shared source we can modify the source directory
as we build. This drops another patch we need to build and simplifies
the addition of Rust 1.12.1 in #97.
Don't supply the linker arguments via rustflags and then mangle with the
RUSTFLAGS environment variable. This is also a parial reversion of
4e1bda643e and 5afc0cc471. These changes are reverted since it assumed
people would build with cargo and not directly with rustc. ref #116.
We don't use the native Rust triples but instead use the Yocto triples
so we need to provide this override properly. This typo was introduced
in 5afc0cc471.
Firstly, HOST_CC_ARCH and TOOLCHAIN_OPTIONS are included in CC so them
being passed in are redundant now (due to the wrapper). The RUST_CFLAGS
variable doesn't need to be exported since its not actually used by
rustc/gcc-rs/cargo. Since its redundant and doesn't need to be exported,
remove it and simplify.
Firstly, BUILD_CC_ARCH is included in BUILD_CC (hence why we actually
need a BUILD_CC wrapper because it produces the space), so its
redundant (now with the wrapper using BUILD_CC). The RUST_BUILD_CFLAGS
variable doesn't need to be exported since its not actually used by
rustc/gcc-rs/cargo. Since its redundant and doesn't need to be
exported remove it and simplify.
Rust builds (custom build.rs and gcc-rs users) expect to have the
compiler and the linker available to them as a single command with no
white space trailing. Yocto unfortunately does not conform to that. The
build compiler and linker almost always have a trailing space due to
how the variables are composed and the target compiler and linker are
almost always more than a single command. Then if you throw ccache into
the mix you'll get another command. As a result to handle all these
cases properly there need to be wrappers created. This change creates
wrappers for both build and target and both the linker and compiler.
This likely fixes#76.
Provide documentation behind what the triples mean for Yocto and Rust
since they have different meanings of BUILD, TARGET, and HOST. Namely
Rust uses HOST when Yocto means BUILD. In our current supported cases
HOST and TARGET from Yocto mean the same thing.