summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/llvm/llvm_git.bb
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/llvm/llvm_git.bb')
-rw-r--r--meta/recipes-devtools/llvm/llvm_git.bb47
1 files changed, 32 insertions, 15 deletions
diff --git a/meta/recipes-devtools/llvm/llvm_git.bb b/meta/recipes-devtools/llvm/llvm_git.bb
index 0b5301cbff..e7fa88b30e 100644
--- a/meta/recipes-devtools/llvm/llvm_git.bb
+++ b/meta/recipes-devtools/llvm/llvm_git.bb
@@ -1,36 +1,34 @@
# Copyright (C) 2017 Khem Raj <raj.khem@gmail.com>
# Released under the MIT license (see COPYING.MIT for the terms)
-DESCRIPTION = "The LLVM Compiler Infrastructure"
+SUMMARY = "The LLVM Compiler Infrastructure"
HOMEPAGE = "http://llvm.org"
LICENSE = "Apache-2.0-with-LLVM-exception"
SECTION = "devel"
LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=8a15a0759ef07f2682d2ba4b893c9afe"
-DEPENDS = "libffi libxml2 zlib libedit ninja-native llvm-native"
-
-COMPATIBLE_HOST:riscv64 = "null"
-COMPATIBLE_HOST:riscv32 = "null"
+DEPENDS = "libffi libxml2 zlib zstd libedit ninja-native llvm-native"
RDEPENDS:${PN}:append:class-target = " ncurses-terminfo"
inherit cmake pkgconfig
-PROVIDES += "llvm${PV}"
+# could be 'rcX' or 'git' or empty ( for release )
+VER_SUFFIX = ""
-PV = "14.0.3"
+PV = "18.1.4${VER_SUFFIX}"
MAJOR_VERSION = "${@oe.utils.trim_version("${PV}", 1)}"
LLVM_RELEASE = "${PV}"
BRANCH = "release/${MAJOR_VERSION}.x"
-SRCREV = "1f9140064dfbfb0bbda8e51306ea51080b2f7aac"
+SRCREV = "e6c3289804a67ea0bb6a86fadbe454dd93b8d855"
SRC_URI = "git://github.com/llvm/llvm-project.git;branch=${BRANCH};protocol=https \
- file://0006-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch;striplevel=2 \
file://0007-llvm-allow-env-override-of-exe-path.patch;striplevel=2 \
file://0001-AsmMatcherEmitter-sort-ClassInfo-lists-by-name-as-we.patch;striplevel=2 \
+ file://llvm-config \
"
UPSTREAM_CHECK_GITTAGREGEX = "llvmorg-(?P<pver>\d+(\.\d+)+)"
@@ -56,6 +54,12 @@ def get_llvm_arch(bb, d, arch_var):
def get_llvm_host_arch(bb, d):
return get_llvm_arch(bb, d, 'HOST_ARCH')
+PACKAGECONFIG ??= "libllvm"
+PACKAGECONFIG:class-native = "${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'libllvm', '', d)}"
+# if optviewer OFF, force the modules to be not found or the ones on the host would be found
+PACKAGECONFIG[optviewer] = ",-DPY_PYGMENTS_FOUND=OFF -DPY_PYGMENTS_LEXERS_C_CPP_FOUND=OFF -DPY_YAML_FOUND=OFF,python3-pygments python3-pyyaml,python3-pygments python3-pyyaml"
+PACKAGECONFIG[libllvm] = ""
+
#
# Default to build all OE-Core supported target arches (user overridable).
#
@@ -74,9 +78,10 @@ EXTRA_OECMAKE += "-DLLVM_ENABLE_ASSERTIONS=OFF \
-DFFI_INCLUDE_DIR=$(pkg-config --variable=includedir libffi) \
-DLLVM_OPTIMIZED_TABLEGEN=ON \
-DLLVM_TARGETS_TO_BUILD='${LLVM_TARGETS}' \
+ -DLLVM_VERSION_SUFFIX='${VER_SUFFIX}' \
-DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN=ON \
- -DPYTHON_EXECUTABLE=${HOSTTOOLS_DIR}/python3 \
- -G Ninja"
+ -DCMAKE_BUILD_TYPE=Release \
+ "
EXTRA_OECMAKE:append:class-target = "\
-DCMAKE_CROSSCOMPILING:BOOL=ON \
@@ -96,14 +101,15 @@ do_compile:prepend:class-target() {
}
do_compile() {
+ if ${@bb.utils.contains('PACKAGECONFIG', 'libllvm', 'true', 'false', d)}; then
ninja -v ${PARALLEL_MAKE}
-}
-
-do_compile:class-native() {
+ else
ninja -v ${PARALLEL_MAKE} llvm-config llvm-tblgen
+ fi
}
do_install() {
+ if ${@bb.utils.contains('PACKAGECONFIG', 'libllvm', 'true', 'false', d)}; then
DESTDIR=${D} ninja -v install
# llvm harcodes usr/lib as install path, so this corrects it to actual libdir
@@ -115,11 +121,21 @@ do_install() {
# reproducibility
sed -i -e 's,${WORKDIR},,g' ${D}/${libdir}/cmake/llvm/LLVMConfig.cmake
+ fi
}
-do_install:class-native() {
+do_install:append:class-native() {
install -D -m 0755 ${B}/bin/llvm-tblgen ${D}${bindir}/llvm-tblgen${PV}
install -D -m 0755 ${B}/bin/llvm-config ${D}${bindir}/llvm-config${PV}
+ ln -sf llvm-config${PV} ${D}${bindir}/llvm-config
+}
+
+SYSROOT_PREPROCESS_FUNCS:append:class-target = " llvm_sysroot_preprocess"
+
+llvm_sysroot_preprocess() {
+ install -d ${SYSROOT_DESTDIR}${bindir_crossscripts}/
+ install -m 0755 ${WORKDIR}/llvm-config ${SYSROOT_DESTDIR}${bindir_crossscripts}/
+ ln -sf llvm-config ${SYSROOT_DESTDIR}${bindir_crossscripts}/llvm-config${PV}
}
PACKAGES =+ "${PN}-bugpointpasses ${PN}-llvmhello ${PN}-libllvm ${PN}-liboptremarks ${PN}-liblto"
@@ -132,6 +148,7 @@ FILES:${PN}-bugpointpasses = "\
FILES:${PN}-libllvm = "\
${libdir}/libLLVM-${MAJOR_VERSION}.so \
+ ${libdir}/libLLVM.so.${MAJOR_VER}.${MINOR_VER} \
"
FILES:${PN}-liblto += "\