25 Commits

Author SHA1 Message Date
Martin 'JaMa' Jansa
bf6705fb7f Convert to new override syntax (#357)
* Convert to new override syntax

This is the result of automated script (0.9.0) conversion:

oe-core/scripts/contrib/convert-overrides.py .

converting the metadata to use ":" as the override character instead of "_".

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>

* Manually fix the conversion

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>

* layer.conf: Update layer compatibility with only dunfell and newer.

Add honister to mark the layers as compatible with honister now that it uses
the new override syntax.

Drop zeus and older which are missing a support for newer override syntax which
was backported only to 1.46 branch (used by dunfell) and newer, e.g.:
https://git.openembedded.org/bitbake/commit/?h=1.46&id=c5418eae56cc50dbae7951c055434a0c456c53a4

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>

* CI: use YOCTO_BRANCH instead of yocto-${YOCTO_VERSION} for poky checkout

* using latest revision in branch is often better than sticking to
  some point releases

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>

* CI: switch to hardknott branch

* gatesgarth is already EOL, better to use something supported

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
2021-08-05 17:37:51 -04:00
Khem Raj
7afffa083c rust-bin.bbclass: Do not use append and += together
this is undefined behavior in bitbake, prepend space instead

Signed-off-by: Khem Raj <raj.khem@gmail.com>
2020-11-14 08:56:18 -08:00
Steven Walter
c60b799c11 Allow native variants of rust recipes to build 2017-11-02 16:41:58 -04:00
Tyler Hall
463622c0c6 rust-bin: use linker to set rpath
Patchelf should be reserved for when the ELF cannot be generated
correctly in the first place. This is not the case here because we have
control over the linker flags. The limitation is that -C link-args can
only be specified once, so consolidate the generation of link-args. Also
introduce some new intermediate variables in link-args generation for
customization.

Patchelf was running only in ${PKGD} because patching the ELF in ${D}
would cause objcopy to fail when splitting the debug sections. This is
not a problem when setting it correctly in the linker. The benefit is
that the rpath is correct in the sysroot as well.

This also switches the rpaths to be relative so that they work in both
the sysroot and the target in the same way.

Signed-off-by: Tyler Hall <tyler.hall@lexmark.com>
Signed-off-by: Steven Walter <swalter@lexmark.com>
2017-11-02 16:41:58 -04:00
Tyler Hall
172a226259 rust-bin: use linker wrapper
Commit 864fe95 ("classes: create proper compiler and linker wrappers")
introduced wrapper scripts for the OE toolchain. Specifying the sysroot
manually ceased to function in rust-bin, so use the wrapper where rustc
is called directly.

This should be more reliable than trying to repeat what OE puts in the
$CC variable.
2017-11-02 16:41:58 -04:00
Tyler Hall
c83864ce19 rust-bin: get RUST_TARGET_PATH from rust-common
Since commit 06a138a ("rust: drop custom target finding patch"), rustc
is no longer self-sufficient in finding its target specifications. Any
usage of rustc needs RUST_TARGET_PATH set in the environment.

Move the declaration to rust-common.bbclass and add the export to
rust-bin where rustc is invoked.
2017-11-02 16:41:58 -04:00
Steven Walter
1eb86e935c rust-bin: fix recent breakage
The crate_hash flag is no longer accepted on rust 1.14.  Additionally,
due to the use of wrapper scripts by cargo, we were no longer able to
link correctly due to some link flags getting dropped.  Fix that as well
2017-02-02 10:02:11 -05:00
Derek Straka
52c0f97ff6 getVar will expand by default, so the 'True' option is no longer required
Signed-off-by: Derek Straka <derek@asterius.io>
2016-12-06 16:08:41 -05:00
Doug Goldstein
1f18869377 workaround bug in the -C crate_hash option
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.
2016-12-06 11:08:46 -06:00
Doug Goldstein
0827bc626b rust/rust-bin: move bits to rust-bin
Bits that are only used by the rust-bin bbclass should get moved there.
They aren't used by any recipe that includes the rust bbclass.
2016-11-23 11:25:57 -06:00
Tyler Hall
27ff9aea20 Move rust-bin fixups to rust.bbclass
This post-processing will need to be shared between rust-bin and
cargo-based recipes.

Signed-off-by: Tyler Hall <tylerwhall@gmail.com>
2016-07-11 15:14:57 -04:00
Tyler Hall
1f17e68d1e Move basic variables from rust-bin to rust class
rust-bin.bbclass now only contains what is necessary to build crates
using the rust compiler directly and rust.bbclass contains information
shared between rust-bin and cargo.

Signed-off-by: Tyler Hall <tylerwhall@gmail.com>
2016-07-11 15:14:53 -04:00
Steven Walter
a74985c341 rust-bin.bbclass: allow to opt-out of prefer-dynamic
prefer-dynamic makes sense in many cases, but we needn't force recipes
to use it all the time.
2016-05-05 21:56:19 -04:00
Derek Straka
78e51cd7f4 Address parse errors while using getVar to calculate dependency information 2016-02-18 13:24:43 -05:00
Tyler Hall
aaaeaeed3f rustlib: libdir may be different between build and host
With multilib, we may want to install under lib64 but the rust libraries
get published in the build sysroot under the libdir for the build
machine which is usually just lib. Support these being different.
2016-02-02 11:40:25 -05:00
Wes Lindauer
45d77b849f rust-bin.bbclass: Add empty do_configure
This prevents rust recipes that are missing clean rules from failing
when they are rebuilt.
2016-02-01 16:36:52 -05:00
Steven Walter
ebe7fb0d8f rust-bin.bbclass: look for RUNPATH instead of RPATH
Poky 1.7 uses RPATH is now RUNPATH, so update our grep string appropriately.

Additionally, bitbake is having trouble with the automatic RDEPENDS on
rustlib.  Make it explicit for now.
2016-02-01 16:36:52 -05:00
Dan Dedrick
63cf611e65 rust-bin.bbclass: update path to cross output
poky 1.7 changes where it publishes cross output to so this recipe
needs to follow that. Unfortunately this path is defined in
cross.bbclass and we can't inherit that since we aren't cross.
2016-02-01 16:36:52 -05:00
Tyler Hall
302cca7529 rust-bin.bbclass: suffix rust libraries with -rs
Rust library names may have sonames that overlap with C/C++ libraries.
This causes bitbake to not be able to create the correct automatic
RDEPENDS between packages. The result is that dependencies may not get
automatically installed.

Add -rs to the file name and soname. The crate name remains the same,
and rust is not dependent on the file name to look up the crate inside
the library.
2016-02-01 16:36:52 -05:00
Tyler Hall
232d100c09 Add rand crate 2016-02-01 20:53:51 +00:00
Tyler Hall
8c83519133 rust-bin/rustlib: install with executable permission
Necessary for binaries and required to appease OE's automatic library
RDEPENDS.
2015-07-17 12:52:36 -04:00
Tyler Hall
06f6aeaa79 rust-bin: set soname of shared objects
Poky will fail to automatically create RDEPENDS on shared objects
lacking a SONAME in the ELF.
2015-07-17 12:52:36 -04:00
Tyler Hall
837000f68a rust-bin: common code for building libs
Libraries that overlap with the standard library must have explicit
extern declarations. Without something like pkg-config where the
libraries can publish this info, it's easiest to just hard-code the list
of troublesome libraries.
2015-07-17 12:52:36 -04:00
Tyler Hall
8a6f084c66 rust-bin: prefer-dynamic
We control static/dynamic by only making one or the other available.
Apparently the default of prefer static causes duplicate symbols for the
standard library.
2015-07-17 12:52:36 -04:00
Tyler Hall
a91af9bbae Add rust-bin class
This provides more defaults that aren't required for compiling with
rustc, but standardize the output for inclusion in a distro.

Things like
- Where to install libraries
- Stripping rustc note sections
- Optimization by default
2015-07-17 12:52:36 -04:00