From: Alexander Kanavin <alex.kanavin@gmail.com>
To: openembedded-core@lists.openembedded.org
Cc: Alexander Kanavin <alex@linutronix.de>
Subject: [PATCH 4/6] llvm: allow building libllvm in native builds, subject to PACKAGECONFIG
Date: Thu, 16 Mar 2023 10:41:00 +0100 [thread overview]
Message-ID: <20230316094102.2628727-4-alex@linutronix.de> (raw)
In-Reply-To: <20230316094102.2628727-1-alex@linutronix.de>
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.
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
---
meta/recipes-devtools/llvm/llvm_git.bb | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/meta/recipes-devtools/llvm/llvm_git.bb b/meta/recipes-devtools/llvm/llvm_git.bb
index b4e983d2d0..f133653903 100644
--- a/meta/recipes-devtools/llvm/llvm_git.bb
+++ b/meta/recipes-devtools/llvm/llvm_git.bb
@@ -57,9 +57,11 @@ def get_llvm_arch(bb, d, arch_var):
def get_llvm_host_arch(bb, d):
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
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).
@@ -102,14 +104,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
@@ -121,9 +124,10 @@ 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
--
2.30.2
next prev parent reply other threads:[~2023-03-16 9:41 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-16 9:40 [PATCH 1/6] runqemu: direct mesa to use its own drivers, rather than ones provided by host distro Alexander Kanavin
2023-03-16 9:40 ` [PATCH 2/6] mesa: allow mesa-native/nativesdk only subject to opengl/vulkan DISTRO_FEATURE Alexander Kanavin
2023-03-16 9:40 ` [PATCH 3/6] mesa: enable a rich set of drivers for native builds Alexander Kanavin
2023-03-20 17:10 ` [OE-core] " Ross Burton
2023-03-20 17:41 ` Alexander Kanavin
2024-08-02 17:52 ` Marko, Peter
2024-08-03 5:13 ` Böszörményi Zoltán
2023-03-16 9:41 ` Alexander Kanavin [this message]
2023-03-20 16:20 ` [OE-core] [PATCH 4/6] llvm: allow building libllvm in native builds, subject to PACKAGECONFIG Ross Burton
2023-03-20 17:36 ` Alexander Kanavin
2023-03-16 9:41 ` [PATCH 5/6] mesa: do not strip rpaths from dri drivers Alexander Kanavin
2023-03-16 9:41 ` [PATCH 6/6] mesa: update 22.3.5 -> 23.0.0 Alexander Kanavin
2023-03-18 2:47 ` [OE-core] " Khem Raj
2023-03-18 8:01 ` Alexander Kanavin
2023-03-18 18:37 ` Khem Raj
2023-03-18 18:57 ` Martin Jansa
2023-03-20 7:09 ` Alexander Kanavin
2023-03-20 10:01 ` Richard Purdie
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230316094102.2628727-4-alex@linutronix.de \
--to=alex.kanavin@gmail.com \
--cc=alex@linutronix.de \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox