summaryrefslogtreecommitdiffstats
path: root/meta/classes/rust-common.bbclass
AgeCommit message (Collapse)Author
2021-10-14rust-common.bbclass: rewrite toolchain wrappers in (native) pythonAlexander Kanavin
librsvg on centos 7 and friends exhibits the same libtinfo leakage problem, this time coming from the compiler and not the linker. Simply covering the compiler by the existing C wrapper-of-wrapper does not work, as rust-native builds put Important Stuff into LD_LIBRARY_PATH and unsetting it breaks things badly. Rather than try to figure out which combination of wrappers and LD_LIBRARY_PATH settings works for which situation, or provide some kind of sh-native, let's simply use python3-native for the wrappers, which should insulate builds from the the host shell. rust-native already depends on python3-native, so this does not lengthen the builds. This also reverts: rust-common: Hack around LD_LIBRARY_PATH issues on centos7 (commit 63b1fd2226b5f146d6c853cc57417704df378438). I'd also like to say boo to Red Hat (or GNU?) for breaking ABI compatibility for stat() in glibc 2.33, we ended up sorting this mess because of it. Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-09-19rust-common.bbclass: make sure ccache existKai Kang
It fails to run task rust_create_wrappers of recipe which inherit rust-common.bbclass such as rust-hello-world if no host ccache exists: | DEBUG: Executing shell function do_rust_create_wrappers | /path/to/project/tmp-glibc/work/core2-64-wrs-linux/rust-hello-world/git-r0/temp/run.do_rust_create_wrappers.3422: line 179: ccache: command not found Run task rust_create_wrappers before do_prepare_recipe_sysroot to make sure required tools such as ccache exist. Signed-off-by: Kai Kang <kai.kang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-09-02rust-common: Hack around LD_LIBRARY_PATH issues on centos7Richard Purdie
When building cargo-native on centos7 with buildtools tarball installed, we see failures: /bin/sh: /lib64/libc.so.6: version `GLIBC_2.33' not found (required by /home/pokybuild/yocto-worker/reproducible-centos/build/build-st/tmp/work/x86_64-linux/cargo-native/1.54.0-r0/recipe-sysroot-native/usr/lib/libtinfo.so.5) We also see this for libstd-rs once cargo-native is fixed. The reason for this is that the wrapper script cargo-native/1.54.0-r0/wrapper/target-rust-ccld has /bin/sh as it's interpreter and cargo calls this with LD_LIBRARY_PATH set to include the recipe-sysroot-native. The host /bin/sh links to libtinfo from the host but it finds the version in the sysroot which needs a newer libc. This results in the above error since the loader is an older libc and the two are incompatible. Our ccld wrapper calls gcc/ld which don't need the LD_LIBRARY_PATH variable set. We can't patch this out the source since we're using a prebuilt binary to generate a new cargo binary so this is impossible to bootstrap. Instead, put a binary wrapper into place which removes LD_LIBRARY_PATH from the environment before calling the original wrapper (left in shell as it is simpler to maintain). Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-09-01rust-common.bbclass: export RUST_TARGET_PATHTim Orling
Running 'rustc --print <foo>' in -c devshell environment the target specifications are not known, unless the RUST_TARGET_PATH (absolute path to rustlib/) is defined. Signed-off-by: Tim Orling <timothy.t.orling@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-08-26rust-common: Add LDFLAGS to cc wrapperRichard Purdie
The -cc wrapper can be used for linking and can fail if key flags are missing: | error: linking with `[path]/tmp/work/x86_64-linux/rust-native/1.54.0-r0/wrapper/target-rust-cc` Add the flags to fix builds even if that is counter-intuitive (cc would normally be used for compiling and ccld for linking). Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-08-26rust-cross*: Fix OVERRRIDE references in task signature computationRichard Purdie
The oeqa selftest test: sstatetests.SStateTests.test_sstate_sametune_samesigs which checks if the sstate checksums of two identical machines (using the same tune) are the same, apart from changes within the machine specific stamps directory, fails on the assertion: self.assertCountEqual(files1, files2) due to the signature of various 32 bit package builds such as: x86_64-linux/lib32-rust-cross-i686 x86_64-linux/rust-cross-i686 x86-pokymllib32-linux/lib32-libstd-rs x86-pokymllib32-linux/lib32-rust differing. Jumping down the rabbit hole past all the bitbake-diffsig outputs that differ due to dependent hashes, you come to a diff of: -Variable MACHINEOVERRIDES value is ${@bb.utils.contains('TUNE_FEATURES', 'mx32', 'x86-x32:', '', d)}${@bb.utils.contains('TUNE_FEATURES', 'm32', 'x86:', '', d)}qemuall:${MACHINE} +Variable MACHINEOVERRIDES value is ${@bb.utils.contains('TUNE_FEATURES', 'mx32', 'x86-x32:', '', d)}${@bb.utils.contains('TUNE_FEATURES', 'm32', 'x86:', '', d)}qemuall:${MACHINE}:qemux86 in stamps/x86_64-linux/rust-cross-i686/1.54.0-r0.do_rust_gen_target.<sig> This is because there are two rust functions referencing OVERRIDES related variables (target_is_armv7 and llvm_features_from_tune). These indirectly influnce the build and should be excluded from the signatures directly as is done in other toolchain recipes, e.g.: 39bfa0dd32 recipes/*-cross recipes: ignore TARGET_ARCH sstate hash Signed-off-by: Randy MacLeod <Randy.MacLeod@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-08-26rust: initial merge of most of meta-rustRandy MacLeod
In the meta-rust repo at commit: 448047c Upgrade to 1.54.0 (#359) Make the required directories: mkdir ../oe-core/meta/recipes-devtools/rust mkdir ../oe-core/meta/recipes-devtools/cargo mkdir ../oe-core/meta/recipes-example and then: cp recipes-devtools/rust/* ../oe-core/meta/recipes-devtools/rust cp recipes-devtools/cargo/* ../oe-core/meta/recipes-devtools/cargo cp lib/crate.py ../oe-core/meta/lib cp recipes-example/* ../oe-core/meta/recipes-example cp conf/distro/include/rust_* ../oe-core/meta/conf/distro/include/ cp classes/* ../oe-core/meta/classes/ cp recipes-core/packagegroups/packagegroup-rust-cross-canadian.bb ../oe-core/meta/recipes-core/packagegroups Signed-off-by: Randy MacLeod <Randy.MacLeod@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>