Commit Graph

7622 Commits

Author SHA1 Message Date
Ross Burton
de5aac2a0b rm_work: handle non-existant stamps directory
Since 'build/siggen: Rework stamps functions'[1] the stamps directory
for each recipe is only created if there are stamps to be written. Some
recipes - such as package-index - only have nostamp tasks so the stamps
directory is never created, resulting in the rm_work task trying to cd
into a directory that doesn't exist.

Resolve this by simply checking the stamps directory exists before
trying to delete files in it.

[1] bitbake c79ecec580e4c2a141ae483ec0f6448f70593dcf

(From OE-Core rev: 80e9b32a000b25420997068543d3631231eb3ccf)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-01-06 12:03:47 +00:00
Luis
4e75ed32a0 rm_work.bbclass: use HOSTTOOLS 'rm' binary exclusively
The do_rm_work() task is using the first available 'rm' binary
available in PATH to remove files and folders.
However, depending on the PATH setup and RECIPE_SYSROOT_NATIVE
contents, the function can be using the 'rm' binary available
in RECIPE_SYSROOT_NATIVE, a folder that will get removed.
This causes a sporadic race-condition when trying to access the
'rm' binary of a folder already deleted.
Solve this by exclusively using the HOSTTOOLS 'rm' binary, as
this folder will not get removed.

(From OE-Core rev: edcd9ad333bc4e504594e8af83e8cb7007d2e35c)

Signed-off-by: Luis Martins <luis.pinto.martins@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-12-26 18:49:07 +00:00
Peter Marko
f4d5ffd4d8 externalsrc: fix lookup for .gitmodules
Commit 0533edac27 broke
bitbake parsing when bitbake is executed from directory with existing .gitmodules
and the recipe in externalsrc does not have .gitmodules

The check needs to search for .gitmodules in sources path, not cwd.

iParsing recipes...ERROR: ExpansionError during parsing <path to recipe>
...
bb.data_smart.ExpansionError: Failure expanding variable do_compile[file-checksums], expression was ${@srctree_hash_files(d)} which triggered exception CalledProcessError: Command '['git', 'config', '--file', '.gitmodules', '--get-regexp', 'path']' returned non-zero exit status 1.

(From OE-Core rev: 66ff3d1f65cd2e7f5319e98fa41f47a59b714c72)

