<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/poky.git/meta/classes/rust-common.bbclass, branch master-uninative</title>
<subtitle>Mirror of git.yoctoproject.org/poky</subtitle>
<id>https://git.enea.com/cgit/linux/poky.git/atom?h=master-uninative</id>
<link rel='self' href='https://git.enea.com/cgit/linux/poky.git/atom?h=master-uninative'/>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/'/>
<updated>2022-03-26T09:33:32+00:00</updated>
<entry>
<title>rust-common: override RUST_LIBC for crosssdk</title>
<updated>2022-03-26T09:33:32+00:00</updated>
<author>
<name>Christian Eggers</name>
<email>ceggers@arri.de</email>
</author>
<published>2022-03-25T06:52:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=ccef909c5614595ad42ddeb8dab53d1e40356bae'/>
<id>urn:sha1:ccef909c5614595ad42ddeb8dab53d1e40356bae</id>
<content type='text'>
For nativesdk/crosssdk, always glibc is used. Fixes build of
rust-crosssdk if TCLIBC is set to musl.

(From OE-Core rev: 67b4e0fdb13c81ab7e79109b6366fd7705b253ba)

Signed-off-by: Christian Eggers &lt;ceggers@arri.de&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>rust: Introduce RUST_BUILD_ARCH</title>
<updated>2022-03-02T18:44:17+00:00</updated>
<author>
<name>Andrew Jeffery</name>
<email>andrew@aj.id.au</email>
</author>
<published>2022-02-28T14:39:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=73272156e66a33dad4f00a2badc4306aaac400f6'/>
<id>urn:sha1:73272156e66a33dad4f00a2badc4306aaac400f6</id>
<content type='text'>
RUST_BUILD_ARCH contains the arch_to_rust_arch()-translated value of
BUILD_ARCH. This is necessary to acquire the correct snapshot artifacts
under Linux where `uname -m` reports "ppc64le" rather than
"powerpc64le".

Change-Id: I6aec23aced8e1c6f0bfc46fe52531b0c16bcf687
(From OE-Core rev: c13afbade8d480807b9de70c56dcd650496f06b2)

Signed-off-by: Andrew Jeffery &lt;andrew@aj.id.au&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>rust: Introduce arch_to_rust_arch()</title>
<updated>2022-03-02T18:44:17+00:00</updated>
<author>
<name>Andrew Jeffery</name>
<email>andrew@aj.id.au</email>
</author>
<published>2022-02-28T14:39:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=102e4c029e30aba78e4045ae06115096870f036f'/>
<id>urn:sha1:102e4c029e30aba78e4045ae06115096870f036f</id>
<content type='text'>
On modern Power systems `uname -m` yields 'ppc64le' while the toolchain
knows the architecture as 'powerpc64le'. Provide a mapping from one to
the other to integrate with the existing architecture configuration
flags.

arch_to_rust_arch() only exists to map the OE *_ARCH variables before
any further processing, unlike arch_to_rust_target_arch() which is
specific to the internal triple handling of rust.

On Linux ppc64le systems the changes give the following config:

```
$ cat ./tmp/work/ppc64le-linux/rust-native/1.58.0-r0/targets/ppc64le-linux.json
{
    "llvm-target": "powerpc64le-unknown-linux-gnu",
    "data-layout": "e-m:e-i64:64-n32:64-v256:256:256-v512:512:512",
    "max-atomic-width": 64,
    "target-pointer-width": "64",
    "target-c-int-width": "64",
    "target-endian": "little",
    "arch": "powerpc64",
    "os": "linux",
    "env": "gnu",
    "vendor": "unknown",
    "target-family": "unix",
    "linker": "gcc",
    "cpu": "generic",
    "dynamic-linking": true,
    "executables": true,
    "linker-is-gnu": true,
    "linker-flavor": "gcc",
    "has-rpath": true,
    "has-elf-tls": true,
    "position-independent-executables": true,
    "panic-strategy": "unwind"
}
```

Change-Id: Ief0c01189185d7d4da31d307270bec4e1de674ca
(From OE-Core rev: 9ab61e3cfef0157393cb870d606c2f362e190889)

Signed-off-by: Andrew Jeffery &lt;andrew@aj.id.au&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>rust-common.bbclass: rewrite toolchain wrappers in (native) python</title>
<updated>2021-10-14T10:48:45+00:00</updated>
<author>
<name>Alexander Kanavin</name>
<email>alex.kanavin@gmail.com</email>
</author>
<published>2021-10-10T19:10:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=4abd6ee9d480437010e589ce215e20b835d3dad4'/>
<id>urn:sha1:4abd6ee9d480437010e589ce215e20b835d3dad4</id>
<content type='text'>
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.

