mirror of
https://git.yoctoproject.org/poky
synced 2026-01-29 21:08:42 +01:00
Brings 617a15a9eac9 [clang codegen] Fix MS ABI detection of user-provided constructors. (#90151) 20b9ed64ea07 [RISCV][ISel] Fix types in tryFoldSelectIntoOp (#90659) ece9d35f1a70 [GlobalISel] Fix store merging incorrectly classifying an unknown index expr as 0. (#90375) a7b8b890600a [X86] Enable EVEX512 when host CPU has AVX512 (#90479) 4da5b1417493 [GlobalISel] Don't form anyextending atomic loads. a96b04442c9f [AArch64] Remove invalid uabdl patterns. (#89272) aea091b70eda [clang][CoverageMapping] do not emit a gap region when either end doesn't have valid source locations (#89564) 58648f334d62 [X86][EVEX512] Check hasEVEX512 for canExtendTo512DQ (#90390) 6350acdb134d [CGP] Drop poison-generating flags after hoisting (#90382) f341c76b9461 [Clang] Handle structs with inner structs and no fields (#89126) abf6b13085fb [IRCE] Skip icmp ptr in InductiveRangeCheck::parseRangeCheckICmp (#89967) ee5bb0c95667 Fix Objective-C++ Sret of non-trivial data types on Windows ARM64 (#88671) 6dbaa89433f7 [clang-format] Fix a regression in ContinuationIndenter (#88414) 51ff7f38b633 [clang-format] Fix a regression in annotating TrailingReturnArrow (#86624) b544217fb31f [AMDGPU] Fix setting nontemporal in memory legalizer (#83815) 78b99c73ee4b [DAGCombiner] Fix miscompile bug in combineShiftOfShiftedLogic (#89616) 1aa91720cc4f [DAGCombiner] Pre-commit test case for miscompile bug in combineShiftOfShiftedLogic 35fea1032741 release/18.x: [clang-format] Correctly annotate braces in macros (#87953) b9b73814ad8a [libcxx] [modules] Add _LIBCPP_USING_IF_EXISTS on aligned_alloc (#89827) c0b48372d82a release/18.x: [clang-format] Revert breaking stream operators to previous default (#89016) 3b4ba7277bd7 [analyzer] Fix performance of getTaintedSymbolsImpl() (#89606) 7699b341b763 release/18.x: [clang-format] Fix a regression in annotating BK_BracedInit (#87450) fb865928c8e0 [GlobalISel] Fix fewerElementsVectorPhi to insert after G_PHIs (#87927) 111ae4509c96 [X86] Fix miscompile in combineShiftRightArithmetic 76cbd417af50 [X86] Pre-commit tests (NFC) e7c816b3cd3e [InstCombine] Fix unexpected overwriting in foldSelectWithSRem (#89539) 3685a599c866 ReleaseNote: Mention SpecialCaseList change (#89141) a981a4f7653c [X86] Always use 64-bit relocations in no-PIC large code model (#89101) 4ddac856c55f [analyzer] Fix a security.cert.env.InvalidPtr crash c6d63d4fc555 Bump version to 18.1.5 (#89291) (From OE-Core rev: 02df2fc6241ac8fb0e78f2fdff97a04e5c561d54) (From OE-Core rev: b01e94690c3c29cd1e666e671c98e500c13e1942) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Peter Marko <peter.marko@siemens.com> Signed-off-by: Steve Sakoman <steve@sakoman.com>
179 lines
6.0 KiB
BlitzBasic
179 lines
6.0 KiB
BlitzBasic
# Copyright (C) 2017 Khem Raj <raj.khem@gmail.com>
|
|
# Released under the MIT license (see COPYING.MIT for the terms)
|
|
|
|
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 zstd libedit ninja-native llvm-native"
|
|
|
|
RDEPENDS:${PN}:append:class-target = " ncurses-terminfo"
|
|
|
|
inherit cmake pkgconfig
|
|
|
|
# could be 'rcX' or 'git' or empty ( for release )
|
|
VER_SUFFIX = ""
|
|
|
|
PV = "18.1.5${VER_SUFFIX}"
|
|
|
|
MAJOR_VERSION = "${@oe.utils.trim_version("${PV}", 1)}"
|
|
|
|
LLVM_RELEASE = "${PV}"
|
|
|
|
BRANCH = "release/${MAJOR_VERSION}.x"
|
|
SRCREV = "617a15a9eac96088ae5e9134248d8236e34b91b1"
|
|
SRC_URI = "git://github.com/llvm/llvm-project.git;branch=${BRANCH};protocol=https \
|
|
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+)+)"
|
|
|
|
S = "${WORKDIR}/git/llvm"
|
|
|
|
LLVM_INSTALL_DIR = "${WORKDIR}/llvm-install"
|
|
|
|
def get_llvm_arch(bb, d, arch_var):
|
|
import re
|
|
a = d.getVar(arch_var)
|
|
if re.match(r'(i.86|athlon|x86.64)$', a): return 'X86'
|
|
elif re.match(r'arm$', a): return 'ARM'
|
|
elif re.match(r'armeb$', a): return 'ARM'
|
|
elif re.match(r'aarch64$', a): return 'AArch64'
|
|
elif re.match(r'aarch64_be$', a): return 'AArch64'
|
|
elif re.match(r'mips(isa|)(32|64|)(r6|)(el|)$', a): return 'Mips'
|
|
elif re.match(r'riscv(32|64)(eb|)$', a): return 'RISCV'
|
|
elif re.match(r'p(pc|owerpc)(|64)', a): return 'PowerPC'
|
|
else:
|
|
raise bb.parse.SkipRecipe("Cannot map '%s' to a supported LLVM architecture" % a)
|
|
|
|
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).
|
|
#
|
|
LLVM_TARGETS ?= "AMDGPU;${@get_llvm_host_arch(bb, d)}"
|
|
|
|
ARM_INSTRUCTION_SET:armv5 = "arm"
|
|
ARM_INSTRUCTION_SET:armv4t = "arm"
|
|
|
|
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=ON \
|
|
-DLLVM_ENABLE_RTTI=ON \
|
|
-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 \
|
|
-DCMAKE_BUILD_TYPE=Release \
|
|
"
|
|
|
|
EXTRA_OECMAKE:append:class-target = "\
|
|
-DCMAKE_CROSSCOMPILING:BOOL=ON \
|
|
-DLLVM_TABLEGEN=${STAGING_BINDIR_NATIVE}/llvm-tblgen${PV} \
|
|
-DLLVM_CONFIG_PATH=${STAGING_BINDIR_NATIVE}/llvm-config${PV} \
|
|
"
|
|
|
|
EXTRA_OECMAKE:append:class-nativesdk = "\
|
|
-DCMAKE_CROSSCOMPILING:BOOL=ON \
|
|
-DLLVM_TABLEGEN=${STAGING_BINDIR_NATIVE}/llvm-tblgen${PV} \
|
|
-DLLVM_CONFIG_PATH=${STAGING_BINDIR_NATIVE}/llvm-config${PV} \
|
|
"
|
|
|
|
# patch out build host paths for reproducibility
|
|
do_compile:prepend:class-target() {
|
|
sed -i -e "s,${WORKDIR},,g" ${B}/tools/llvm-config/BuildVariables.inc
|
|
}
|
|
|
|
do_compile() {
|
|
if ${@bb.utils.contains('PACKAGECONFIG', 'libllvm', 'true', 'false', d)}; then
|
|
ninja -v ${PARALLEL_MAKE}
|
|
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
|
|
mv -T -n ${D}/${prefix}/lib ${D}/${libdir} || true
|
|
|
|
# Remove opt-viewer: https://llvm.org/docs/Remarks.html
|
|
rm -rf ${D}${datadir}/opt-viewer
|
|
rmdir ${D}${datadir}
|
|
|
|
# reproducibility
|
|
sed -i -e 's,${WORKDIR},,g' ${D}/${libdir}/cmake/llvm/LLVMConfig.cmake
|
|
fi
|
|
}
|
|
|
|
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"
|
|
|
|
RRECOMMENDS:${PN}-dev += "${PN}-bugpointpasses ${PN}-llvmhello ${PN}-liboptremarks"
|
|
|
|
FILES:${PN}-bugpointpasses = "\
|
|
${libdir}/BugpointPasses.so \
|
|
"
|
|
|
|
FILES:${PN}-libllvm = "\
|
|
${libdir}/libLLVM-${MAJOR_VERSION}.so \
|
|
${libdir}/libLLVM.so.${MAJOR_VER}.${MINOR_VER} \
|
|
"
|
|
|
|
FILES:${PN}-liblto += "\
|
|
${libdir}/libLTO.so.* \
|
|
"
|
|
|
|
FILES:${PN}-liboptremarks += "\
|
|
${libdir}/libRemarks.so.* \
|
|
"
|
|
|
|
FILES:${PN}-llvmhello = "\
|
|
${libdir}/LLVMHello.so \
|
|
"
|
|
|
|
FILES:${PN}-dev += " \
|
|
${libdir}/llvm-config \
|
|
${libdir}/libRemarks.so \
|
|
${libdir}/libLLVM-${PV}.so \
|
|
"
|
|
|
|
FILES:${PN}-staticdev += "\
|
|
${libdir}/*.a \
|
|
"
|
|
|
|
INSANE_SKIP:${PN}-libllvm += "dev-so"
|
|
|
|
BBCLASSEXTEND = "native nativesdk"
|