rust-llvm: convert to cmake build

Future versions of LLVM require cmake to build so it will be easier to
prove that out on a known good build and to allow future versions to use
this as common code.
This commit is contained in:
Doug Goldstein
2016-11-02 16:25:14 -05:00
parent e0e7b6cefe
commit ea888066a3
2 changed files with 19 additions and 57 deletions

View File

@@ -1,34 +0,0 @@
From eee79cc95f57434c4b530da96c88494e9b5d056b Mon Sep 17 00:00:00 2001
From: Steven Walter <stevenrwalter@gmail.com>
Date: Sat, 27 Aug 2016 13:20:48 -0400
Subject: [PATCH] Don't build unittests
---
Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index 2b9468a..2bb30f6 100644
--- a/Makefile
+++ b/Makefile
@@ -31,7 +31,7 @@ ifeq ($(BUILD_DIRS_ONLY),1)
OPTIONAL_DIRS := tools/clang/utils/TableGen
else
DIRS := lib/Support lib/TableGen utils lib/IR lib tools/llvm-shlib \
- tools/llvm-config tools docs cmake unittests
+ tools/llvm-config tools docs cmake
OPTIONAL_DIRS := projects bindings
endif
@@ -39,7 +39,7 @@ ifeq ($(BUILD_EXAMPLES),1)
OPTIONAL_DIRS += examples
endif
-EXTRA_DIST := test unittests llvm.spec include win32 Xcode
+EXTRA_DIST := test llvm.spec include win32 Xcode
include $(LEVEL)/Makefile.config
--
2.7.4

View File

@@ -3,25 +3,33 @@ LICENSE = "NCSA"
SRC_URI = "\
https://static.rust-lang.org/dist/rustc-${PV}-src.tar.gz;name=rust \
file://rust-llvm/0001-Don-t-build-unittests.patch \
"
S = "${WORKDIR}/rustc-${PV}/src/llvm"
LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=4c0bc17c954e99fd547528d938832bfa"
inherit autotools
inherit cmake pythonnative
EXTRA_OECONF += "--enable-targets=x86,x86_64,arm,aarch64,mips,powerpc"
EXTRA_OECONF += "--enable-optimized"
EXTRA_OECONF += "--disable-assertions"
EXTRA_OECONF += "--disable-docs"
EXTRA_OECONF += "--enable-bindings=none"
EXTRA_OECONF += "--disable-terminfo"
EXTRA_OECONF += "--disable-zlib"
EXTRA_OECONF += "--disable-libffi"
EXTRA_OECMAKE = " \
-DLLVM_TARGETS_TO_BUILD='X86;ARM;AArch64;PowerPC' \
-DLLVM_ENABLE_ASSERTIONS=OFF \
-DLLVM_BUILD_DOCS=OFF \
-DLLVM_ENABLE_TERMINFO=OFF \
-DLLVM_ENABLE_ZLIB=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 \
-DLLVM_INCLUDE_TESTS=OFF \
-DLLVM_TARGET_ARCH=${TARGET_ARCH} \
"
EXTRA_OECONF += "--enable-keep-symbols"
# 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"
PACKAGES += "${PN}-data"
@@ -29,16 +37,4 @@ PACKAGES += "${PN}-data"
FILES_${PN}-data = "${datadir}"
FILES_${PN}-dev += "${libdir}"
do_install_append () {
# Remove the debug info (>2 GB) as part of normal operation
rm -rf ${D}${bindir}/.debug
cd ${D}${bindir} || bbfatal "failed to cd ${D}${bindir}"
for i in *-llvm-* *-llc *-lli *-FileCheck; do
link=$(echo $i | sed -e "s/${TARGET_SYS}-\(.*\)/\1/")
[ -e "${i}" ] || bbfatal "no such file to symlink to ${i}"
ln -sf "$i" "${link}" || bbfatal "failed to symlink ${link} to ${i}"
done
}
BBCLASSEXTEND = "native"