From 411f10502c02d3ad7349c9c9521a831c7a5ad959 Mon Sep 17 00:00:00 2001 From: Steven Walter Date: Thu, 18 Jun 2015 15:19:14 -0400 Subject: [PATCH] rust-llvm-native: build LLVM in its own recipe rust takes a painfully long time to build. A non-trivial part of that is building LLVM. Fortuitiously, the LLVM component is common between the -native compiler and all variants of the -cross compiler. That means we can build it once, and reuse the output for any flavor of rust. That saves build time, and it utilizes bitbake's sstate more efficiently. It's win/win! --- recipes/rust/rust-llvm-native_1.1.0.bb | 27 ++++++++++++++++++++++++++ recipes/rust/rust-release.inc | 1 - recipes/rust/rust_1.1.0.bb | 1 + 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 recipes/rust/rust-llvm-native_1.1.0.bb diff --git a/recipes/rust/rust-llvm-native_1.1.0.bb b/recipes/rust/rust-llvm-native_1.1.0.bb new file mode 100644 index 0000000..207bd2c --- /dev/null +++ b/recipes/rust/rust-llvm-native_1.1.0.bb @@ -0,0 +1,27 @@ +SUMMARY = "LLVM compiler framework (packaged with rust)" +LICENSE = "NCSA" + +LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=47e311aa9caedd1b3abf098bd7814d1d" + +# 1.1.0 +require rust-release.inc +SRC_URI[rust.md5sum] = "5f2f923f8d1c77a55721d1f0813a158a" +SRC_URI[rust.sha256sum] = "cb09f443b37ec1b81fe73c04eb413f9f656859cf7d00bc5088008cbc2a63fa8a" + +S = "${WORKDIR}/rustc-${PV}/src/llvm" + +inherit autotools +inherit native + +EXTRA_OECONF += "--enable-targets=x86,x86_64,arm,aarch64,mips,powerpc" +EXTRA_OECONF += "--enable-optimized" +EXTRA_OECONF += "--disable-bindings" + +do_install_append () { + cd ${D}${bindir} + ln -s *-llc llc + for i in *-llvm-*; do + link=$(echo $i | sed -e 's/.*-llvm-\(.*\)/\1/') + ln -s $i llvm-$link + done +} diff --git a/recipes/rust/rust-release.inc b/recipes/rust/rust-release.inc index fd8e3da..7ece6e1 100644 --- a/recipes/rust/rust-release.inc +++ b/recipes/rust/rust-release.inc @@ -3,5 +3,4 @@ SRC_URI = "\ " S = "${WORKDIR}/rustc-${PV}" -require rust.inc diff --git a/recipes/rust/rust_1.1.0.bb b/recipes/rust/rust_1.1.0.bb index 7ada207..5e75bd8 100644 --- a/recipes/rust/rust_1.1.0.bb +++ b/recipes/rust/rust_1.1.0.bb @@ -1,5 +1,6 @@ # 1.1.0 require rust-release.inc +require rust.inc SRC_URI[rust.md5sum] = "5f2f923f8d1c77a55721d1f0813a158a" SRC_URI[rust.sha256sum] = "cb09f443b37ec1b81fe73c04eb413f9f656859cf7d00bc5088008cbc2a63fa8a"