mirror of
https://git.yoctoproject.org/poky
synced 2026-02-09 02:03:04 +01:00
Brings following fixes * e6c3289804a6 [CMake][Release] Disable PGO (#88465) (#89000) * 028e425f86cc [MIPS] Fix the opcode of max.fmt and mina.fmt (#85609) * e3c832b37b0a Fix override keyword being print to the left side * 1deeee3f5da4 Revert "[Mips] Fix missing sign extension in expansion of sub-word atomic max (#77072)" * 995539ce05ba [LLD] [COFF] Don't add pseudo relocs for dangling references (#88487) * db67e6fb9ad1 [libc++] Fix -Wgnu-include-next in stddef.h (#88214) * 647fbc710840 [SelectionDAG] Prevent combination on inconsistent type in `combineCarryDiamond` (#84888) * eaae766a20fd [RISCV] Support rv{32, 64}e in the compiler builtins (#88252) * c24b41d71f2e github-upload-release.py: Fix bug preventing release creation (#84571) * c837970dd7e9 [Codegen][X86] Fix /HOTPATCH with clang-cl and inline asm (#87639) * d0ddcce21d91 [InstSimplify] Make sure the simplified value doesn't generate poison in threadBinOpOverSelect (#87075) * 4056cc29dfd3 Prepend all library intrinsics with `#` when building for Arm64EC (#87542) * 6e071cf30599 [SLP]Fix a crash if the argument of call was affected by minbitwidth analysis. * d89da2ac8839 [libcxx] coerce formatter precision to int (#87738) * b6ebea7972cd [SPARC] Implement L and H inline asm argument modifiers (#87259) * bffecba7ce4c [libc++] Simplify the implementation of <stddef.h> (#86843) * 9899a2d76c8f [lit][ci] Publish lit wheels (#88072) * 3ceccbdb1995 [clang-format] Correctly annotate braces of empty ctors/dtors (#82097) * 429d62872525 [Headers] Don't declare unreachable() from stddef.h in C++ (#86748) * feba8727f805 [ConstantRange] Fix off by 1 bugs in UIToFP and SIToFP handling. (#86041) * e4259b583c92 [Float2Int] Pre-commit test for SIToFP/UIToFP ConstantRange bug. NFC * daca56d8e162 Bump version to 18.1.4 (#87715) (From OE-Core rev: adc2651a8e902af24fee6ff30a72f4b7c63bef6f) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
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.4${VER_SUFFIX}"
|
|
|
|
MAJOR_VERSION = "${@oe.utils.trim_version("${PV}", 1)}"
|
|
|
|
LLVM_RELEASE = "${PV}"
|
|
|
|
BRANCH = "release/${MAJOR_VERSION}.x"
|
|
SRCREV = "e6c3289804a67ea0bb6a86fadbe454dd93b8d855"
|
|
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"
|