Commit Graph

234 Commits

Author SHA1 Message Date
Khem Raj
e2a1c8bc31 rust: Use variable to specify extra tools to install
All architectures may not support same set of tools, therefore use a
variable to specify this. E.g. on riscv32 rustfmt is not buildable
right now.

(From OE-Core rev: 332df9ebbd75a1825ac99abf1311d2e692d398d7)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-09-09 14:09:01 +01:00
Sundeep KOKKONDA
dd8fd17a1b rust-cross-canadian: Fix for the issue caused by using sdk shell
This is a fix for the fix in YOCTO #14878. When the shebang is more than
128 characters the default shell /bin/sh is used instead of SDK shell as
a fallback, which causes problems with LD_LIBRARY_PATH. With this patch
shell usage is avoided as we use a C wrapper and unset LD_LIBRARY_PATH
that way.

[YOCTO #14892]

(From OE-Core rev: 7cd6faf4e0147eef557f83fb266a25935e26efff)

Signed-off-by: Sundeep KOKKONDA <sundeep.kokkonda@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-09-07 08:53:50 +01:00
pgowda
3a804fa64e rust: Enable verbose-tests to get the test results in readable format
Emits complete details regarding the test results to understand
and debug from logfiles

(From OE-Core rev: 78aecd6d4e443cb467e9a8007f2db29943dfdd1f)

Signed-off-by: pgowda <pgowda.cve@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-09-05 12:55:09 +01:00
pgowda
2b24fd8789 rust: Add linker configurations for cross compilation
Adds the cross compilation linker for build, host and target.
Ensure the main rust config has the appropriate sections added
to match the configurations.

(From OE-Core rev: 02133f92c56c90a5365985b515953e4136e112aa)

Signed-off-by: pgowda <pgowda.cve@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-09-05 12:55:09 +01:00
Khem Raj
e9edf8bfea rust-llvm: Update to matching LLVM_VERSION from rust-source
(From OE-Core rev: 7fe15d05811d6cf3172939228f75dbcc55396365)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-09-01 10:14:01 +01:00
Richard Purdie
6323229342 rust: Fix crossbeam-utils for arches without atomics
crossbeam-utils tries to use the triplet to look up whether the target
supports various forms of atomics. We use TARGET_VENDOR and not "-unknown"
in the target case which means this fails and breaks platforms like mips
and powerpc 32 bit. Add a patch to handle TARGET_VENDOR in this case.

(From OE-Core rev: 5d8c01dfed4c82fcc5d504c728a51fb98a262300)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-08-31 10:40:07 +01:00
Khem Raj
a090aea9a7 rust: Fix build failure on riscv32
Latest rust has started using ENOTSUP define, which is not available in
the older libc that current release of compiler is using therefore
backport the needed patch. Eventually when vendored version of libc
bumps to 1.33+ we should not need this patch.

(From OE-Core rev: 097e38f28990229c3f54f4e6cb74ca8be0b806e6)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-08-31 10:40:07 +01:00
Randy MacLeod
c2a7fccb57 rust: update from 1.62.1 to 1.63.0
Release notes:
   https://blog.rust-lang.org/2022/08/11/Rust-1.63.0.html

This is a standard upgrade aside from the path for the
stage2 tools binaries (clippy, et.al.) changing.

(From OE-Core rev: 9f390accf5fd174c430928cf841728d0456fc1b7)

Signed-off-by: Randy MacLeod <Randy.MacLeod@windriver.com>
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>
2022-08-31 10:40:07 +01:00
Peter Bergin
0823b7bc49 rust-cross-canadian: rename shell variables for easier appends
Make unique shell variable names for cargo and rust
setup scripts. This change will make it easier to append to the
scripts in a bbappend file by using the variable for the script.
Before this change it was only possible for the last script as
they shared the same variable name.

(From OE-Core rev: 74307f57ad0b3c538be0add11028e4e6199a7662)

Signed-off-by: Peter Bergin <peter@berginkonsult.se>
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-08-25 11:08:06 +01:00
Alexander Kanavin
95832841bf rust: update 1.62.0 -> 1.62.1
(From OE-Core rev: 6baa224158f40b9754c3f10e11966d02e1337ae7)

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>
2022-08-14 08:13:32 +01:00
Richard Purdie
83e7f668ae rust: Remove unneeded RUST_TARGETGENS settings
These match the default from the class so drop them. We then always
generate all targets so remove the configuration from the class.

(From OE-Core rev: e4d56256936c55bab2bf2934ccbde9157ef7dc57)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-08-12 11:46:26 +01:00
Richard Purdie
0650f9c770 rust-cross-canadian: Use shell from SDK, not the host
rust sets LD_LIBRARY_PATH which causes a lot of problems with host
binaries conflicting with SDK libraries. By using sh/bash from the
SDK we avoid those issues.

[YOCTO #14878]

(From OE-Core rev: dabd97e78a599a81c056c0f3291244f5afae44b0)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-08-09 22:42:04 +01:00
Richard Purdie
a514d1cb53 rust: Update README
Update the README to match the current status and remove unclear/obsolete
information and fix formatting.

(From OE-Core rev: fa5d16692dda655a54653df7b4bf98410090ec5c)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-08-08 15:44:20 +01:00
Richard Purdie
1e8f4ee56a rust: Ensure buildpaths are handled in debug symbols correctly
To ensure buildpaths aren't encoded in the debug symbol output, ensure
we pass our prefix remapping compiler options in.

(From OE-Core rev: c7a529743560c37973787e4ab2433cb7485afb86)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-08-08 15:44:20 +01:00
Richard Purdie
e1dcfcdbfa rust: Fix musl builds
Musl targets need a sysroot set to find the musl static libraries. Set this
appropriately in musl builds.

(From OE-Core rev: 1c5ab57ddda393631ce2da97ef5a876a2020d51f)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-08-08 15:44:20 +01:00
Richard Purdie
16b4ac3f55 rust: Enable nativesdk and target builds + replace rust-tools-cross-canadian
Enable rust target builds as well as nativesdk-rust for the sdk. Merge
the builds of rust-tools components into the rust build, packaged separately
since this is a lot more efficient and saves rebuilding core rust multiple
times. The tools are not target specific so nativesdk-rust-tools suffices
and we can drop the cross canadian piece.

(From OE-Core rev: b9b0cd99cdc77e7a90e5fd5711e706ebe64c7b6b)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-08-08 15:44:20 +01:00
Richard Purdie
38934deeea rust: Drop cross/crosssdk
Now that target config json is provided by rust-target-config.bbclass,
the need for the cross and crosssdk recipes is removed. Drop them and
simplify dependencies accordingly.

(From OE-Core rev: 4b54f5f52b33db4d2fe95c5faef033b6c6b37b7d)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-08-08 15:44:20 +01:00
Richard Purdie
0a01b5ab97 rust-cross-canadian: Simplify and fix
Since a copy of rust can target any target and doesn't need to be target
specific, we can simplify rust-cross-canadian to simply contain the json
configuration and envirionment setup scripts.

(From OE-Core rev: 6ec18de9d6f49bccff72f2665821dbd732b69b48)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-08-08 15:44:20 +01:00
Richard Purdie
251f55374d cargo: Drop cross-canadian variant and fix/use nativesdk
The cargo-cross-candian variant made no sense as one version of cargo in
the SDK can work for all targets. Replace it with nativesdk-cargo instead.

Move the SDK env to rust-cross-canadian.

(From OE-Core rev: 6d6d135924eff5993736ee58ba8cc5d00ca635f3)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-08-08 15:44:20 +01:00
Richard Purdie
82dc055d96 rust.inc: Fix for cross compilation configuration
For cross compilation, build, host and target may be different. Ensure
the main rust config has the appropriate sections added to match the
configurations.

(From OE-Core rev: e2cdbf9df8d3f90b5a7ba35288c5db4f252d134d)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-08-08 15:44:20 +01:00
Richard Purdie
749c85917f rust-llvm: Enable nativesdk variant
To allow nativesdk variants of the tools to build, enable a nativesdk
variant of rust-llvm.

(From OE-Core rev: b4b24dc53fdb86624da71b854dfe018923a203fe)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-08-08 15:44:20 +01:00
Richard Purdie
1ab2fd2d03 cargo_common: Handle build SYS as well as HOST/TARGET
Improve the common class to handle BUILD_SYS as well as host and target,
removing the need to a workaround in the rust recipe.

(From OE-Core rev: 0dc9635c28c269f782ad4ed6ea06b4e4de1beb8e)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-08-08 15:44:20 +01:00
Richard Purdie
1c8444bd38 rust-common/rust: Improve bootstrap BUILD_SYS handling
Move the "unknown" vendor workaround used during bootstrap to a
central location so it is applied consistently to all RUST_BUILD_SYS
values rather than some subset.

(From OE-Core rev: d02c28b2219d736c9598a13fead7a03eaa3256a6)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-08-08 15:44:20 +01:00
Richard Purdie
b1d8d2a3bf rust: Generate per recipe target configuration files
Instead of generating target configuration files centrally and often getting
it wrong, or having trouble finding the right set, generate them dynamically
from the bbclass into WORKDIR per recipe.

(From OE-Core rev: 9160e4a37561d8ac882057450a818621bec13bed)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-08-08 15:44:20 +01:00
Richard Purdie
9e5cbb80f0 rust/mesa: Drop obsolete YOCTO_ALTERNATE_MULTILIB_NAME
This variable is no longer used by the llvm patches.

(From OE-Core rev: 35e1ecf88cf9725e1ba43c948e90359df983002f)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-08-08 15:44:20 +01:00
Richard Purdie
c2f5b71c9b rust.inc: Fix cross build llvm-config handling
We need llvm-config for the target but the cross compiled target binary is
no good. We can copy the native one into the target location where it will
then return the target values though.

(From OE-Core rev: f355e55c1fcef57f288279ffb47ebeb52a72b689)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-08-08 15:44:20 +01:00
Richard Purdie
3350658cb2 rust.inc: Rename variables to make code clearer
Instead of reusing a "target_section" variable, name them host and build
section instead. This patch sets things up for other improvementsm,
separating out the renaming.

(From OE-Core rev: 279b809e8306b0eb6ae6caeb6b0a3c3c62d2f9d2)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-08-08 15:44:20 +01:00
Richard Purdie
5c45b73c8f rust: Switch to use RUST_XXX_SYS consistently
The code was using a mixture of XXX_SYS and RUST_XXX_SYS. Use
RUST_XXX_SYS consistently and add the variables to the global exclsion
on signatures as they're reflected in the directory triplets and trying
to filter them out the hashes separately is too painful.

(From OE-Core rev: ee0c0fdf9c1eba9eece6ed1293fda25bf18964b3)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-08-08 15:44:20 +01:00
Richard Purdie
411304c3e9 rust: Work around reproducibility issues
Add a patch which removes the sections of code which encode buildpaths. Whilst
not ideal, the patches at least show where the problematic data is coming from
and should allow more focused work to resovle it by someone who has a better
understanding of rust and what this code is doing. It does look unlikely we
actually need this code in our usecases anyway.

(From OE-Core rev: c08c522fc29445aef0c64f0dd8df8a3531c04afa)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-08-08 15:44:20 +01:00
Richard Purdie
e75e781a48 rust-target-config: Allow the targets generated to be configurable
Remove further code duplication by allowing the main function to be
configurable.

(From OE-Core rev: 2d4b35a0db1220e7a7f1b6776223aa4d40a3f246)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-07-28 11:07:33 +01:00
Richard Purdie
1e04c8aafb rust-target-config: Create new class to contain target json config generation
Currently most of the rust recipes use this code but it is all piecemeal.
Turn the code into a class where things can start to be rationalised. Ultimately
some of the data and python code should be moved to a python library but one step
at a time.

No functionality changes.

(From OE-Core rev: 3795285cbf362e13b8151bfdbe1bce999ac28641)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-07-28 11:07:33 +01:00
Richard Purdie
a02bb3b794 rust-common/rust-cross: Clean up target json generation code
Some of the subtleties in the different codepaths for target rust json generation
were not easy to spot. Start to simplfy the code to make this clearer.

This patch should not have any functionality change although ABIEXTENSION
has to be excluded from the function signature, the triplet would normally
cover anything set there.

(From OE-Core rev: 0f83d959465e0d99f98ade6803281585931d1b02)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-07-28 11:07:33 +01:00
Richard Purdie
97e267f6df rust-cross: Simplfy the rust_gen_target calls
Match the code in rust-cross-canadian so that further simplifications
can be considered in future.

(From OE-Core rev: 5cb62d0a33777cb9afb1eea5f736a2580ce50dc7)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-07-28 11:07:33 +01:00
Richard Purdie
1900f5b607 rust-cross/rust-common: Merge arm target handling code to fix cross-canadian
rust-cross had special handling for armv7 targets but we also need this
for cross-canadian. Merge the code into the main function so everything is
consistent.

Also then fix the arm definition to be arm-eabi since ABI is correctly
being looked up.

(From OE-Core rev: ff3c3dbbd2bf1bb7bb70b55cca203e9eedcf14a8)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-07-28 11:07:33 +01:00
Richard Purdie
276c6ffe5f rust-cross-canadian: Fix ordering of target json config generation
Based upon a patch from Otavio Salvador <otavio@ossystems.com.br>,
ensure the target json files are written in the correct order with
the most specific last incase it overwrites earlier files if the prefixes
match.

(From OE-Core rev: 1912c4e9e0ecf9655f3b3a41588b54d7956f5899)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-07-28 11:07:33 +01:00
Richard Purdie
d48c7e4549 rust-common: Set llvm-target correctly for cross SDK targets
When a 'BUILD' target is requested we shouldn't be looking at TARGET_SYS but
at BUILD_SYS. Due to the way rust mangles triplets, we need the HOST_SYS triplet
to work with existing code - fixing that issue is a separate patch.

Also drop the arch_abi argument, it doens't make any sense to a getVar() call
and was a copy and paste error.

Based on a patch from Otavio Salvador <otavio@ossystems.com.br> but separated out
and tweaked.

Fixes: bd36593ba3 ("rust-common: Drop LLVM_TARGET and simplify")

(From OE-Core rev: d554161a045d12411f288394e253c54aa4c1257c)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-07-28 11:07:33 +01:00
Alexander Kanavin
bab6c13913 rust: update 1.60.0 -> 1.62.0
Drop the two libstdc patches as they've finally appeared upstream.

Disable the use of libstdc++.a from the host distributions, as it results
in cross-distro contamination in rust-native.

(From OE-Core rev: 94760bc118952160865352c10ca7693680b5ce7e)

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>
2022-07-08 00:09:42 +01:00
Peter Bergin
701ac97c15 rust: fix issue building cross-canadian tools for aarch64 on x86_64
Commit bd36593ba3db758b3eacc974e48468a665967961 did introduce a
regression when building package rust-cross-canadian-aarch64
on a x86_64 host. This commit will fix that configuration.

Suggested-by: Richard Purdie <richard.purdie@linuxfoundation.org>

(From OE-Core rev: ef566af964e9f9d2c440a3b5771ed801216f30f9)

Signed-off-by: Peter Bergin <peter@berginkonsult.se>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-06-29 16:16:56 +01:00
Richard Purdie
458c70b912 rust-common: Fix native signature dependency issues
The previous changes cause sstatetests.SStateTests.test_sstate_32_64_same_hash
to fail since RUST_XXX_SYS changes depending on the native architecture. This
is correct but these are accounted for in the layout of paths in TMPDIR so
they should be excluded from the task signatures for the correct behaviour.

(From OE-Core rev: 2b9bb4c07d0ab53f58cbdd8a96896780a90be9a8)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-05-21 22:20:54 +01:00
Richard Purdie
781eaa955d rust-common: Drop LLVM_TARGET and simplify
This all seems over complicated for something which is basically always
one of two values. This might even help cross-canadian work on something
which isn't x86-64.

(From OE-Core rev: bd36593ba3db758b3eacc974e48468a665967961)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-05-21 22:20:54 +01:00
Sundeep KOKKONDA
66ff1fb3a1 rust-common: Fix for target definitions returning 'NoneType' for arm
[YOCTO #14742]

The build shows below error while building for arm machines.
Exception: TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'
Detailed error info :

Steps to reproduce:
1. Set MACHINE ?= "qemuarm" in local.conf & add 'TOOLCHAIN_HOST_TASK:append = " packagegroup-rust-cross-canadian-${MACHINE}"'
2. bitbake core-image-minimal -cpopulate_sdk

Complete Error:
ERROR: rust-cross-canadian-arm-1.59.0-r0 do_rust_gen_targets: Error executing a python function in exec_func_python() autogenerated:
The stack trace of python calls that resulted in this exception/failure was:
File: 'exec_func_python() autogenerated', lineno: 2, function: <module>
     0001:
 *** 0002:do_rust_gen_targets(d)
     0003:
File: '/ala-lpggp31/skokkonda/yocto/poky/meta/recipes-devtools/rust/rust-cross-canadian-common.inc', lineno: 31, function: do_rust_gen_targets
     0027:
     0028:LLVM_TARGET[x86_64] = "${RUST_HOST_SYS}"
     0029:python do_rust_gen_targets () {
     0030:    wd = d.getVar('WORKDIR') + '/targets/'
 *** 0031:    rust_gen_target(d, 'TARGET', wd, d.getVar('TARGET_LLVM_FEATURES') or "", d.getVar('TARGET_LLVM_CPU'), d.getVar('TARGET_ARCH'))
     0032:    rust_gen_target(d, 'HOST', wd, "", "generic", d.getVar('HOST_ARCH'))
     0033:    rust_gen_target(d, 'BUILD', wd, "", "generic", d.getVar('BUILD_ARCH'))
     0034:}
     0035:
File: '/ala-lpggp31/skokkonda/yocto/poky/meta/recipes-devtools/rust/rust-common.inc', lineno: 330, function: rust_gen_target
     0326:    # build tspec
     0327:    tspec = {}
     0328:    tspec['llvm-target'] = d.getVarFlag('LLVM_TARGET', arch_abi)
     0329:    tspec['data-layout'] = d.getVarFlag('DATA_LAYOUT', arch_abi)
 *** 0330:    tspec['max-atomic-width'] = int(d.getVarFlag('MAX_ATOMIC_WIDTH', arch_abi))
     0331:    tspec['target-pointer-width'] = d.getVarFlag('TARGET_POINTER_WIDTH', arch_abi)
     0332:    tspec['target-c-int-width'] = d.getVarFlag('TARGET_C_INT_WIDTH', arch_abi)
     0333:    tspec['target-endian'] = d.getVarFlag('TARGET_ENDIAN', arch_abi)
     0334:    tspec['arch'] = arch_to_rust_target_arch(rust_arch)
Exception: TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'

Below are the local variables from rust_gen_target function for arm and
aarch64 targets. Refer below, the tspec varibles for 'arm' generated with NoneType.

(a) Locals at rust_gen_target for arm::
tspec['data-layout'] =  None, Type of tspec['data-layout'] =  <class 'NoneType'>
tspec['data-layout'] =  None, Type of tspec['data-layout'] =  <class 'NoneType'>
DEBUG: Python function do_rust_gen_targets finished
(b) Locals at rust_gen_target  for aarch64::
tspec['data-layout'] =  aarch64-unknown-linux-gnu, Type of tspec['data-layout'] =  <class 'str'>
tspec['max-atomic-width'] =  128, Type of tspec['max-atomic-width'] =  <class 'int'>

Reason for changing arm-eabi to arm: The earlier changes introduced this bug, so reverting the change 'arm-eabi' to 'arm' fixed the issue.

(From OE-Core rev: 8ed000debb026477abd86ea3bf72adaf21d69f39)

Signed-off-by: Sundeep KOKKONDA <sundeep.kokkonda@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-05-21 22:20:54 +01:00
Sundeep KOKKONDA
5ad33240d5 rust-common: Ensure sstate signatures have correct dependencues for do_rust_gen_targets
The do_rust_gen_targets task was not rerunning when the configuration variables it
uses were changed. Add the missing variable dependencies to fix this.

[RP: Split to separate patch and add commit message]
(From OE-Core rev: 65ce2d129154d4540cb8ec960971bcf6aa5a9480)

Signed-off-by: Sundeep KOKKONDA <sundeep.kokkonda@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-05-21 22:20:54 +01:00
Khem Raj
b0d6bb477d libstd-rs: Forward port rust libc patches
libstd-rs update also updated the vendored libc to 0.2.116, the rv64
musl patches were applied to 0.2.112 and hence needed forward porting
done with this changeset.

(From OE-Core rev: e3a910af0c0c4e07b15d03e9625760f98c67e874)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-05-13 17:56:29 +01:00
Pgowda
0bd0012264 rust: update 1.59.0 -> 1.60.0
Rust has been upgraded to rust-1.60.0 that uses LLVM 14.

Please refer the following link for more detailed features.
https://blog.rust-lang.org/2022/04/07/Rust-1.60.0.html
https://github.com/rust-lang/rust/blob/master/RELEASES.md

(From OE-Core rev: 786a9a66486cf179ee4c9e295569fcd8c37fef78)

Signed-off-by: pgowda <pgowda.cve@gmail.com>
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-04-27 23:30:11 +01:00
Richard Purdie
0bf2fd1627 Revert "meta: rust: Bug fix for target definitions returning 'NoneType'"
This reverts commit ef49f89c89889466ee3696ab680f8e10c961a677.

This appears to cause build failures which didn't originally show up in
testing, reverting for now.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-04-05 17:41:09 +01:00
Sundeep KOKKONDA
e4c16d1112 meta: rust: Bug fix for target definitions returning 'NoneType'
The build shows below error while building for arm machines.
Exception: TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'
Detailed error info : https://lists.openembedded.org/g/openembedded-core/message/164004

All the target definitions within tspec dictionary are generted as
NoneType. The changes will fix this issue.

(From OE-Core rev: ef49f89c89889466ee3696ab680f8e10c961a677)

Signed-off-by: Sundeep KOKKONDA <sundeep.kokkonda@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-04-05 10:49:36 +01:00
Christian Eggers
025c49b3cf rust-crosssdk: use ${RUST_LIBC} in ${PN}
TCLIBC is only valid for TARGET, not for HOST or NATIVESDK.
Fixes build of rust-crosssdk if TCLIBC is set to musl.

(From OE-Core rev: c0b353d19d4cd796e5e63c6bec72962854fe81f4)

Signed-off-by: Christian Eggers <ceggers@arri.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-03-26 09:33:32 +00:00
Richard Purdie
da0cb26c00 rust-cross: Add rust-crosssdk variant for nativesdk use
Allow nativesdk recipes to find a correct version of the rust cross
compiler.

(From OE-Core rev: 0f5d26772abfbbae9096fa43901d8620f76aea3c)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-03-17 16:44:33 +00:00
Richard Purdie
b792bcd602 libstd-rs: Extend to nativesdk
This is needed to add the rust standard library to SDKs for use
by SDK tools.

(From OE-Core rev: 060057fa94451586e4eb47f68bc5c7c796f7d337)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-03-17 16:44:33 +00:00
Khem Raj
72b534fe61 libstd-rs: Fix build on riscv64/musl
Backport necessary patch, which was dropped in upgrade to 1.59

Fixes:

error[E0425]: cannot find value `SYS_clone3` in this scope
   --> library/std/src/sys/unix/weak.rs:202:17
    |
202 |                   concat_idents!(SYS_, $name),
    |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: a constant with a similar name exists: `SYS_clone`
    |
   ::: library/std/src/sys/unix/process/process_unix.rs:165:9
    |
165 | /         raw_syscall! {
166 | |             fn clone3(cl_args: *mut clone_args, len: libc::size_t) -> libc::c_long
167 | |         }
    | |_________- in this macro invocation
    |

(From OE-Core rev: f529401cd8d2c45273f706636e5ed89123238200)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-03-15 08:40:09 +00:00