From patchwork Fri Jul 28 04:56:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 108868 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp2932884qge; Thu, 27 Jul 2017 21:56:21 -0700 (PDT) X-Received: by 10.98.108.74 with SMTP id h71mr6352083pfc.206.1501217781419; Thu, 27 Jul 2017 21:56:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1501217781; cv=none; d=google.com; s=arc-20160816; b=iwUZudctdr9wD/ucbhiAtqA7mfaH4RDvydFrZpkm4me0DmFPf1H1zmhKvmokK/884U 1On6mBUkk9+ukEJwEg/2h1GQ90A3v39Gs54GMFINjhFGA0E4PLhX+ermjPYpc2vJsJTX J8+BLRwiURUtbjqzWEXhixMGwJIGJoyXDD27KGeF98UAsMruttTuKxaPxnmFJcQfNDnq 2ZY4nR5bfM1z7VXkJk1WKzc4PqETIbfucrweo9WB3y+sqh/8l/Y8ATgQGMuK3TPO3uhn goDvSay11DWMDUFuBjUdPXLMRBXQ3/5muezmjHT21nnFjwo3C+vrI0xLiAmw4V7x4ERU xZkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to:arc-authentication-results; bh=hOJel7/y6LW9FcJeWjrz2ix/B7opdiSLGiHnhF1u1Fs=; b=o4T9EYPNlU5AvEMzZKq6VpxErIL9cQn+e8focTARsRLctLVI8rd4IDt55fiXxPXP0A ZjKApTgkmdyUYzF9PzZV5CugfMTjQOU2ebJaMtOB8weTm9yKRGS+qhTuLYfmklRudAvU qVAFt1tMlaLWutx3x6oeZv2bGlLVrA/8YasJ7UkGAiUj2DPio0abkUd5f55JbrrTCuW/ XJxdDapWyaoau5pBHOVU0/GbvnLjoQfOKWzhEHXZNG5PHE2AQvvbLOL1v0Ole03ylbHb e/+1IYWq6mcjDvcsW1jCpzPj3wo0PtZl3DSMPZuSmzctlwjOkzHwejklMSdRH7dESPiF KujQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.b=Uuy0a8Jc; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from mail.openembedded.org (mail.openembedded.org. [140.211.169.62]) by mx.google.com with ESMTP id w188si11784118pfw.194.2017.07.27.21.56.21; Thu, 27 Jul 2017 21:56:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) client-ip=140.211.169.62; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.b=Uuy0a8Jc; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: from review.yoctoproject.org (localhost [127.0.0.1]) by mail.openembedded.org (Postfix) with ESMTP id B4FCC7846B; Fri, 28 Jul 2017 04:56:18 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from mail-pf0-f194.google.com (mail-pf0-f194.google.com [209.85.192.194]) by mail.openembedded.org (Postfix) with ESMTP id 603EB78463 for ; Fri, 28 Jul 2017 04:56:15 +0000 (UTC) Received: by mail-pf0-f194.google.com with SMTP id k72so16388050pfj.0 for ; Thu, 27 Jul 2017 21:56:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=caRz6Nv5kvGq0QlHkejN+LNQ0suV1WxiG02xJb8wQho=; b=Uuy0a8JcsPWul0Yq8QjWEJ0XE9/iCiYkM2Yhi1GcdyVB1wqPJRDu/G9xdesZGqyU5d YLc/dhGxq0gweT7UWsKmtwKlYW7BDo6D25T0k06G6TtbWSwswGdFuQ1BOhfHRlDm9zGz njZ0hg9Ztyi+U1OVi1zH/SA1FYGmKd97bdFPxBsKLH3IVMECCz21dmyzLlUVzf1OlnZE plUZSjgBKQovXhDazL8IQIpLnnn3oqhPemDMjAjcTNmJX4oxeAzNmwkST11hMD8VrFIw bpDE0R2749cN/PU2nGJIWOAsvfGWARlTGjhvFzH0elMJ0ps6LSIq7acgy3/9UHIp1yT+ YArA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=caRz6Nv5kvGq0QlHkejN+LNQ0suV1WxiG02xJb8wQho=; b=BE2Ga1zXtuH+ImmfsC/bAMke8P/SoXabhAhE7s+vx/N6lWs7kqO8Q/BwndWlyMIoem QVV3RjFn74M1SLOgewaxwVjNdkVg2SRPR2ufhFtHumLRn3aHzn4J8nDuqS/YJNrtwS4y Y0IXNcDyecjM93ShoveVgdghkiGxIra2XKSOiGEoHCBAnddYHPh7+eg5SO4iOOP5NSRp amWLWebWp4ZlaN1ceQAh5XpLuKvc8kV5Z8zII36si260fSMTLaIXx4sADcGQHuedG7Zd 60py4gdqsUjVuockQSVZmIfZXkOnG3MswtOStlMs5crrIHcX2tJrFl5AGIOcXg7csXDk sAfA== X-Gm-Message-State: AIVw112zXTz2/Sfx7mSmGhi3FY4YIPiU/Ixqz4ciQ2jbIIbremPb5lLD +OgbJJPKUS+gxzLF X-Received: by 10.99.0.209 with SMTP id 200mr6190279pga.138.1501217776192; Thu, 27 Jul 2017 21:56:16 -0700 (PDT) Received: from localhost.localdomain ([2601:646:8882:b8c:6245:cbff:fe64:591]) by smtp.gmail.com with ESMTPSA id n80sm39912188pfj.118.2017.07.27.21.56.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Jul 2017 21:56:15 -0700 (PDT) From: Khem Raj To: openembedded-core@lists.openembedded.org Date: Thu, 27 Jul 2017 21:56:05 -0700 Message-Id: <013f04876bdf7263a8d270f07fca4d7f53eaa0ee.1501217624.git.raj.khem@gmail.com> X-Mailer: git-send-email 2.13.3 In-Reply-To: References: Subject: [OE-core] [PATCH 1/2] llvm: Add recipe for 5.0 X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: openembedded-core-bounces@lists.openembedded.org Errors-To: openembedded-core-bounces@lists.openembedded.org Needed by mesa Fixes [YOCTO #11529] Signed-off-by: Khem Raj --- ...LibraryInfo-Undefine-libc-functions-if-th.patch | 93 ++++++++++++ .../0002-llvm-allow-env-override-of-exe-path.patch | 39 +++++ meta/recipes-devtools/llvm/llvm_git.bb | 169 +++++++++++++++++++++ 3 files changed, 301 insertions(+) create mode 100644 meta/recipes-devtools/llvm/llvm/0001-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch create mode 100644 meta/recipes-devtools/llvm/llvm/0002-llvm-allow-env-override-of-exe-path.patch create mode 100644 meta/recipes-devtools/llvm/llvm_git.bb -- 2.13.3 -- _______________________________________________ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core diff --git a/meta/recipes-devtools/llvm/llvm/0001-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch b/meta/recipes-devtools/llvm/llvm/0001-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch new file mode 100644 index 0000000000..e251799259 --- /dev/null +++ b/meta/recipes-devtools/llvm/llvm/0001-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch @@ -0,0 +1,93 @@ +From 28293e48cf1a52004c6a78de448718441f9e05f9 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Sat, 21 May 2016 00:33:20 +0000 +Subject: [PATCH 1/2] llvm: TargetLibraryInfo: Undefine libc functions if they + are macros + +musl defines some functions as macros and not inline functions +if this is the case then make sure to undefine them + +Signed-off-by: Khem Raj +--- +Upstream-Status: Pending + + include/llvm/Analysis/TargetLibraryInfo.def | 21 +++++++++++++++++++++ + 1 file changed, 21 insertions(+) + +diff --git a/include/llvm/Analysis/TargetLibraryInfo.def b/include/llvm/Analysis/TargetLibraryInfo.def +index 9cbe917c146..aff8419cf54 100644 +--- a/include/llvm/Analysis/TargetLibraryInfo.def ++++ b/include/llvm/Analysis/TargetLibraryInfo.def +@@ -656,6 +656,9 @@ TLI_DEFINE_STRING_INTERNAL("fmodl") + TLI_DEFINE_ENUM_INTERNAL(fopen) + TLI_DEFINE_STRING_INTERNAL("fopen") + /// FILE *fopen64(const char *filename, const char *opentype) ++#ifdef fopen64 ++#undef fopen64 ++#endif + TLI_DEFINE_ENUM_INTERNAL(fopen64) + TLI_DEFINE_STRING_INTERNAL("fopen64") + /// int fprintf(FILE *stream, const char *format, ...); +@@ -691,6 +694,9 @@ TLI_DEFINE_STRING_INTERNAL("fseek") + /// int fseeko(FILE *stream, off_t offset, int whence); + TLI_DEFINE_ENUM_INTERNAL(fseeko) + TLI_DEFINE_STRING_INTERNAL("fseeko") ++#ifdef fseeko64 ++#undef fseeko64 ++#endif + /// int fseeko64(FILE *stream, off64_t offset, int whence) + TLI_DEFINE_ENUM_INTERNAL(fseeko64) + TLI_DEFINE_STRING_INTERNAL("fseeko64") +@@ -701,6 +707,9 @@ TLI_DEFINE_STRING_INTERNAL("fsetpos") + TLI_DEFINE_ENUM_INTERNAL(fstat) + TLI_DEFINE_STRING_INTERNAL("fstat") + /// int fstat64(int filedes, struct stat64 *buf) ++#ifdef fstat64 ++#undef fstat64 ++#endif + TLI_DEFINE_ENUM_INTERNAL(fstat64) + TLI_DEFINE_STRING_INTERNAL("fstat64") + /// int fstatvfs(int fildes, struct statvfs *buf); +@@ -716,6 +725,9 @@ TLI_DEFINE_STRING_INTERNAL("ftell") + TLI_DEFINE_ENUM_INTERNAL(ftello) + TLI_DEFINE_STRING_INTERNAL("ftello") + /// off64_t ftello64(FILE *stream) ++#ifdef ftello64 ++#undef ftello64 ++#endif + TLI_DEFINE_ENUM_INTERNAL(ftello64) + TLI_DEFINE_STRING_INTERNAL("ftello64") + /// int ftrylockfile(FILE *file); +@@ -836,6 +848,9 @@ TLI_DEFINE_STRING_INTERNAL("logl") + TLI_DEFINE_ENUM_INTERNAL(lstat) + TLI_DEFINE_STRING_INTERNAL("lstat") + /// int lstat64(const char *path, struct stat64 *buf); ++#ifdef lstat64 ++#undef lstat64 ++#endif + TLI_DEFINE_ENUM_INTERNAL(lstat64) + TLI_DEFINE_STRING_INTERNAL("lstat64") + /// void *malloc(size_t size); +@@ -1055,6 +1070,9 @@ TLI_DEFINE_STRING_INTERNAL("sscanf") + TLI_DEFINE_ENUM_INTERNAL(stat) + TLI_DEFINE_STRING_INTERNAL("stat") + /// int stat64(const char *path, struct stat64 *buf); ++#ifdef stat64 ++#undef stat64 ++#endif + TLI_DEFINE_ENUM_INTERNAL(stat64) + TLI_DEFINE_STRING_INTERNAL("stat64") + /// int statvfs(const char *path, struct statvfs *buf); +@@ -1184,6 +1202,9 @@ TLI_DEFINE_STRING_INTERNAL("times") + TLI_DEFINE_ENUM_INTERNAL(tmpfile) + TLI_DEFINE_STRING_INTERNAL("tmpfile") + /// FILE *tmpfile64(void) ++#ifdef tmpfile64 ++#undef tmpfile64 ++#endif + TLI_DEFINE_ENUM_INTERNAL(tmpfile64) + TLI_DEFINE_STRING_INTERNAL("tmpfile64") + /// int toascii(int c); +-- +2.13.1 + diff --git a/meta/recipes-devtools/llvm/llvm/0002-llvm-allow-env-override-of-exe-path.patch b/meta/recipes-devtools/llvm/llvm/0002-llvm-allow-env-override-of-exe-path.patch new file mode 100644 index 0000000000..832bd729ef --- /dev/null +++ b/meta/recipes-devtools/llvm/llvm/0002-llvm-allow-env-override-of-exe-path.patch @@ -0,0 +1,39 @@ +From d776487bac17650704614248d19d1e6b35775001 Mon Sep 17 00:00:00 2001 +From: Martin Kelly +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. + +Signed-off-by: Martin Kelly +Signed-off-by: Khem Raj +--- +Upstream-Status: Pending + + tools/llvm-config/llvm-config.cpp | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp +index 08b096afb05..d8d7742744e 100644 +--- a/tools/llvm-config/llvm-config.cpp ++++ b/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; +-- +2.13.1 + diff --git a/meta/recipes-devtools/llvm/llvm_git.bb b/meta/recipes-devtools/llvm/llvm_git.bb new file mode 100644 index 0000000000..fbb77212bc --- /dev/null +++ b/meta/recipes-devtools/llvm/llvm_git.bb @@ -0,0 +1,169 @@ +# Copyright (C) 2017 Khem Raj +# Released under the MIT license (see COPYING.MIT for the terms) + +DESCRIPTION = "The LLVM Compiler Infrastructure" +HOMEPAGE = "http://llvm.org" +LICENSE = "NCSA" +SECTION = "devel" + +LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=e825e017edc35cfd58e26116e5251771" + +DEPENDS = "libffi libxml2-native llvm-common zlib ninja-native" +DEPENDS_append_class-target = " llvm-native" +DEPENDS_append_class-nativesdk = " llvm-native" + +RDEPENDS_${PN}_append_class-target = " ncurses-terminfo" + +inherit perlnative pythonnative cmake pkgconfig + +PROVIDES += "llvm" + +LLVM_RELEASE = "${PV}" +LLVM_DIR = "llvm${LLVM_RELEASE}" + +SRCREV = "9a5c333388cbb54a0ce3a67c4f539f5e590a089b" +PV = "5.0" +PATCH_VERSION = "0" +SRC_URI = "git://github.com/llvm-mirror/llvm.git;branch=release_50;protocol=http \ + file://0001-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch \ + file://0002-llvm-allow-env-override-of-exe-path.patch \ + " +S = "${WORKDIR}/git" + +LLVM_INSTALL_DIR = "${WORKDIR}/llvm-install" +def get_llvm_arch(bb, d, arch_var): + import re + a = d.getVar(arch_var, True) + if re.match('(i.86|athlon|x86.64)$', a): return 'X86' + elif re.match('arm$', a): return 'ARM' + elif re.match('armeb$', a): return 'ARM' + elif re.match('aarch64$', a): return 'AArch64' + elif re.match('aarch64_be$', a): return 'AArch64' + elif re.match('mips(isa|)(32|64|)(r6|)(el|)$', a): return 'Mips' + elif re.match('p(pc|owerpc)(|64)', a): return 'PowerPC' + else: + bb.error("cannot map '%s' to a supported llvm architecture" % a) + return "" + +def get_llvm_target_arch(bb, d): + return get_llvm_arch(bb, d, 'TARGET_ARCH') +# +# Default to build all OE-Core supported target arches (user overridable). +# +LLVM_TARGETS ?= "${@get_llvm_target_arch(bb, d)}" + +EXTRA_OECMAKE += "-DLLVM_ENABLE_ASSERTIONS=OFF \ + -DLLVM_ENABLE_EXPENSIVE_CHECKS=OFF \ + -DLLVM_ENABLE_PIC=ON \ + -DLLVM_BINDINGS_LIST='' \ + -DLLVM_LINK_LLVM_DYLIB=ON \ + -DLLVM_ENABLE_FFI=OFF \ + -DLLVM_OPTIMIZED_TABLEGEN=ON \ + -DLLVM_TARGETS_TO_BUILD='${LLVM_TARGETS}' \ + -DLLVM_TARGET_ARCH=${@get_llvm_target_arch(bb, d)} \ + -G Ninja \ + " +EXTRA_OECMAKE_append_class-target = " -DLLVM_TABLEGEN=${STAGING_BINDIR_NATIVE}/llvm-tblgen" +EXTRA_OECMAKE_append_class-nativesdk = " -DLLVM_TABLEGEN=${STAGING_BINDIR_NATIVE}/llvm-tblgen" + +do_configure_prepend() { +# 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 + sed -ri "s#/(bin|include|lib)(/?\")#/\1/${LLVM_DIR}\2#g" ${S}/tools/llvm-config/llvm-config.cpp + sed -ri "s#lib/${LLVM_DIR}#${baselib}/${LLVM_DIR}#g" ${S}/tools/llvm-config/llvm-config.cpp +} + +do_compile() { + NINJA_STATUS="[%p] " ninja -v ${PARALLEL_MAKE} +} + +do_install() { + NINJA_STATUS="[%p] " DESTDIR=${LLVM_INSTALL_DIR} ninja -v install +} + +do_install_append_class-native () { + install -Dm 0755 ${B}/bin/llvm-tblgen ${D}${bindir}/llvm-tblgen +} +do_install_append_class-target() { + install ${B}/NATIVE/bin/llvm-config ${LLVM_INSTALL_DIR}/llvm-config-host + + install -d ${D}${bindir}/${LLVM_DIR} + cp -r ${LLVM_INSTALL_DIR}${bindir}/* ${D}${bindir}/${LLVM_DIR}/ + + install -d ${D}${includedir}/${LLVM_DIR} + cp -r ${LLVM_INSTALL_DIR}${includedir}/* ${D}${includedir}/${LLVM_DIR}/ + + install -d ${D}${libdir}/${LLVM_DIR} + + # The LLVM sources have "/lib" embedded and so we cannot completely rely on the ${libdir} variable + if [ -d ${LLVM_INSTALL_DIR}${libdir}/ ]; then + cp -r ${LLVM_INSTALL_DIR}${libdir}/* ${D}${libdir}/${LLVM_DIR}/ + elif [ -d ${LLVM_INSTALL_DIR}${prefix}/lib ]; then + cp -r ${LLVM_INSTALL_DIR}${prefix}/lib/* ${D}${libdir}/${LLVM_DIR}/ + elif [ -d ${LLVM_INSTALL_DIR}${prefix}/lib64 ]; then + cp -r ${LLVM_INSTALL_DIR}${prefix}/lib64/* ${D}${libdir}/${LLVM_DIR}/ + fi + + # Remove unnecessary cmake files + rm -rf ${D}${libdir}/${LLVM_DIR}/cmake + + ln -s ${LLVM_DIR}/libLLVM-${PV}${SOLIBSDEV} ${D}${libdir}/libLLVM-${PV}${SOLIBSDEV} + + # We'll have to delete the libLLVM.so due to multiple reasons... + rm -rf ${D}${libdir}/${LLVM_DIR}/libLLVM.so + rm -rf ${D}${libdir}/${LLVM_DIR}/libLTO.so +} + +PACKAGES += "${PN}-bugpointpasses ${PN}-llvmhello" +ALLOW_EMPTY_${PN} = "1" +ALLOW_EMPTY_${PN}-staticdev = "1" +FILES_${PN} = "" +FILES_${PN}-staticdev = "" +FILES_${PN}-dbg = " \ + ${bindir}/${LLVM_DIR}/.debug \ + ${libdir}/${LLVM_DIR}/.debug/BugpointPasses.so \ + ${libdir}/${LLVM_DIR}/.debug/LLVMHello.so \ + ${libdir}/${LLVM_DIR}/.debug/libLTO.so* \ + /usr/src/debug \ +" + +FILES_${PN}-dev = " \ + ${bindir}/${LLVM_DIR} \ + ${includedir}/${LLVM_DIR} \ +" +RRECOMMENDS_${PN}-dev += "${PN}-bugpointpasses ${PN}-llvmhello" + +FILES_${PN}-bugpointpasses = "\ + ${libdir}/${LLVM_DIR}/BugpointPasses.so \ +" +FILES_${PN} += "\ + ${libdir}/${LLVM_DIR}/libLTO.so.* \ +" + +FILES_${PN}-llvmhello = "\ + ${libdir}/${LLVM_DIR}/LLVMHello.so \ +" + +PACKAGES_DYNAMIC = "^libllvm${LLVM_RELEASE}-.*$" +NOAUTOPACKAGEDEBUG = "1" + +INSANE_SKIP_${MLPREFIX}libllvm${LLVM_RELEASE}-llvm-${LLVM_RELEASE}.${PATCH_VERSION} += "dev-so" +INSANE_SKIP_${MLPREFIX}libllvm${LLVM_RELEASE}-llvm-${LLVM_RELEASE} += "dev-so" +INSANE_SKIP_${MLPREFIX}libllvm${LLVM_RELEASE}-llvm += "dev-so" + +python llvm_populate_packages() { + libdir = bb.data.expand('${libdir}', d) + libllvm_libdir = bb.data.expand('${libdir}/${LLVM_DIR}', d) + split_dbg_packages = do_split_packages(d, libllvm_libdir+'/.debug', '^lib(.*)\.so$', 'libllvm${LLVM_RELEASE}-%s-dbg', 'Split debug package for %s', allow_dirs=True) + split_packages = do_split_packages(d, libdir, '^lib(.*)\.so$', 'libllvm${LLVM_RELEASE}-%s', 'Split package for %s', allow_dirs=True, allow_links=True, recursive=True) + split_staticdev_packages = do_split_packages(d, libllvm_libdir, '^lib(.*)\.a$', 'libllvm${LLVM_RELEASE}-%s-staticdev', 'Split staticdev package for %s', allow_dirs=True) + if split_packages: + pn = d.getVar('PN', True) + d.appendVar('RDEPENDS_' + pn, ' '+' '.join(split_packages)) + d.appendVar('RDEPENDS_' + pn + '-dbg', ' '+' '.join(split_dbg_packages)) + d.appendVar('RDEPENDS_' + pn + '-staticdev', ' '+' '.join(split_staticdev_packages)) +} + +PACKAGESPLITFUNCS_prepend = "llvm_populate_packages " + +BBCLASSEXTEND = "native nativesdk"