Signed-off-by: Peter Marko <peter.marko@siemens.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-12-08 10:48:36 +00:00
Chen Qi
5bab8d0318 rm_work: adjust dependency to make do_rm_work_all depend on do_rm_work
For now, if we use rm_work and `bitbake core-image-minimal', some
recipes' WORKDIRs are not cleaned up, e.g., makedevs-native.

Adjust the dependency to make do_rm_work_all depend on do_rm_work
to solve this problem.

Below are the detailed explanation of why this would work.

Without this patch, the dependency chain is like:
[other deps] -> [do_rm_work] -+-> [do_build]
                              |
[do_rm_work_all] -------------+

With this patch, the depedency chain is like:
[other deps] -> [do_rm_work] -> [do_rm_work_all] -> [do_build]

Such dependency chain adjustment fixes the issue because do_rm_work_all
now depends on [other deps] and thus the [depends] of these [other deps].
Take core-image-minimal as an example. Before this adjustment,
do_rm_work_all does not have any relationship with do_rootfs, and we have
do_rootfs[depends] += "makedevs-native:do_populate_sysroot ..."
This essentially prevents 'recrdeptask' setting of do_rm_work_all extend
to makedevs-native. With this patch, the do_rm_work_all now depends
on do_rm_work which in turn depends on do_rootfs, and so do_rm_work_all's
recrdeptask could have effect on makedevs-native.

With this patch, all built recipes WORKDIR will be cleaned up with
a few expected exceptions such as kernel and qemu-helper-native.

(From OE-Core rev: b25cc45c9b39f79ba0a03c4556cb2e2431677b4e)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-12-08 10:48:36 +00:00
Jose Quaresma
0f9773ee71 rm_work: exclude the SSTATETASKS from the rm_work tasks sinature
We can exclude the SSTATETASKS from the rm_work task signature
to avoid running the task when we remove some setscene tasks
from the dependencie chain.

The inject_rm_work handler on the rm_work bbclass triggers the
rm_work task running for any signature change in the dependencie
chain of the task do_build of each recipe.

i.e INHERIT:remove = "create-spdx" will trigger the do_rm_work
when we collect the sstate cache with INHERIT = "create-spdx"

(From OE-Core rev: 77729bea5b17d65dafb604fd1665c612091b28c7)

Signed-off-by: Jose Quaresma <jose.quaresma@foundries.io>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-11-14 16:19:43 +00:00
Ross Burton
c3ad780328 classes/testexport: move to classes-recipe
This class should be in classes-recipe as, like testimage, it is specific
to image recipes.

This also solves a regression where simply IMAGE_CLASSES += "testexport"
doesn't work if testimage isn't already in IMAGE_CLASSES. The testexport
class adds testimage to IMAGE_CLASSES, but by this point it's too late.
Now that the class can only be inherited via IMAGE_CLASSES, we can
simply inherit testimage directly.

(From OE-Core rev: 87fcee9fed915ff3af528b976d7d44737f9f1a95)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-11-11 13:43:40 +00:00
Konrad Weihmann
f260b28802 create-spdx: default share_src for shared sources
if a source is using work-shared but isn't a kernel,
like for instance llvm-source from meta-clang, share_src was
previously undefined leading to a crash of the python code.
Default to WORKDIR and just override it in case the source being
a kernel recipe.
Additionally changes the variable names in the following, as
they imply that it's only about the kernel, which is not the case
in every case

(From OE-Core rev: 34fa68a0b07328c4ed4eef81f8cde80137a91f18)

Signed-off-by: Konrad Weihmann <kweihmann@witekio.com>
On-behalf-of: Avnet Embedded <AvnetEmbedded@avnet.eu>
Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Reviewed-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-11-11 13:43:40 +00:00
Joshua Watt
0269174425 classes: create-spdx: Move to version specific class
In expectation of SPDX 3.0 support, move the create-spdx.bbclass ->
create-spdx-2.2.bbclass. The create-spdx.bbclass class still exists and
can be used if a user doesn't care about which specific version of SPDX
they get.

(From OE-Core rev: 9ec01fe3e59be66331c14ab5391ecb0b6f140c22)

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-11-11 13:43:40 +00:00
Jose Quaresma
cd2f92ceea archiver: avoid using machine variable as it breaks multiconfig
STAGING_KERNEL_DIR uses the MACHINE name so it breaks the multiconfig
and in this cases it will run the shared recipes twice, one for each
machine.

STAGING_KERNEL_DIR it's been introduced in commit 5487dee2e1

(From OE-Core rev: 6050d1f74c02495490d982ead2993b6b3c9cc04a)

Signed-off-by: Jose Quaresma <jose.quaresma@foundries.io>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-11-02 11:04:32 +00:00
Michael Opdenacker
65e3e1917e create-spdx.bbclass: remove unused SPDX_INCLUDE_PACKAGED
[YOCTO #14948]

(From OE-Core rev: 89f1abd5e00807cf179ddf658f74d48119523b0c)

Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-10-29 16:28:36 +01:00
Peter Kjellerstedt
b3ffb247c7 externalsrc.bbclass: Remove a trailing slash from ${B}
The trailing slash in ${B} caused -fdebug-prefix-map=${B}=... to not
match as intended, resulting in ${TMPDIR} ending up in files in
${PN}-dbg when externalsrc was in use, which in turn triggered buildpath
QA warnings.

(From OE-Core rev: 9b5031ed5a0d102905fa75acc418246c23df6eef)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-10-26 12:28:39 +01:00
Martin Jansa
9ba58ee035 externalsrc.bbclass: fix git repo detection
* fix issue introduced in:
  https://git.openembedded.org/openembedded-core/commit/?id=95fbac8dcad6c93f4c9737e9fe13e92ab6befa09

* it added check for s_dir + git-dir (typically '.git') isn't
  the same as ${TOPDIR} + git-dir, but due to copy-paste issue
  it was just comparing it with s_dir + git-dir again, resulting
  in most external repos (where git-dir is '.git') to be processed
  as regular directory (not taking advantage of git write-tree).

* normally this wouldn't be an issue, but for big repo with a lot of
  files this added a lot of checksums in:
  d.setVarFlag('do_compile', 'file-checksums', '${@srctree_hash_files(d)}')

  and I mean *a lot, e.g. in chromium build it was 380227 paths
  which still wouldn't that bad, but the checksum processing in
  siggen.py isn't trivial and just looping through all these
  checksums takes very long time (over 1000sec on fast NVME drive
  with warm cache) and then
  https://git.openembedded.org/bitbake/commit/?id=b4975d2ecf615ac4c240808fbc5a3f879a93846b
  made the processing a bit more complicated and the loop in
  get_taskhash() function took 6448sec and to make things worse
  there was no output from bitbake during that time, so even with -DDD
  it looks like this:

  DEBUG: virtual/libgles2 resolved to: mesa (langdale/oe-core/meta/recipes-graphics/mesa/mesa_22.2.0.bb)
  Bitbake still alive (no events for 600s). Active tasks:
  Bitbake still alive (no events for 1200s). Active tasks:
  Bitbake still alive (no events for 1800s). Active tasks:
  Bitbake still alive (no events for 2400s). Active tasks:
  Bitbake still alive (no events for 3000s). Active tasks:
  Bitbake still alive (no events for 3600s). Active tasks:
  Bitbake still alive (no events for 4200s). Active tasks:
  Bitbake still alive (no events for 4800s). Active tasks:
  Bitbake still alive (no events for 5400s). Active tasks:
  Bitbake still alive (no events for 6000s). Active tasks:
  DEBUG: Starting bitbake-worker

  without -DDD it will get stuck for almost 2 hours in:
  "Initialising tasks..."
  before it finally writes sstate summary like:
  "Sstate summary: Wanted 3102 Local 0 Mirrors 0 Missed 3102 Current 1483 (0% match, 32% complete)"

* fix the copy&paste typo to use git work-tree in most cases, but
  be aware that this issue still exists for huge local source
  trees not in git

[YOCTO #14942]

(From OE-Core rev: 9102e5a94b8146cb1da27afbe41d3db999a914ff)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-10-26 12:28:39 +01:00
Keiya Nobuta
e33892b7ad create-spdx: Remove ";name=..." for downloadLocation
(From OE-Core rev: bbecab53d1b27f3bb8c5882cb0ec39b04ef300a3)

Signed-off-by: Keiya Nobuta <nobuta.keiya@fujitsu.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-10-26 12:28:39 +01:00
Adrian Freihofer
988a27974f own-mirrors: add crate
Support downloading crate files from a mirror at SOURCE_MIRROR_URL.

(From OE-Core rev: aebf4f183267a1e2f073078ade0ddc916ceed53f)

Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com>
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-10-25 13:42:03 +01:00
Ross Burton
378f67bd82 externalsrc: move back to classes
The externalsrc class was moved to classes-recipe as part of oe-core
f5c1280, but it can be used in both recipe and global contexts so move
it back to classes/.

(From OE-Core rev: 7a2edcd4b7cb5a2d829289a11eff62663268fbf3)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-10-25 13:42:02 +01:00
Ulrich Ölmann
c1c356a9fc icecc.bbclass: fix filename of recipe in comment
The character '%' is not a valid part of a recipe filename and has been used
here only to suggest a wildcard regarding the recipe's version, see reply [1] in
a companioned thread. Correct that by using the current recipe version instead.

[1] https://lists.yoctoproject.org/g/docs/message/3165

(From OE-Core rev: cf8835b53cb5ce3ff13f97fcf2d22b97a9f1ede4)

Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-09-17 07:47:07 +01:00
Vyacheslav Yurkov
e38ef4dcf1 classes: Update overlayfs classes to use new bitbake functionality
OverlayFS classes belong to a recipe scope

(From OE-Core rev: 7afa7739e82220729566ccabe2675a8991f9485a)

Signed-off-by: Vyacheslav Yurkov <v.yurkov@precitec.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-09-09 12:24:43 +01:00
Ulrich Ölmann
3d3f0cd09d icecc.bbclass: delete 'rm' command
The removed command was explicitly marked as transitional in commit [1] roughly
three years ago, so finally clean up.

[1] 40d74cb1d0dd ("icecc: Export ICECC_CC and friends via wrapper-script")

(From OE-Core rev: 4459e970c7c1c43f4061b1cb6229d7a3643e1bbc)

Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-09-07 21:28:41 +01:00
Ulrich Ölmann
35b3d0037f icecc.bbclass: fix typos
(From OE-Core rev: 7fd33565df5dfaa962bcafd842162a2f504c59e7)

Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-09-07 21:28:41 +01:00
Ross Burton
3cca59a9bc cve-check: close cursors as soon as possible
We can have multiple processes reading the database at the same time, and
cursors only release their locks when they're garbage collected.

This might be the cause of random sqlite errors on the autobuilder, so
explicitly close the cursors when we're done with them.

(From OE-Core rev: 5d2e90e4a58217a943ec21140bc2ecdd4357a98a)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-09-02 15:58:25 +01:00
Joshua Watt
a19e278f2e classes: cve-check: Get shared database lock
The CVE check database needs to have a shared lock acquired on it before
it is accessed. This to prevent cve-update-db-native from deleting the
database file out from underneath it.

[YOCTO #14899]

(From OE-Core rev: 20a9911b73df62a0d0d1884e57085f13ac5016dd)

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-08-31 10:40:07 +01:00
Richard Purdie
5127df17c0 distrooverrides: Move back to classes whilst it's usage is clarified
(From OE-Core rev: eb56f89a9b2163bdb8c91dbdc33696fea052d032)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-08-18 10:38:48 +01:00
Peter Marko
a9e80e935c create-spdx: handle links to inaccessible locations
When a link is pointing to location inaccessible to build user (e.g. "/root/something"),
filepath.is_file() throws "PermissionError: [Errno 13] Permission denied".
Fix this by first checking if it is a link.

(From OE-Core rev: e105befbe4ee0d85e94c2048a744f0373e2dbcdf)

Signed-off-by: Peter Marko <peter.marko@siemens.com>
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
Jose Quaresma
39197039e9 archiver.bbclass: some recipes that uses the kernelsrc bbclass uses the shared source
This fix a race that happens when building some of the followning recipes
with kernel at same time.

The kernelsrc uses the kernel shared source dir as their source
S = "${STAGING_KERNEL_DIR}" and this will cause a race in the
do_unpack_and_patch task, when bitbake runs the
bb.build.exec_func('do_unpack', d) because do_unpack will
clean the source dir on startup.

| ok: note that S != "${STAGING_KERNEL_DIR} for this ones
openembedded-core/meta/recipes-kernel/perf/perf.bb:inherit kernelsrc
meta-openembedded/meta-oe/recipes-kernel/usbip-tools/usbip-tools.bb:inherit kernelsrc autotools-brokensep

| broken
meta-openembedded/meta-oe/recipes-kernel/cpupower/cpupower.bb:inherit kernelsrc kernel-arch bash-completion
meta-openembedded/meta-oe/recipes-kernel/spidev-test/spidev-test.bb:inherit bash-completion kernelsrc kernel-arch
meta-openembedded/meta-oe/recipes-kernel/intel-speed-select/intel-speed-select.bb:inherit kernelsrc
meta-openembedded/meta-oe/recipes-kernel/bpftool/bpftool.bb:inherit bash-completion kernelsrc kernel-arch

The issue can be replicated with:

INHERIT += "archiver"
ARCHIVER_MODE[src] = "original"
ARCHIVER_MODE[diff] = "1"

And:

R=<recipe> bitbake -c cleansstate virtual/kernel $R && bitbake $R

(From OE-Core rev: 5487dee2e1237fb57c5e59b2bbbfbcdfc8c97ab6)

Signed-off-by: Jose Quaresma <jose.quaresma@foundries.io>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-08-12 15:46:49 +01:00
Richard Purdie
fd1517e2b5 classes: Update classes to match new bitbake class scope functionality
Move classes to classes-global or classes-recipe as appropriate to take
advantage of new bitbake functionality to check class scope/usage.

(From OE-Core rev: f5c128008365e141082c129417eb72d2751e8045)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-08-12 15:27:17 +01:00
Richard Purdie
10317912ee insane: Update to allow for class layout changes
Make the code more generic to allow for the potential incomming class
layout changes.

(From OE-Core rev: 7c6c717a54423480c0ac9ed13861e3c1cc47e2b2)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-08-12 15:27:17 +01:00
Richard Purdie
ff525695f2 classes: Add SPDX license identifiers
As stated in our top level license files, the license is MIT unless
otherwise stated. Add SPDX identifers accordingly. Replace older
license statementa with the standardised syntax. Also drop "All
Rights Reserved" expression as it isn't used now, doesn't mean anything
and is confusing.

(From OE-Core rev: 081a391fe09a21265881e39a2a496e4e10b4f80b)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-08-12 11:58:01 +01:00
Richard Purdie
971d5f7b81 classes: Add copyright statements to files without one
Where there isn't a copyright statement, add one to make it explicit.
Also drop editor config lines where they were present.

(From OE-Core rev: 880c1ea3edc8edef974e65b2d424fc36809ea034)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-08-12 11:58:01 +01:00
Richard Purdie
f14e3f3a31 testexport: Use IMAGE_CLASSES for testimage
(From OE-Core rev: 506346e1c98619eb04a196d80f032d71677dd2a2)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-08-12 11:46:26 +01:00
Richard Purdie
e8de01e798 testexport: Fix to work as an image class
The class is mainly an image based class but one recipe does need to look
at values shared with the class and isn't an image. Move this to a conf
file instead, avoiding the need to pollute all recipes globally.

(From OE-Core rev: ed4238487c81b3580e83c257b50745a832a6e717)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-08-12 11:46:26 +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
883aea9b6e buildhistory: Only use image-artifact-names as an image class
The class only makes sense in the conext of images, not globally so
include as such.

(From OE-Core rev: 4fdda4d6bd434c240ec1dfdbfc6eb7e25e2db1f3)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-08-12 11:46:26 +01:00
Richard Purdie
3c1ed4a7da rust-common: Remove conflict with utils create_wrapper
utils already has a create_wrapper function which I tried to use from cargo
and got unexpected results. Rename the rust function to avoid this conflict
of named.

(From OE-Core rev: ef347bd395955ce68893fee7995a4f3abbe6ff93)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-08-09 16:37:24 +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
1b7b5c3759 rust-common: Set rustlibdir to match target expectation
(From OE-Core rev: 06af65757b7694df983b3f99cec75e4e9bec0725)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-08-08 15:44:20 +01:00
Richard Purdie
cdd65a42a8 rust-common: Simplify libc handling
The current libc handling code is simply wrong in many cases. Simplify it
to a check of the triplet for musl handling which is much simpler and less
error prone when handling things like nativesdk targets.

(From OE-Core rev: f35d5af06db10fa20e55f4c738e665b35f5c394b)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-08-08 15:44:20 +01:00
Richard Purdie
0b374dc724 rust-target-config: Make target workaround generic
Ensure the 'target' data is set for both HOST and TARGET queries
as appropriate to work correctly in cross configurations.

(From OE-Core rev: ec15882fbf396de8d3a5921a3028850ba3fccc48)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-08-08 15:44:20 +01:00
Richard Purdie
d172b76c26 rust-common: Update to match cross targets
Tweak the armv7 workaround to work for cross environments and as a host
triplet and not just as a target.

(From OE-Core rev: dc134c031171a55a35964ba801219552a516a0ca)

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
9a093d0348 rust-target-config: Show clear error when target isn't defined
(From OE-Core rev: b30ee171de9cd736d16d783410cf748e35309257)

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
b2ffb96705 rust-common: Rework wrappers to handle musl
For musl we need to be able to add a library to the end of the linker commandline.
Rework the wrapper code to be able to do this through a new variable.

(From OE-Core rev: dfff5a176765c0e8b212bf31081f80e79025fd1b)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-08-08 15:44:20 +01:00
Richard Purdie
ae3950ec5a rust-common: Drop export directive from wrappers
These variables don't need to be exported into the environment, which reduces
the scope of rebuilds when variable values change.

(From OE-Core rev: 1a992268e556a79daa6802367f48796000a1f436)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-08-08 15:44:20 +01:00
Richard Purdie
d183c36c81 rust-common: Add CXXFLAGS
Similarly to CC and CCLD, handle CXX flags too.

(From OE-Core rev: e2fc083529d526cb565a2de1917022d10c7d08b8)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-08-08 15:44:20 +01:00
Richard Purdie
52ef977c95 rust-target-config: Add mips n32 target information
Add MIPS n32 target information. This appears to be correct but
building libstd-rs for the target doesn't work.

(From OE-Core rev: 255be90dc8e3625060c9b8ccc2ec3a71f24470d2)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-08-08 15:44:20 +01:00
Richard Purdie
f2bd326370 populate_sdk_base: Disable rust SDK for MIPS n32
The n32 MIPS rust SDK doesn't quite build (libstd-rs fails with an llvm
register issue). Disable it for now, someone with interest in having it working
can fix if/as/when.

(From OE-Core rev: aad10f24eea5a6b54de17138ab5c0f4ed1355a8f)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-08-08 15:44:20 +01:00
Richard Purdie
7f902fb29f nativesdk: Clear TUNE_FEATURES
Similarly to what native.bbclass does, clear TUNE_FEATURES since these
aren't appropriate to the nativesdk build. This saves us having to change
down signature issues due to data in this variable.

(From OE-Core rev: 2e5079e434504a3a22b609f7ddbb7f4c533c4cdb)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-08-08 15:44:20 +01:00
Chen Qi
fc59c28724 image_types_wic.bbclass: fix cross binutils dependency
Enable multilib and wic at the same time and we'll meet the
following error.

  ERROR: Nothing PROVIDES 'virtual/i686-wrsmllib32-linux-binutils'

Adjust the dependency to take multilib into consideration.

(From OE-Core rev: 958ee0eede859bdba659e3343856b1c226207854)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-08-04 21:53:50 +01:00