(From OE-Core rev: 997d54363a3cb3a0e949b3626855f2fa41afeb2b)

Signed-off-by: Alexander Kanavin &lt;alex@linutronix.de&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>rust-common.bbclass: make sure ccache exist</title>
<updated>2021-09-19T10:33:14+00:00</updated>
<author>
<name>Kai Kang</name>
<email>kai.kang@windriver.com</email>
</author>
<published>2021-09-17T13:14:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=a0a9df0e8b5f62e69b65fa9f7129ac0954a45691'/>
<id>urn:sha1:a0a9df0e8b5f62e69b65fa9f7129ac0954a45691</id>
<content type='text'>
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.

(From OE-Core rev: 46575e0d5b9e722558b64e22ed928e6d7b2c654a)

Signed-off-by: Kai Kang &lt;kai.kang@windriver.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>rust-common: Hack around LD_LIBRARY_PATH issues on centos7</title>
<updated>2021-09-02T20:22:54+00:00</updated>
<author>
<name>Richard Purdie</name>
<email>richard.purdie@linuxfoundation.org</email>
</author>
<published>2021-09-01T14:28:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=63b1fd2226b5f146d6c853cc57417704df378438'/>
<id>urn:sha1:63b1fd2226b5f146d6c853cc57417704df378438</id>
<content type='text'>
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).

(From OE-Core rev: 8feeeb7f76c6725e5226458c8f22999b67c52694)

Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>rust-common.bbclass: export RUST_TARGET_PATH</title>
<updated>2021-09-01T13:06:17+00:00</updated>
<author>
<name>Tim Orling</name>
<email>ticotimo@gmail.com</email>
</author>
<published>2021-08-27T15:05:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=2226d3db15837f82dc617ed669ba329dc7abde31'/>
<id>urn:sha1:2226d3db15837f82dc617ed669ba329dc7abde31</id>
<content type='text'>
Running 'rustc --print &lt;foo&gt;' in -c devshell environment
the target specifications are not known, unless the
RUST_TARGET_PATH (absolute path to rustlib/) is defined.

(From OE-Core rev: 6d0603ffe18c1a5999db854abb668b05aff47f67)

Signed-off-by: Tim Orling &lt;timothy.t.orling@intel.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>rust-common: Add LDFLAGS to cc wrapper</title>
<updated>2021-08-26T21:09:44+00:00</updated>
<author>
<name>Richard Purdie</name>
<email>richard.purdie@linuxfoundation.org</email>
</author>
<published>2021-08-25T16:30:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=b7fc3113a7126121a9768549e3a839bbcb64fb71'/>
<id>urn:sha1:b7fc3113a7126121a9768549e3a839bbcb64fb71</id>
<content type='text'>
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).

(From OE-Core rev: 62242e83c49b81a9ea65c9a1f5957a7c309d910a)

Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>rust-cross*: Fix OVERRRIDE references in task signature computation</title>
<updated>2021-08-26T21:09:44+00:00</updated>
<author>
<name>Richard Purdie</name>
<email>richard.purdie@linuxfoundation.org</email>
</author>
<published>2021-08-21T21:36:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=857cf2d7b39f7e6f0445fea6a591dd27061142ea'/>
<id>urn:sha1:857cf2d7b39f7e6f0445fea6a591dd27061142ea</id>
<content type='text'>
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.&lt;sig&gt;

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

(From OE-Core rev: 72d67410e92207a98a801ddf0cb9f1297a752975)

Signed-off-by: Randy MacLeod &lt;Randy.MacLeod@windriver.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>rust: initial merge of most of meta-rust</title>
<updated>2021-08-26T21:09:43+00:00</updated>
<author>
<name>Randy MacLeod</name>
<email>Randy.MacLeod@windriver.com</email>
</author>
<published>2021-08-10T17:52:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=61e1570c6a09c1984e919e8c0a82a74c1a08d821'/>
<id>urn:sha1:61e1570c6a09c1984e919e8c0a82a74c1a08d821</id>
<content type='text'>
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

(From OE-Core rev: 3ed57578cca93ff1ba4e0bf3f25566e10659a2f9)

Signed-off-by: Randy MacLeod &lt;Randy.MacLeod@windriver.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
</feed>
