Merge branch 'master' into add-more-ci

This commit is contained in:
Steven Walter
2018-12-07 17:40:29 -05:00
committed by GitHub
8 changed files with 288 additions and 32 deletions
+2 -2
View File
@@ -35,7 +35,7 @@ cargo_common_do_configure () {
directory = "${CARGO_HOME}/bitbake"
EOF
if [ "${EXTERNALSRC}" == "" ]; then
if [ -z "${EXTERNALSRC}" ]; then
cat <<- EOF >> ${CARGO_HOME}/config
[source.crates-io]
replace-with = "bitbake"
@@ -60,7 +60,7 @@ oe_cargo_fix_env () {
export TARGET_CC="${RUST_TARGET_CC}"
export TARGET_CXX="${RUST_TARGET_CXX}"
export TARGET_CFLAGS="${CFLAGS}"
export TARGET_CFLAGS="${CXXFLAGS}"
export TARGET_CXXFLAGS="${CXXFLAGS}"
export TARGET_AR="${AR}"
export HOST_CC="${RUST_BUILD_CC}"
export HOST_CXX="${RUST_BUILD_CXX}"
+1 -1
View File
@@ -9,7 +9,7 @@ BBFILE_PATTERN_rust-layer := "^${LAYERDIR}/"
BBFILE_PRIORITY_rust-layer = "7"
LAYERDEPENDS_rust-layer = "core openembedded-layer"
LAYERSERIES_COMPAT_rust-layer = "rocko sumo"
LAYERSERIES_COMPAT_rust-layer = "rocko sumo thud"
# Override security flags
require conf/distro/include/rust_security_flags.inc
+12
View File
@@ -0,0 +1,12 @@
CARGO_SNAPSHOT = "cargo-0.30.0-${BUILD_ARCH}-unknown-linux-gnu"
SRC_URI[cargo-snapshot-x86_64.md5sum] = "79b62c75b11ef480163276be189fdac5"
SRC_URI[cargo-snapshot-x86_64.sha256sum] = "32f210fd3142fda7825a06e95d1aa4b54035c2da435d8cf0dd03fad410c8002f"
SRC_URI += "\
https://static.rust-lang.org/dist/${CARGO_SNAPSHOT}.tar.gz;name=cargo-snapshot-${BUILD_ARCH} \
"
# When building cargo-native we don't have a built cargo to use so we must use
# the snapshot to bootstrap the build of cargo
CARGO_class-native = "${WORKDIR}/${CARGO_SNAPSHOT}/cargo/bin/cargo"
+2 -1
View File
@@ -6,7 +6,8 @@ LIC_FILES_CHKSUM += " \
file://LICENSE-THIRD-PARTY;md5=892ea68b169e69cfe75097fc38a15b56 \
"
# Used in libgit2-sys's build.rs, needed for pkg-config to be used
# Needed for pkg-config to be used
export LIBGIT2_SYS_USE_PKG_CONFIG = "1"
export LIBSSH2_SYS_USE_PKG_CONFIG = "1"
BBCLASSEXTEND = "native"
+173
View File
@@ -0,0 +1,173 @@
# Auto-Generated by cargo-bitbake 0.3.10
#
inherit cargo
# If this is git based prefer versioned ones if they exist
# DEFAULT_PREFERENCE = "-1"
# how to get cargo could be as easy as but default to a git checkout:
# SRC_URI += "crate://crates.io/cargo/0.31.0"
SRC_URI += "git://github.com/rust-lang/cargo;protocol=https;nobranch=1"
SRCREV = "36d96825d0f288c6d1bb2219919a277968bd365f"
S = "${WORKDIR}/git"
CARGO_SRC_DIR=""
# please note if you have entries that do not begin with crate://
# you must change them to how that package can be fetched
SRC_URI += " \
crate://crates.io/adler32/1.0.3 \
crate://crates.io/aho-corasick/0.6.9 \
crate://crates.io/ansi_term/0.11.0 \
crate://crates.io/arrayvec/0.4.7 \
crate://crates.io/atty/0.2.11 \
crate://crates.io/backtrace-sys/0.1.24 \
crate://crates.io/backtrace/0.3.9 \
crate://crates.io/bitflags/1.0.4 \
crate://crates.io/bufstream/0.1.4 \
crate://crates.io/build_const/0.2.1 \
crate://crates.io/cc/1.0.25 \
crate://crates.io/cfg-if/0.1.6 \
crate://crates.io/clap/2.32.0 \
crate://crates.io/cloudabi/0.0.3 \
crate://crates.io/commoncrypto-sys/0.2.0 \
crate://crates.io/commoncrypto/0.2.0 \
crate://crates.io/core-foundation-sys/0.6.2 \
crate://crates.io/core-foundation/0.6.2 \
crate://crates.io/crc/1.8.1 \
crate://crates.io/crossbeam-channel/0.2.6 \
crate://crates.io/crossbeam-epoch/0.6.0 \
crate://crates.io/crossbeam-utils/0.5.0 \
crate://crates.io/crypto-hash/0.3.1 \
crate://crates.io/curl-sys/0.4.14 \
crate://crates.io/curl/0.4.18 \
crate://crates.io/env_logger/0.5.13 \
crate://crates.io/failure/0.1.3 \
crate://crates.io/failure_derive/0.1.3 \
crate://crates.io/filetime/0.2.2 \
crate://crates.io/flate2/1.0.4 \
crate://crates.io/fnv/1.0.6 \
crate://crates.io/foreign-types-shared/0.1.1 \
crate://crates.io/foreign-types/0.3.2 \
crate://crates.io/fs2/0.4.3 \
crate://crates.io/fuchsia-zircon-sys/0.3.3 \
crate://crates.io/fuchsia-zircon/0.3.3 \
crate://crates.io/fwdansi/1.0.1 \
crate://crates.io/git2-curl/0.8.2 \
crate://crates.io/git2/0.7.5 \
crate://crates.io/glob/0.2.11 \
crate://crates.io/globset/0.4.2 \
crate://crates.io/hex/0.3.2 \
crate://crates.io/home/0.3.3 \
crate://crates.io/humantime/1.1.1 \
crate://crates.io/idna/0.1.5 \
crate://crates.io/ignore/0.4.4 \
crate://crates.io/itoa/0.4.3 \
crate://crates.io/jobserver/0.1.11 \
crate://crates.io/kernel32-sys/0.2.2 \
crate://crates.io/lazy_static/1.2.0 \
crate://crates.io/lazycell/1.2.0 \
crate://crates.io/libc/0.2.43 \
crate://crates.io/libgit2-sys/0.7.10 \
crate://crates.io/libssh2-sys/0.2.11 \
crate://crates.io/libz-sys/1.0.25 \
crate://crates.io/lock_api/0.1.4 \
crate://crates.io/log/0.4.6 \
crate://crates.io/matches/0.1.8 \
crate://crates.io/memchr/2.1.1 \
crate://crates.io/memoffset/0.2.1 \
crate://crates.io/miniz-sys/0.1.11 \
crate://crates.io/miniz_oxide/0.2.0 \
crate://crates.io/miniz_oxide_c_api/0.2.0 \
crate://crates.io/miow/0.3.3 \
crate://crates.io/nodrop/0.1.12 \
crate://crates.io/num_cpus/1.8.0 \
crate://crates.io/opener/0.3.0 \
crate://crates.io/openssl-probe/0.1.2 \
crate://crates.io/openssl-src/111.0.1+1.1.1 \
crate://crates.io/openssl-sys/0.9.39 \
crate://crates.io/openssl/0.10.15 \
crate://crates.io/owning_ref/0.3.3 \
crate://crates.io/parking_lot/0.6.4 \
crate://crates.io/parking_lot_core/0.3.1 \
crate://crates.io/percent-encoding/1.0.1 \
crate://crates.io/pkg-config/0.3.14 \
crate://crates.io/proc-macro2/0.4.20 \
crate://crates.io/quick-error/1.2.2 \
crate://crates.io/quote/0.6.9 \
crate://crates.io/rand/0.4.3 \
crate://crates.io/rand/0.5.5 \
crate://crates.io/rand_core/0.2.2 \
crate://crates.io/rand_core/0.3.0 \
crate://crates.io/redox_syscall/0.1.40 \
crate://crates.io/redox_termios/0.1.1 \
crate://crates.io/regex-syntax/0.6.2 \
crate://crates.io/regex/1.0.5 \
crate://crates.io/remove_dir_all/0.5.1 \
crate://crates.io/rustc-demangle/0.1.9 \
crate://crates.io/rustc-workspace-hack/1.0.0 \
crate://crates.io/rustc_version/0.2.3 \
crate://crates.io/rustfix/0.4.2 \
crate://crates.io/ryu/0.2.6 \
crate://crates.io/same-file/1.0.4 \
crate://crates.io/schannel/0.1.14 \
crate://crates.io/scopeguard/0.3.3 \
crate://crates.io/semver-parser/0.7.0 \
crate://crates.io/semver/0.9.0 \
crate://crates.io/serde/1.0.80 \
crate://crates.io/serde_derive/1.0.80 \
crate://crates.io/serde_ignored/0.0.4 \
crate://crates.io/serde_json/1.0.32 \
crate://crates.io/shell-escape/0.1.4 \
crate://crates.io/smallvec/0.6.5 \
crate://crates.io/socket2/0.3.8 \
crate://crates.io/stable_deref_trait/1.1.1 \
crate://crates.io/strsim/0.7.0 \
crate://crates.io/syn/0.15.18 \
crate://crates.io/synstructure/0.10.1 \
crate://crates.io/tar/0.4.18 \
crate://crates.io/tempfile/3.0.4 \
crate://crates.io/termcolor/1.0.4 \
crate://crates.io/termion/1.5.1 \
crate://crates.io/textwrap/0.10.0 \
crate://crates.io/thread_local/0.3.6 \
crate://crates.io/toml/0.4.8 \
crate://crates.io/ucd-util/0.1.2 \
crate://crates.io/unicode-bidi/0.3.4 \
crate://crates.io/unicode-normalization/0.1.7 \
crate://crates.io/unicode-width/0.1.5 \
crate://crates.io/unicode-xid/0.1.0 \
crate://crates.io/unreachable/1.0.0 \
crate://crates.io/url/1.7.1 \
crate://crates.io/utf8-ranges/1.0.2 \
crate://crates.io/vcpkg/0.2.6 \
crate://crates.io/vec_map/0.8.1 \
crate://crates.io/version_check/0.1.5 \
crate://crates.io/void/1.0.2 \
crate://crates.io/walkdir/2.2.6 \
crate://crates.io/winapi-build/0.1.1 \
crate://crates.io/winapi-i686-pc-windows-gnu/0.4.0 \
crate://crates.io/winapi-util/0.1.1 \
crate://crates.io/winapi-x86_64-pc-windows-gnu/0.4.0 \
crate://crates.io/winapi/0.2.8 \
crate://crates.io/winapi/0.3.6 \
crate://crates.io/wincolor/1.0.1 \
"
# FIXME: update generateme with the real MD5 of the license file
LIC_FILES_CHKSUM=" \
file://LICENSE-MIT;md5=b377b220f43d747efdec40d69fcaa69d \
file://LICENSE-APACHE;md5=1836efb2eb779966696f473ee8540542 \
"
SUMMARY = "Cargo, a package manager for Rust."
HOMEPAGE = "https://crates.io"
LICENSE = "MIT | Apache-2.0"
# includes this file if it exists but does not fail
# this is useful for anything you may want to override from
# what cargo-bitbake generates.
include cargo-${PV}.inc
include cargo.inc
+23 -27
View File
@@ -1,21 +1,31 @@
SUMMARY = "LLVM compiler framework (packaged with rust)"
LICENSE = "NCSA"
SRC_URI += "file://0002-llvm-allow-env-override-of-exe-path.patch"
S = "${RUSTSRC}/src/llvm"
LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=4c0bc17c954e99fd547528d938832bfa"
inherit cmake pythonnative
DEPENDS += "ninja-native rust-llvm-native"
ARM_INSTRUCTION_SET_armv5 = "arm"
ARM_INSTRUCTION_SET_armv4t = "arm"
LLVM_RELEASE = "6.0"
LLVM_DIR = "llvm${LLVM_RELEASE}"
EXTRA_OECMAKE = " \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_TARGETS_TO_BUILD='X86;ARM;AArch64;PowerPC;Mips' \
-DLLVM_BUILD_DOCS=OFF \
-DLLVM_ENABLE_TERMINFO=OFF \
-DLLVM_ENABLE_ZLIB=OFF \
-DLLVM_ENABLE_LIBXML2=OFF \
-DLLVM_ENABLE_FFI=OFF \
-DLLVM_INSTALL_UTILS=ON \
-DLLVM_BUILD_TOOLS=ON \
-DLLVM_BUILD_EXAMPLES=OFF \
-DLLVM_INCLUDE_EXAMPLES=OFF \
-DLLVM_BUILD_TESTS=OFF \
@@ -23,44 +33,30 @@ EXTRA_OECMAKE = " \
-DLLVM_TARGET_ARCH=${TARGET_ARCH} \
-DCMAKE_INSTALL_PREFIX:PATH=${libdir}/llvm-rust \
"
EXTRA_OECMAKE_append_class-target = "\
-DCMAKE_CROSSCOMPILING:BOOL=ON \
-DLLVM_BUILD_TOOLS=OFF \
-DLLVM_TABLEGEN=${STAGING_LIBDIR_NATIVE}/llvm-rust/bin/llvm-tblgen \
-DLLVM_CONFIG_PATH=${STAGING_LIBDIR_NATIVE}/llvm-rust/bin/llvm-config \
"
# The debug symbols are huge here (>2GB) so suppress them since they
# provide almost no value. If you really need them then override this
INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
do_compile_prepend_class-target() {
# Fix paths in llvm-config
sed -i "s|sys::path::parent_path(CurrentPath))\.str()|sys::path::parent_path(sys::path::parent_path(CurrentPath))).str()|g" ${S}/tools/llvm-config/llvm-config.cpp
# Fix the hardcoded libdir in llvm-config
sed -i 's:/lib\>:/${baselib}:g' ${S}/tools/llvm-config/llvm-config.cpp
}
do_install_append_class-target() {
# Disable checks on the native tools, since these should came from the native recipe
sed -i -e 's/\(.*APPEND.*_IMPORT_CHECK_FILES_FOR_.*{_IMPORT_PREFIX}\/bin\/.*\)/#\1/' ${D}/usr/share/llvm/cmake/LLVMExports-noconfig.cmake
}
SYSROOT_PREPROCESS_FUNCS_append_class-target = " llvm_sysroot_preprocess"
SYSROOT_PREPROCESS_FUNCS_append_class-native = " llvm_native_sysroot_preprocess"
llvm_sysroot_preprocess() {
install -d ${SYSROOT_DESTDIR}${bindir}
cp ${B}/NATIVE/bin/llvm-config ${SYSROOT_DESTDIR}/${bindir} || bbfatal "missing llvm-config"
cp ${B}/NATIVE/bin/llvm-tblgen ${SYSROOT_DESTDIR}/${bindir} || bbfatal "missing llvm-tblgen"
}
llvm_native_sysroot_preprocess() {
sysroot_stage_dir ${D}${STAGING_DIR_NATIVE}/usr/libexec ${SYSROOT_DESTDIR}${bindir}
}
PACKAGES =+ "${PN}-bugpointpasses ${PN}-llvmhello ${PN}-liblto"
# Add the extra locations to avoid the complaints about unpackaged files
FILES_${PN} += "${libdir}/libLLVM*.so"
FILES_${PN}-dev += "${datadir}/llvm"
FILES_${PN}-bugpointpasses = "${libdir}/BugpointPasses.so"
FILES_${PN}-llvmhello = "${libdir}/LLVMHello.so"
FILES_${PN}-liblto = "${libdir}/libLTO.so"
FILES_${PN}-bugpointpasses = "${libdir}/llvm-rust/lib/BugpointPasses.so"
FILES_${PN}-llvmhello = "${libdir}/llvm-rust/lib/LLVMHello.so"
FILES_${PN}-liblto = "${libdir}/llvm-rust/lib/libLTO.so.*"
FILES_${PN}-staticdev =+ "${libdir}/llvm-rust/*/*.a"
FILES_${PN} += "${libdir}/libLLVM*.so.* ${libdir}/llvm-rust/lib/*.so.* ${libdir}/llvm-rust/bin"
FILES_${PN}-dev += "${datadir}/llvm ${libdir}/llvm-rust/lib/*.so ${libdir}/llvm-rust/include ${libdir}/llvm-rust/share ${libdir}/llvm-rust/lib/cmake"
BBCLASSEXTEND = "native"
@@ -0,0 +1,70 @@
From aeccf16eaccdd80e4d5ecaa51673ce4b2bac1130 Mon Sep 17 00:00:00 2001
From: Martin Kelly <mkelly@xevo.com>
Date: Fri, 19 May 2017 00:22:57 -0700
Subject: [PATCH 2/2] llvm: allow env override of exe path
When using a native llvm-config from inside a sysroot, we need llvm-config to
return the libraries, include directories, etc. from inside the sysroot rather
than from the native sysroot. Thus provide an env override for calling
llvm-config from a target sysroot.
To let it work in multilib environment, we need to provide a knob to supply
multilib dirname as well
Upstream-Status: Inappropriate [OE-Specific]
Signed-off-by: Martin Kelly <mkelly@xevo.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
tools/llvm-config/llvm-config.cpp | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
Index: llvm/tools/llvm-config/llvm-config.cpp
===================================================================
--- llvm.orig/tools/llvm-config/llvm-config.cpp
+++ llvm/tools/llvm-config/llvm-config.cpp
@@ -225,6 +225,13 @@ Typical components:\n\
/// \brief Compute the path to the main executable.
std::string GetExecutablePath(const char *Argv0) {
+ // Hack for Yocto: we need to override the root path when we are using
+ // llvm-config from within a target sysroot.
+ const char *Sysroot = std::getenv("YOCTO_ALTERNATE_EXE_PATH");
+ if (Sysroot != nullptr) {
+ return Sysroot;
+ }
+
// This just needs to be some symbol in the binary; C++ doesn't
// allow taking the address of ::main however.
void *P = (void *)(intptr_t)GetExecutablePath;
@@ -306,12 +313,21 @@ int main(int argc, char **argv) {
std::string ActivePrefix, ActiveBinDir, ActiveIncludeDir, ActiveLibDir,
ActiveCMakeDir;
std::string ActiveIncludeOption;
+ // Hack for Yocto: we need to override the multilib path when we are using
+ // llvm-config from within a target sysroot.
+ std::string Multilibdir;
+ if (std::getenv("YOCTO_ALTERNATE_MULTILIB_NAME") != nullptr)
+ Multilibdir = std::getenv("YOCTO_ALTERNATE_MULTILIB_NAME");
+ else
+ Multilibdir = "/lib" LLVM_LIBDIR_SUFFIX;
+
if (IsInDevelopmentTree) {
ActiveIncludeDir = std::string(LLVM_SRC_ROOT) + "/include";
ActivePrefix = CurrentExecPrefix;
// CMake organizes the products differently than a normal prefix style
// layout.
+
switch (DevelopmentTreeLayout) {
case CMakeStyle:
ActiveBinDir = ActiveObjRoot + "/bin";
@@ -336,7 +352,7 @@ int main(int argc, char **argv) {
SmallString<256> path(StringRef(LLVM_TOOLS_INSTALL_DIR));
sys::fs::make_absolute(ActivePrefix, path);
ActiveBinDir = path.str();
- ActiveLibDir = ActivePrefix + "/lib" + LLVM_LIBDIR_SUFFIX;
+ ActiveLibDir = ActivePrefix + Multilibdir;
ActiveCMakeDir = ActiveLibDir + "/cmake/llvm";
ActiveIncludeOption = "-I" + ActiveIncludeDir;
}
+5 -1
View File
@@ -7,12 +7,16 @@ inherit rust
inherit cargo_common
DEPENDS += "file-native python-native"
DEPENDS_append_class-native = " rust-llvm-native"
# We generate local targets, and need to be able to locate them
export RUST_TARGET_PATH="${WORKDIR}/targets/"
export FORCE_CRATE_HASH="${BB_TASKHASH}"
export YOCTO_ALTERNATE_EXE_PATH = "${STAGING_LIBDIR}/llvm-rust/bin/llvm-config"
export YOCTO_ALTERNATE_MULTILIB_NAME = "/${BASELIB}"
# We can't use RUST_BUILD_SYS here because that may be "musl" if
# TCLIBC="musl". Snapshots are always -unknown-linux-gnu
SNAPSHOT_BUILD_SYS = "${BUILD_ARCH}-unknown-linux-gnu"
@@ -345,7 +349,7 @@ python do_configure() {
target_section = "target.{}".format(d.getVar('TARGET_SYS', True))
config.add_section(target_section)
llvm_config = d.expand("${STAGING_DIR_NATIVE}${libdir_native}/llvm-rust/bin/llvm-config")
llvm_config = d.expand("${YOCTO_ALTERNATE_EXE_PATH}")
config.set(target_section, "llvm-config", e(llvm_config))
config.set(target_section, "cxx", e(d.expand("${RUST_TARGET_CXX}")))