diff options
| author | Khem Raj <raj.khem@gmail.com> | 2015-03-12 15:47:26 +0000 |
|---|---|---|
| committer | Khem Raj <raj.khem@gmail.com> | 2015-03-12 15:47:26 +0000 |
| commit | 948d8c595ffab96e1776b4573cb6c96468f53122 (patch) | |
| tree | 96d31ac1b71750c4cf3305859092ec7835763879 | |
| parent | 7d75cff3a28f9635efd6a85af0a374cb41538f58 (diff) | |
| download | meta-clang-948d8c595ffab96e1776b4573cb6c96468f53122.tar.gz | |
clang: Update to latest git master
Fix clang-native builds, try to provide things that is a stab at
replacing gcc runtime provides
Signed-off-by: Khem Raj <raj.khem@gmail.com>
| -rw-r--r-- | recipes-devtools/clang/clang.inc | 59 | ||||
| -rw-r--r-- | recipes-devtools/clang/clang_git.bb | 111 | ||||
| -rw-r--r-- | recipes-devtools/clang/llvm-common.bb | 2 |
3 files changed, 106 insertions, 66 deletions
diff --git a/recipes-devtools/clang/clang.inc b/recipes-devtools/clang/clang.inc index c4b58fc..a07fe61 100644 --- a/recipes-devtools/clang/clang.inc +++ b/recipes-devtools/clang/clang.inc | |||
| @@ -1,58 +1 @@ | |||
| 1 | # LLVM does not provide ABI stability between different versions. For this | PV = "3.7.0" | |
| 2 | # reason OE makes it possible to build and install different llvm versions | ||
| 3 | # at the same time. | ||
| 4 | # | ||
| 5 | # This is true for the normal recipes as well as the native ones. | ||
| 6 | # | ||
| 7 | # All regular installation directories are prefixed with 'llvm${LLVM_RELEASE}' | ||
| 8 | # e.g. "${STAGING_BINDIR}/llvm2.5" or "${STAGING_INCDIR}/llvm2.5" | ||
| 9 | # | ||
| 10 | # For your program or library that makes use of llvm you do should not need to | ||
| 11 | # modify anything as long as it uses the results of various llvm-config | ||
| 12 | # invocations. If you need customizations something is wrong and it needs to be | ||
| 13 | # fixed (report bug). | ||
| 14 | # | ||
| 15 | # However the *recipe* for your program/library *must* declare | ||
| 16 | # export WANT_LLVM_RELEASE = "<valid version number>" | ||
| 17 | # The version number is picked up by a generic wrapper script which just calls | ||
| 18 | # the variant of the specified version. | ||
| 19 | |||
| 20 | DEPENDS = "libffi libxml2-native llvm-native zlib" | ||
| 21 | |||
| 22 | inherit perlnative pythonnative cmake | ||
| 23 | |||
| 24 | |||
| 25 | EXTRA_OECMAKE="-DLLVM_ENABLE_RTTI=True \ | ||
| 26 | -DLLVM_ENABLE_FFI=False \ | ||
| 27 | -DCMAKE_SYSTEM_NAME=Linux \ | ||
| 28 | " | ||
| 29 | |||
| 30 | EXTRA_OECMAKE_append_class-native = "\ | ||
| 31 | -DLLVM_TARGETS_TO_BUILD=host \ | ||
| 32 | -DCMAKE_BUILD_TYPE=Release \ | ||
| 33 | -DCMAKE_INSTALL_PREFIX=${prefix} \ | ||
| 34 | " | ||
| 35 | EXTRA_OECMAKE_append_class-target = "\ | ||
| 36 | -DCMAKE_CROSSCOMPILING=True \ | ||
| 37 | " | ||
| 38 | EXTRA_OEMAKE += "REQUIRES_RTTI=1 VERBOSE=1" | ||
| 39 | |||
| 40 | do_configure() { | ||
| 41 | # Remove RPATHs | ||
| 42 | sed -i 's:$(RPATH) -Wl,$(\(ToolDir\|LibDir\|ExmplDir\))::g' ${S}/Makefile.rules | ||
| 43 | # Drop "svn" suffix from version string | ||
| 44 | sed -i 's/${PV}svn/${PV}/g' ${S}/configure | ||
| 45 | |||
| 46 | # Fix paths in llvm-config | ||
| 47 | 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 | ||
| 48 | sed -ri "s#/(bin|include|lib)(/?\")#/\1/${LLVM_DIR}\2#g" ${S}/tools/llvm-config/llvm-config.cpp | ||
| 49 | cmake ${S} | ||
| 50 | } | ||
| 51 | |||
| 52 | do_compile_class-native () { | ||
| 53 | oe_runmake | ||
| 54 | } | ||
| 55 | |||
| 56 | do_install_class-native () { | ||
| 57 | oe_runmake install DESTDIR=${D} | ||
| 58 | } | ||
diff --git a/recipes-devtools/clang/clang_git.bb b/recipes-devtools/clang/clang_git.bb index 75120c1..f72b409 100644 --- a/recipes-devtools/clang/clang_git.bb +++ b/recipes-devtools/clang/clang_git.bb | |||
| @@ -8,14 +8,9 @@ SECTION = "devel" | |||
| 8 | 8 | ||
| 9 | require clang.inc | 9 | require clang.inc |
| 10 | 10 | ||
| 11 | LLVM_RELEASE = "3.5" | ||
| 12 | LLVM_DIR = "llvm${LLVM_RELEASE}" | ||
| 13 | |||
| 14 | DEPENDS = "zlib libffi libxml2-native llvm-common" | ||
| 15 | |||
| 16 | BRANCH ?= "master" | 11 | BRANCH ?= "master" |
| 17 | LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=47e311aa9caedd1b3abf098bd7814d1d; \ | 12 | LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=4c0bc17c954e99fd547528d938832bfa; \ |
| 18 | file://tools/clang/LICENSE.TXT;md5=3954ab76dfb9ce9024cdce4c24268267; \ | 13 | file://tools/clang/LICENSE.TXT;md5=82ed8fe1976ca709bbd81f4f10a48ccd; \ |
| 19 | file://projects/compiler-rt/LICENSE.TXT;md5=1ee2b380c3e34d2dd756b922ab4f8b6c; \ | 14 | file://projects/compiler-rt/LICENSE.TXT;md5=1ee2b380c3e34d2dd756b922ab4f8b6c; \ |
| 20 | " | 15 | " |
| 21 | SRC_URI = "git://github.com/llvm-mirror/llvm.git;branch=${BRANCH};name=llvm \ | 16 | SRC_URI = "git://github.com/llvm-mirror/llvm.git;branch=${BRANCH};name=llvm \ |
| @@ -27,7 +22,107 @@ SRCREV_llvm = "${AUTOREV}" | |||
| 27 | SRCREV_clang = "${AUTOREV}" | 22 | SRCREV_clang = "${AUTOREV}" |
| 28 | SRCREV_compiler-rt = "${AUTOREV}" | 23 | SRCREV_compiler-rt = "${AUTOREV}" |
| 29 | 24 | ||
| 25 | SRCREV_FORMAT = "llvm_clang_compiler-rt" | ||
| 30 | 26 | ||
| 31 | S = "${WORKDIR}/git" | 27 | S = "${WORKDIR}/git" |
| 32 | 28 | ||
| 33 | BBCLASSEXTEND = "native nativesdk" | 29 | inherit perlnative pythonnative cmake |
| 30 | |||
| 31 | EXTRA_OECMAKE="-DLLVM_ENABLE_RTTI:BOOL=True \ | ||
| 32 | -DLLVM_ENABLE_FFI:BOOL=False \ | ||
| 33 | -DCMAKE_SYSTEM_NAME=Linux \ | ||
| 34 | -DCMAKE_BUILD_TYPE:STRING=Release \ | ||
| 35 | -DLLVM_TARGETS_TO_BUILD:STRING='AArch64;ARM;Mips;PowerPC;X86' \ | ||
| 36 | " | ||
| 37 | |||
| 38 | EXTRA_OECMAKE_append_class-target = "\ | ||
| 39 | -DCMAKE_CROSSCOMPILING=True \ | ||
| 40 | " | ||
| 41 | EXTRA_OEMAKE += "REQUIRES_RTTI=1 VERBOSE=1" | ||
| 42 | |||
| 43 | |||
| 44 | DEPENDS = "zlib libffi libxml2-native binutils" | ||
| 45 | |||
| 46 | PROVIDES_append_class-target = "\ | ||
| 47 | virtual/${TARGET_PREFIX}compilerlibs \ | ||
| 48 | gcc-runtime \ | ||
| 49 | libgcc \ | ||
| 50 | libgcc-initial \ | ||
| 51 | libg2c \ | ||
| 52 | libg2c-dev \ | ||
| 53 | libssp \ | ||
| 54 | libssp-dev \ | ||
| 55 | libssp-staticdev \ | ||
| 56 | libgfortran \ | ||
| 57 | libgfortran-dev \ | ||
| 58 | libgfortran-staticdev \ | ||
| 59 | libmudflap \ | ||
| 60 | libmudflap-dev \ | ||
| 61 | libgomp \ | ||
| 62 | libgomp-dev \ | ||
| 63 | libgomp-staticdev \ | ||
| 64 | libitm \ | ||
| 65 | libitm-dev \ | ||
| 66 | libitm-staticdev \ | ||
| 67 | libgcov-dev \ | ||
| 68 | \ | ||
| 69 | libgcc-dev \ | ||
| 70 | libgcc-initial-dev \ | ||
| 71 | libstdc++ \ | ||
| 72 | libstdc++-dev \ | ||
| 73 | libstdc++-staticdev \ | ||
| 74 | libatomic \ | ||
| 75 | libatomic-dev \ | ||
| 76 | libatomic-staticdev \ | ||
| 77 | libasan \ | ||
| 78 | libasan-dev \ | ||
| 79 | libasan-staticdev \ | ||
| 80 | libubsan \ | ||
| 81 | libubsan-dev \ | ||
| 82 | libubsan-staticdev \ | ||
| 83 | liblsan \ | ||
| 84 | liblsan-dev \ | ||
| 85 | liblsan-staticdev \ | ||
| 86 | libtsan \ | ||
| 87 | libtsan-dev \ | ||
| 88 | libtsan-staticdev \ | ||
| 89 | libssp \ | ||
| 90 | libssp-dev \ | ||
| 91 | libssp-staticdev \ | ||
| 92 | libgfortran \ | ||
| 93 | libgfortran-dev \ | ||
| 94 | libgfortran-staticdev \ | ||
| 95 | libmudflap \ | ||
| 96 | libmudflap-dev \ | ||
| 97 | libmudflap-staticdev \ | ||
| 98 | libgomp \ | ||
| 99 | libgomp-dev \ | ||
| 100 | libgomp-staticdev \ | ||
| 101 | libitm \ | ||
| 102 | libitm-dev \ | ||
| 103 | libitm-staticdev \ | ||
| 104 | " | ||
| 105 | |||
| 106 | do_configure_prepend() { | ||
| 107 | # Remove RPATHs | ||
| 108 | sed -i 's:$(RPATH) -Wl,$(\(ToolDir\|LibDir\|ExmplDir\))::g' ${S}/Makefile.rules | ||
| 109 | # Drop "svn" suffix from version string | ||
| 110 | sed -i 's/${PV}svn/${PV}/g' ${S}/configure | ||
| 111 | |||
| 112 | # Fix paths in llvm-config | ||
| 113 | 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 | ||
| 114 | sed -ri "s#/(bin|include|lib)(/?\")#/\1/${LLVM_DIR}\2#g" ${S}/tools/llvm-config/llvm-config.cpp | ||
| 115 | } | ||
| 116 | |||
| 117 | do_compile_prepend() { | ||
| 118 | oe_runmake llvm-tblgen | ||
| 119 | oe_runmake clang-tblgen | ||
| 120 | } | ||
| 121 | |||
| 122 | do_install_append_class-native () { | ||
| 123 | for f in `find ${D}${bindir} -executable -type f -not -type l`; do | ||
| 124 | test -n "`file $f|grep -i ELF`" && ${STRIP} $f | ||
| 125 | done | ||
| 126 | } | ||
| 127 | |||
| 128 | BBCLASSEXTEND = "native" | ||
diff --git a/recipes-devtools/clang/llvm-common.bb b/recipes-devtools/clang/llvm-common.bb index 618cc1e..8a6947b 100644 --- a/recipes-devtools/clang/llvm-common.bb +++ b/recipes-devtools/clang/llvm-common.bb | |||
| @@ -6,6 +6,8 @@ LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d | |||
| 6 | 6 | ||
| 7 | SRC_URI = "file://llvm-config" | 7 | SRC_URI = "file://llvm-config" |
| 8 | 8 | ||
| 9 | S = "${WORKDIR}" | ||
| 10 | |||
| 9 | ALLOW_EMPTY_${PN} = "1" | 11 | ALLOW_EMPTY_${PN} = "1" |
| 10 | SYSROOT_PREPROCESS_FUNCS_append_class-target = " llvm_common_sysroot_preprocess" | 12 | SYSROOT_PREPROCESS_FUNCS_append_class-target = " llvm_common_sysroot_preprocess" |
| 11 | 13 | ||
