mirror of
https://git.yoctoproject.org/poky
synced 2026-06-03 01:40:07 +00:00
llvm: allow building libllvm in native builds, subject to PACKAGECONFIG
Also, enable that, if opengl is in native DISTRO_FEATURES: this allows mesa-native to build drivers that rely on libllvm, particularly llvmpipe, which is a (sort of) accelerated software renderer that is the only option on build hosts without dedicated or supported GPUs. (From OE-Core rev: ec22bfa67f6f1766102501d4593ce29aafe8c166) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
b576cd5d84
commit
8cf1c4cd42
@@ -57,9 +57,11 @@ def get_llvm_arch(bb, d, arch_var):
|
|||||||
def get_llvm_host_arch(bb, d):
|
def get_llvm_host_arch(bb, d):
|
||||||
return get_llvm_arch(bb, d, 'HOST_ARCH')
|
return get_llvm_arch(bb, d, 'HOST_ARCH')
|
||||||
|
|
||||||
PACKAGECONFIG ??= ""
|
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
|
# 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[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).
|
# Default to build all OE-Core supported target arches (user overridable).
|
||||||
@@ -102,14 +104,15 @@ do_compile:prepend:class-target() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
do_compile() {
|
do_compile() {
|
||||||
|
if ${@bb.utils.contains('PACKAGECONFIG', 'libllvm', 'true', 'false', d)}; then
|
||||||
ninja -v ${PARALLEL_MAKE}
|
ninja -v ${PARALLEL_MAKE}
|
||||||
}
|
else
|
||||||
|
|
||||||
do_compile:class-native() {
|
|
||||||
ninja -v ${PARALLEL_MAKE} llvm-config llvm-tblgen
|
ninja -v ${PARALLEL_MAKE} llvm-config llvm-tblgen
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
do_install() {
|
do_install() {
|
||||||
|
if ${@bb.utils.contains('PACKAGECONFIG', 'libllvm', 'true', 'false', d)}; then
|
||||||
DESTDIR=${D} ninja -v install
|
DESTDIR=${D} ninja -v install
|
||||||
|
|
||||||
# llvm harcodes usr/lib as install path, so this corrects it to actual libdir
|
# llvm harcodes usr/lib as install path, so this corrects it to actual libdir
|
||||||
@@ -121,9 +124,10 @@ do_install() {
|
|||||||
|
|
||||||
# reproducibility
|
# reproducibility
|
||||||
sed -i -e 's,${WORKDIR},,g' ${D}/${libdir}/cmake/llvm/LLVMConfig.cmake
|
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-tblgen ${D}${bindir}/llvm-tblgen${PV}
|
||||||
install -D -m 0755 ${B}/bin/llvm-config ${D}${bindir}/llvm-config${PV}
|
install -D -m 0755 ${B}/bin/llvm-config ${D}${bindir}/llvm-config${PV}
|
||||||
ln -sf llvm-config${PV} ${D}${bindir}/llvm-config
|
ln -sf llvm-config${PV} ${D}${bindir}/llvm-config
|
||||||
|
|||||||
Reference in New Issue
Block a user