17 Commits

Author SHA1 Message Date
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