Tyler Hall 0ade0cc790 Fix prelink issue breaking .bss
The reason prelink seemed to break relocations in .bss is because the
.note.rustc section happened to be placed in front of .bss. Using
objcopy to strip the note renumbered the sections and the symbols in the
.dynsym section were pointing to the wrong section index, but only for
.bss. Prelink would skip updating these dyn entries because it thought
they were pointing to a section that didn't get relocated, like
.comment. In some cases the GOT was actually prelinked correctly, but
the dynamic linker at run time would modify it to point at the
non-prelinked address.

Removing the SHF_ALLOC flag from the section causes it to be placed at
the end of the executable where it can be safely removed.

This is still a hack to the compiler because I couldn't find any way to
get the section attributes to be correct using the high-level LLVM
interface.
2016-02-02 13:08:14 -05:00
2016-02-02 11:40:25 -05:00
2014-10-25 12:50:28 -04:00
2016-02-02 13:08:14 -05:00
2016-02-01 20:54:20 +00:00
2014-10-25 12:50:28 -04:00

Introduction

This openembedded layer provides the rust compiler, tools for building packages (cargo), and a few example projects.

What works:

  • MACHINE="beaglebone" (TARGET_SYS=arm-poky-linux-gnueabi)
  • Building rust-native, rust-cross, rust-hello-world, cargo-native
  • Running/using all of these (including rust-hello-world)

What doesn't:

  • Probably some of the untested things

What's untested:

  • rust (built for target)
  • Other TARGETs

Common issues when packaging things using cargo

You may run into errors similar to:

| src/lib.rs:12:1: 12:35 error: can't find crate for `ffi`
| src/lib.rs:12 extern crate "openssl-sys" as ffi;
|               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Where a "-sys" crate (or other crate) is not found. These are typically caused by a crate's Cargo.toml including triplet-specific dependencies and then using the crate based on a feature (most often, #[cfg(unix)]). Until cargo and it's ecosystem get their act together, you'll need to supply patches to the misbehaving packages. See recipies/cargo/cargo_*.bb for an example of how to do this.

TODO

  • -crosssdk and -buildsdk packages
  • Upstream local rustc patches for libdir and bindir support
  • add bitbake fetch support for crates.io
  • add required cargo package registry clones in SRC_URI to prevent the need for network when building.

Pitfalls

  • TARGET_SYS must be different from BUILD_SYS. This is due to the way configuration options are tracked for different targets.

Dependencies

On the host: unknown

On the target: unknown

Maintainer(s) & Patch policy

Open a Pull Request

MIT/Apache-2.0 - Same as rust

Description
OpenEmbedded/Yocto layer for Rust and Cargo
Readme 1.6 MiB
Languages
PHP 56.5%
BitBake 17%
Shell 9.1%
Python 7.5%
Pawn 5.3%
Other 4.6%