summaryrefslogtreecommitdiffstats
path: root/meta/recipes-graphics/mesa
diff options
context:
space:
mode:
authorAlexander Kanavin <alex.kanavin@gmail.com>2022-11-14 20:00:56 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-11-15 09:38:38 +0000
commit44bb88cc869f3b42440d6f7aad000e706b739a2b (patch)
tree5a6a2404118f958e567c182da8950560efacd0be /meta/recipes-graphics/mesa
parente8a9e74903763e244b2683fb1ffdeaacaf86363f (diff)
downloadpoky-44bb88cc869f3b42440d6f7aad000e706b739a2b.tar.gz
mesa: do not rely on native llvm-config in target sysroot
Sadly the magic is not perfect: llvm-config contains a hardcoded value for the libdir from the native configuration, and things will break if the target build installs libraries somewhere else (e.g. lib64). llvm-config in target bindir also needs a rpath adjustment, otherwise it simply won't even run when e.g. building for arm on x86. To avoid patching llvm-source let's simply add more cases to the llvm-config wrapper script, so that falling through to llvm-config binary is avoided. Fortunately those cases are all static in what they return, even though llvm-config binary does poke around the file tree to arrive at them (which is where breakage happens if native and target don't match exactly wrt libdir). I verified that this works by building mesa with llvm enabled for qemuarm64 and with baselib set to 'lib64' - so that both the target architecture and target libdir differ from native ones. Upstream tickets: https://github.com/llvm/llvm-project/issues/58984 https://github.com/mesonbuild/meson/issues/11043 (From OE-Core rev: 056431883e94296b767a479d029b914392e4fd7c) 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>
Diffstat (limited to 'meta/recipes-graphics/mesa')
-rw-r--r--meta/recipes-graphics/mesa/mesa.inc10
1 files changed, 0 insertions, 10 deletions
diff --git a/meta/recipes-graphics/mesa/mesa.inc b/meta/recipes-graphics/mesa/mesa.inc
index 6246b723cf..1949fc15a9 100644
--- a/meta/recipes-graphics/mesa/mesa.inc
+++ b/meta/recipes-graphics/mesa/mesa.inc
@@ -55,17 +55,7 @@ ANY_OF_DISTRO_FEATURES:class-target = "opengl vulkan"
55 55
56PLATFORMS ??= "${@bb.utils.filter('PACKAGECONFIG', 'x11 wayland', d)}" 56PLATFORMS ??= "${@bb.utils.filter('PACKAGECONFIG', 'x11 wayland', d)}"
57 57
58# By placing llvm-config in the target sysroot bindir, it will then map values
59# to the target libdir magically. We can safely add to path as there are no other binaries
60# there.
61PATH:prepend = "${STAGING_BINDIR_CROSS}:${STAGING_BINDIR}:"
62MESA_LLVM_RELEASE ?= "${LLVMVERSION}" 58MESA_LLVM_RELEASE ?= "${LLVMVERSION}"
63do_configure:prepend () {
64 if [ -e ${STAGING_BINDIR_NATIVE}/llvm-config${MESA_LLVM_RELEASE} ]; then
65 cp ${STAGING_BINDIR_NATIVE}/llvm-config${MESA_LLVM_RELEASE} ${STAGING_BINDIR}
66 cp ${STAGING_BINDIR_NATIVE}/llvm-config ${STAGING_BINDIR}
67 fi
68}
69 59
70# set the MESA_BUILD_TYPE to either 'release' (default) or 'debug' 60# set the MESA_BUILD_TYPE to either 'release' (default) or 'debug'
71# by default the upstream mesa sources build a debug release 61# by default the upstream mesa sources build a debug release