Compare commits
23 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bedc4ad57c | ||
|
|
a506df4ba4 | ||
|
|
067e5a7ffd | ||
|
|
ef7228d76c | ||
|
|
2879fc131d | ||
|
|
2c923bbd20 | ||
|
|
fcbebdf58f | ||
|
|
004d871505 | ||
|
|
b454d74256 | ||
|
|
270248fa9a | ||
|
|
fe4131352d | ||
|
|
c7f56766dc | ||
|
|
ef23c8f84b | ||
|
|
c049bde288 | ||
|
|
985069709c | ||
|
|
02b0de534d | ||
|
|
9dc57a12be | ||
|
|
ba25ff4945 | ||
|
|
6504a5747f | ||
|
|
3605be79d0 | ||
|
|
8290aafe54 | ||
|
|
565a332b3f | ||
|
|
5975292b62 |
2
Jenkinsfile
vendored
2
Jenkinsfile
vendored
@@ -15,7 +15,7 @@ for (int i = 0; i < targets.size(); i++) {
|
||||
sh "./scripts/setup-env.sh"
|
||||
}
|
||||
stage("fetch $machine") {
|
||||
sh "GIT_LOCAL_REF_DIR=/srv/git-cache/ ./scripts/fetch.sh morty"
|
||||
sh "GIT_LOCAL_REF_DIR=/srv/git-cache/ ./scripts/fetch.sh krogoth"
|
||||
}
|
||||
stage("build $machine") {
|
||||
sh "MACHINE=${machine} ./scripts/build.sh"
|
||||
|
||||
39
README.md
39
README.md
@@ -5,17 +5,19 @@ This OpenEmbedded layer provides the rust compiler, tools for building packages
|
||||
|
||||
## What works:
|
||||
|
||||
- Building rust-native, rust-cross, rust-hello-world, cargo-native
|
||||
- Building `rust-native` and `cargo-native`
|
||||
- Building Rust based projects with Cargo for the TARGET
|
||||
- e.g. `rustfmt` which is used by the CI system
|
||||
- `-buildsdk` and `-crosssdk` packages
|
||||
|
||||
## What doesn't:
|
||||
|
||||
- Using anything but x86_64 as the build environment
|
||||
- Probably some of the untested things
|
||||
- rust (built for target) issue #81
|
||||
|
||||
## What's untested:
|
||||
|
||||
- rust (built for target)
|
||||
- cargo (built for target)
|
||||
|
||||
## Building a rust package
|
||||
|
||||
@@ -30,39 +32,24 @@ recipe for it. This allows bitbake to fetch all the necessary dependent
|
||||
crates, as well as a pegged version of the crates.io index, to ensure maximum
|
||||
reproducibility.
|
||||
|
||||
## 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.
|
||||
NOTE: You will have to edit the generated recipe based on the comments
|
||||
contained within it
|
||||
|
||||
## TODO
|
||||
|
||||
- -crosssdk and -buildsdk packages
|
||||
- Upstream local rustc patches for libdir and bindir support
|
||||
|
||||
## Pitfalls
|
||||
|
||||
- TARGET_SYS _must_ be different from BUILD_SYS. This is due to the way configuration options are tracked for different targets.
|
||||
- TARGET_SYS _must_ be different from BUILD_SYS. This is due to the way Rust configuration options are tracked for different targets. This is the reason we use the Yocto triples instead of the native Rust triples. See rust-lang/cargo#3349.
|
||||
|
||||
## Dependencies
|
||||
|
||||
On the host:
|
||||
unknown
|
||||
- Any `-sys` packages your project might need must have RDEPENDs for
|
||||
the native library.
|
||||
|
||||
On the target:
|
||||
unknown
|
||||
- Any `-sys` packages your project might need must have RDEPENDs for
|
||||
the native library.
|
||||
|
||||
## Maintainer(s) & Patch policy
|
||||
|
||||
@@ -74,6 +61,8 @@ All new patches against rust, rust-llvm, and cargo must have referenced
|
||||
upstream issues or PRs opened or an explanation why the patch cannot be
|
||||
upstreamed. This cooresponds to the OpenEmbedded policy for other meta layers.
|
||||
|
||||
More info can be seen on the wiki.
|
||||
|
||||
## Copyright
|
||||
|
||||
MIT OR Apache-2.0 - Same as rust
|
||||
|
||||
3
recipes-deps/libgit2/libgit2-release.inc
Normal file
3
recipes-deps/libgit2/libgit2-release.inc
Normal file
@@ -0,0 +1,3 @@
|
||||
require libgit2.inc
|
||||
SRC_URI = "https://github.com/libgit2/libgit2/archive/v${PV}.tar.gz"
|
||||
|
||||
21
recipes-deps/libgit2/libgit2.inc
Normal file
21
recipes-deps/libgit2/libgit2.inc
Normal file
@@ -0,0 +1,21 @@
|
||||
SUMMARY = "the Git linkable library"
|
||||
HOMEPAGE = "http://libgit2.github.com/"
|
||||
LICENSE = "GPL-2.0-with-GCC-exception"
|
||||
|
||||
DEPENDS = "curl openssl zlib libssh2"
|
||||
|
||||
inherit cmake
|
||||
|
||||
# CLAR = tests, needs python-native
|
||||
EXTRA_OECMAKE = "\
|
||||
-DTHREADSAFE=ON \
|
||||
-DBUILD_CLAR=OFF \
|
||||
-DSHA1_TYPE="builtin" \
|
||||
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
||||
-DBUILD_SHARED_LIBS=OFF \
|
||||
-DBUILD_EXAMPLES=OFF \
|
||||
"
|
||||
|
||||
CFLAGS_append .= " -fPIC"
|
||||
|
||||
BBCLASSEXTEND = "native"
|
||||
4
recipes-deps/libgit2/libgit2_0.24.1.bb
Normal file
4
recipes-deps/libgit2/libgit2_0.24.1.bb
Normal file
@@ -0,0 +1,4 @@
|
||||
LIC_FILES_CHKSUM = "file://COPYING;md5=34197a479f637beb9e09e56893f48bc2"
|
||||
SRC_URI[md5sum] = "3674ca2d40388b1175e25b6f5a3a82ad"
|
||||
SRC_URI[sha256sum] = "60198cbb34066b9b5c1613d15c0479f6cd25f4aef42f7ec515cd1cc13a77fede"
|
||||
require libgit2-release.inc
|
||||
2
recipes-deps/libssh2/libssh2_%.bbappend
Normal file
2
recipes-deps/libssh2/libssh2_%.bbappend
Normal file
@@ -0,0 +1,2 @@
|
||||
# meta-oe/recipes-support/libssh2
|
||||
BBCLASSEXTEND = "native"
|
||||
@@ -10,6 +10,12 @@ SRC_URI = "\
|
||||
|
||||
require rust-source-${PV}.inc
|
||||
|
||||
ALLOW_EMPTY_${PN} = "1"
|
||||
|
||||
# dev and staticdev should NOT depend on the binary package
|
||||
RDEPENDS_${PN}-dev = ""
|
||||
INSANE_SKIP_${PN}-dev = "staticdev"
|
||||
|
||||
S = "${WORKDIR}/rustc-${PV}/src/compiler-rt"
|
||||
|
||||
do_compile () {
|
||||
@@ -28,3 +34,6 @@ do_install () {
|
||||
mkdir -p ${D}${libdir}
|
||||
cp triple/builtins/libcompiler_rt.a ${D}${libdir}/libcompiler-rt.a
|
||||
}
|
||||
|
||||
FILES_${PN}-dev = ""
|
||||
FILES_${PN}-staticdev = "${libdir}/*.a"
|
||||
|
||||
@@ -6,8 +6,12 @@ LIC_FILES_CHKSUM = "file://src/compiler-rt/LICENSE.TXT;md5=bf24bca27049b52e97384
|
||||
|
||||
require rust.inc
|
||||
require rust-source-${PV}.inc
|
||||
ALLOW_EMPTY_${PN} = "1"
|
||||
|
||||
DEPENDS += "rust-llvm-native (=${PV})"
|
||||
# dev and staticdev should NOT depend on the binary package
|
||||
RDEPENDS_${PN}-dev = ""
|
||||
INSANE_SKIP_${PN}-dev = "staticdev"
|
||||
|
||||
S = "${WORKDIR}/rustc-${PV}"
|
||||
|
||||
@@ -22,3 +26,6 @@ do_install () {
|
||||
mkdir -p ${D}${libdir}
|
||||
cp ${TARGET_SYS}/rt/libcompiler-rt.a ${D}${libdir}/libcompiler-rt.a
|
||||
}
|
||||
|
||||
FILES_${PN}-dev = ""
|
||||
FILES_${PN}-staticdev = "${libdir}/*.a"
|
||||
|
||||
@@ -80,6 +80,8 @@ do_compile_prepend_class-target() {
|
||||
}
|
||||
|
||||
do_compile() {
|
||||
oe_runmake NATIVE_LIB_LLVMTABLEGEN
|
||||
oe_runmake NativeLLVMConfig
|
||||
oe_runmake
|
||||
}
|
||||
|
||||
|
||||
@@ -177,7 +177,7 @@ def arch_to_rust_target_arch(arch):
|
||||
|
||||
# generates our target CPU value
|
||||
def llvm_cpu(d):
|
||||
cpu = d.getVar('TUNE_PKGARCH', True)
|
||||
cpu = d.getVar('PACKAGE_ARCH', True)
|
||||
target = d.getVar('TRANSLATED_TARGET_ARCH', True)
|
||||
|
||||
trans = {}
|
||||
|
||||
@@ -40,10 +40,11 @@ update_repo() {
|
||||
git fetch origin || die "unable to fetch ${uri}"
|
||||
else
|
||||
echo "Cloning '${path}'"
|
||||
if [ -z "${GIT_LOCAL_REF_DIR}" ]; then
|
||||
git clone ${uri} ${path} || die "unable to clone ${uri}"
|
||||
if [ -d "${GIT_LOCAL_REF_DIR}" ]; then
|
||||
git clone --reference ${GIT_LOCAL_REF_DIR}/`basename ${path}` \
|
||||
${uri} ${path} || die "unable to clone ${uri}"
|
||||
else
|
||||
git clone --reference ${GIT_LOCAL_REF_DIR}/`basename ${path}` ${uri} ${path}
|
||||
git clone ${uri} ${path} || die "unable to clone ${uri}"
|
||||
fi
|
||||
pushd ${path} > /dev/null
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user