Skip to content

Commit 5c540d5

Browse files
shr-projectagherzan
authored andcommitted
mesa, wayland-protocols: use separate recipe instead of bbappend
Fix #1484 Avoid llvm runtime dependency to avoid issues in builds with meta-clang: ERROR: Multiple .bb files are due to be built which each provide llvm: meta-clang/recipes-devtools/clang/clang_git.bb oe-core/meta/recipes-devtools/llvm/llvm_18.1.6.bb A list of tasks depending on these providers is shown and may help explain where the dependency comes from. meta-clang/recipes-devtools/clang/clang_git.bb has unique dependees: oe-core/meta/recipes-graphics/mesa/mesa_24.0.7.bb:do_prepare_recipe_sysroot oe-core/meta/recipes-graphics/mesa/mesa_24.0.7.bb:do_package meta-atlas/meta-atlas/recipes-core/images/atlas-image-video.bb:do_populate_lic_deploy oe-core/meta/recipes-graphics/mesa/mesa_24.0.7.bb:do_collect_spdx_deps meta-atlas/meta-atlas/recipes-core/images/atlas-image-video.bb:do_populate_interfaces_deploy oe-core/meta/recipes-devtools/llvm/llvm_18.1.6.bb has unique dependees: oe-core/meta/recipes-graphics/mesa/mesa_24.0.7.bb:do_package_qa oe-core/meta/recipes-graphics/mesa/mesa_24.0.7.bb:do_create_runtime_spdx It could be that one recipe provides something the other doesn't and should. The following provider and runtime provider differences may be helpful. meta-clang/recipes-devtools/clang/clang_git.bb has unique provides: clang meta-clang/recipes-devtools/clang/clang_git.bb has unique rprovides: clang-dbg clang-libclang-cpp liblldb llvm-linker-tools ^clang-locale-.* clang-libllvm lldb clang-format clang clang-dev clang-locale clang-lldb-python libclang clang-src clang-doc clang-staticdev lldb-server clang-tidy clang-tools oe-core/meta/recipes-devtools/llvm/llvm_18.1.6.bb has unique provides: oe-core/meta/recipes-devtools/llvm/llvm_18.1.6.bb has unique rprovides: llvm llvm-dbg llvm-libllvm llvm-src llvm-dev llvm-liboptremarks llvm-locale llvm-llvmhello llvm-liblto llvm-staticdev llvm-bugpointpasses llvm-doc ^llvm-locale-.* check_data_file_clashes: Package clang-libllvm wants to install file rootfs/usr/lib/libLLVM.so.18.1 But that file is already provided by package * llvm Also avoid: python __anonymous() { if d.getVar('SOC_FAMILY') == 'rpi' and d.getVar("PN") == d.getVar("BPN"): d.setVarFlag("SRC_URI", "sha256sum", "4d2b2a9e3e099d017dc8107bf1c334d27bb87d9e4aff19a0c8d856d17cd41ef0") } This doesn't work for multilib builds where PN != BPN (e.g. lib32-wayland-protocols) It is easier to just add separate recipes with COMPATIBLE_MACHINE restriction instead of modifying the recipes for all MACHINEs with bbappend and then trying to limit it to rpi MACHINEs with overrides (e.g. why is whole recipe duplicated in wayland-protocols bbappend doesn't make any sense to me). breakage like this in stable branches is bad, these bbappends are hard to avoid (without BBMASKing them and then reintroducing the necessary part of original mesa bbappend). Now with separate recipes people can at least opt-out by setting P_V to original scarthgap versions: PREFERRED_VERSION_mesa:rpi = "24.%" PREFERRED_VERSION_wayland-protocols:rpi = "1.33" Signed-off-by: Martin Jansa <[email protected]>
1 parent 3a39209 commit 5c540d5

7 files changed

+457
-76
lines changed
Lines changed: 5 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,6 @@
1-
FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
2-
3-
LIC_FILES_CHKSUM:rpi = "file://docs/license.rst;md5=ffe678546d4337b732cfd12262e6af11"
4-
5-
PACKAGECONFIG:append:rpi = " gallium gallium-llvm vc4 v3d ${@bb.utils.contains('DISTRO_FEATURES', 'x11 opengl', 'x11', '', d)} ${@bb.utils.contains('DISTRO_FEATURES', 'vulkan', 'vulkan broadcom', '', d)}"
6-
DRIDRIVERS:class-target:rpi = ""
7-
8-
# Remove unused patches
9-
SRC_URI:rpi = "https://mesa.freedesktop.org/archive/mesa-${PV}.tar.xz \
10-
file://0001-meson-misdetects-64bit-atomics-on-mips-clang.patch \
11-
file://0001-freedreno-don-t-encode-build-path-into-binaries.patch \
12-
file://0001-dont-build-clover-frontend.patch \
13-
"
14-
15-
PV:rpi = "25.1.6"
16-
17-
python __anonymous() {
18-
if d.getVar('SOC_FAMILY') == 'rpi' and d.getVar("PN") == d.getVar("BPN"):
19-
d.setVarFlag("SRC_URI", "sha256sum", "9f2b69eb39d2d8717d30a9868fdda3e0c0d3708ba32778bbac8ddb044538ce84")
20-
}
21-
221
# DRI3 note:
23-
# DRI3 Build option is removed from meson.
24-
PACKAGECONFIG:remove:rpi = "dri3"
25-
26-
VULKAN_DRIVERS_AMD:rpi = "${@bb.utils.contains('PACKAGECONFIG', 'amd', ',amd', '', d)}"
27-
VULKAN_DRIVERS_ASAHI:rpi = "${@bb.utils.contains('PACKAGECONFIG', 'asahi libclc opencl', ',asahi', '', d)}"
28-
VULKAN_DRIVERS_INTEL:rpi = "${@bb.utils.contains('PACKAGECONFIG', 'intel libclc', ',intel', '', d)}"
29-
VULKAN_DRIVERS_SWRAST:rpi = ",swrast"
30-
# Crashes on x32
31-
VULKAN_DRIVERS_SWRAST:x86-x32 = ""
32-
VULKAN_DRIVERS_LLVM:rpi = "${VULKAN_DRIVERS_SWRAST}${VULKAN_DRIVERS_AMD}${VULKAN_DRIVERS_ASAHI}${VULKAN_DRIVERS_INTEL}"
33-
34-
EXTRA_OEMESON:remove:rpi = "-Ddri3=disabled"
35-
EXTRA_OEMESON:remove:rpi = "-Dopencl-spirv=false"
36-
# -Dglvnd is deprecated from true/false to enabled/disabled
37-
EXTRA_OEMESON:remove:rpi = "-Dglvnd=false"
38-
EXTRA_OEMESON:append:rpi = " -Dglvnd=disabled"
39-
40-
GALLIUMDRIVERS:rpi = "softpipe"
41-
42-
DEPENDS:append:rpi = " \
43-
${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'wayland-protocols', '', d)} \
44-
llvm \
45-
python3-pyyaml \
46-
python3-pyyaml-native \
47-
"
48-
49-
RDEPENDS:libgl-mesa:rpi += " \
50-
llvm \
51-
${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'wayland-protocols', '', d)} \
52-
"
53-
54-
PACKAGES:append:rpi = " \
55-
libgallium \
56-
"
57-
58-
FILES:libgbm:rpi = "${libdir}/libgbm.so.* ${libdir}/gbm/*_gbm.so"
59-
FILES:libgbm-dev:rpi = "${libdir}/libgbm.* ${libdir}/pkgconfig/gbm.pc ${includedir}/gbm.h ${includedir}/gbm_backend_abi.h"
60-
FILES:libgallium:rpi = "${libdir}/libgallium-*.so"
61-
62-
FILES:libgl-mesa:append:rpi = " ${libdir}/libgallium*.so"
63-
64-
FILES:libgbm-dev:append:rpi = " ${includedir}/gbm.h"
65-
66-
# All DRI drivers are symlinks to libdril_dri.so
67-
INSANE_SKIP:${PN}-megadriver += "dev-so"
2+
# With oe-core commit 8509e2e1a87578882b71948ccef3b50ccf1228b3 dri3 is set
3+
# as default. To state out clearly that Raspi needs dri3 and to avoid surprises
4+
# in case oe-core changes this default, we set dri3 explicitly.
5+
PACKAGECONFIG:append:rpi = " gallium vc4 v3d kmsro ${@bb.utils.contains('DISTRO_FEATURES', 'x11 opengl', 'x11 dri3', '', d)} ${@bb.utils.contains('DISTRO_FEATURES', 'vulkan', 'vulkan broadcom', '', d)}"
6+
DRIDRIVERS:class-target:rpi = ""

recipes-graphics/mesa/files/0001-dont-build-clover-frontend.patch renamed to recipes-graphics/mesa/mesa/0001-dont-build-clover-frontend.patch

File renamed without changes.
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
From 531c6696d42953cd642dea7bf70153285c7949ae Mon Sep 17 00:00:00 2001
2+
From: =?UTF-8?q?Kai=20Wasserb=C3=A4ch?= <[email protected]>
3+
Date: Tue, 6 May 2025 14:36:57 +0200
4+
Subject: [PATCH] fix(FTBFS): clc: switch to new non-owned `TargetOptions` for
5+
LLVM 21
6+
MIME-Version: 1.0
7+
Content-Type: text/plain; charset=UTF-8
8+
Content-Transfer-Encoding: 8bit
9+
10+
Upstream hid the `TargetOptions` in commit 985410f87f2d19910a8d327527fd30062b042b63
11+
12+
Use the new `getTargetOpts()` to obtain the `TargetOptions` for
13+
`setTarget()`.
14+
15+
Upstream-Status: Backport [https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34835]
16+
17+
Signed-off-by: Kai Wasserbäch <[email protected]>
18+
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13079
19+
Reference: https://github.com/llvm/llvm-project/commit/985410f87f2d19910a8d327527fd30062b042b63
20+
Reviewed-by: Karol Herbst <[email protected]>
21+
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34835>
22+
---
23+
src/compiler/clc/clc_helpers.cpp | 4 ++++
24+
1 file changed, 4 insertions(+)
25+
26+
--- a/src/compiler/clc/clc_helpers.cpp
27+
+++ b/src/compiler/clc/clc_helpers.cpp
28+
@@ -874,7 +874,11 @@ clc_compile_to_llvm_module(LLVMContext &
29+
diag_opts));
30+
31+
c->setTarget(clang::TargetInfo::CreateTargetInfo(
32+
+#if LLVM_VERSION_MAJOR >= 21
33+
+ c->getDiagnostics(), c->getInvocation().getTargetOpts()));
34+
+#else
35+
c->getDiagnostics(), c->getInvocation().TargetOpts));
36+
+#endif
37+
38+
c->getFrontendOpts().ProgramAction = clang::frontend::EmitLLVMOnly;
39+

recipes-graphics/mesa/files/0001-freedreno-don-t-encode-build-path-into-binaries.patch renamed to recipes-graphics/mesa/mesa/0001-freedreno-don-t-encode-build-path-into-binaries.patch

File renamed without changes.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
From 02cc21800fe29f566add525e63f619c0536d6e7b Mon Sep 17 00:00:00 2001
2+
From: Khem Raj <[email protected]>
3+
Date: Mon, 13 Jan 2020 15:23:47 -0800
4+
Subject: [PATCH] meson misdetects 64bit atomics on mips/clang
5+
6+
Upstream-Status: Pending
7+
Signed-off-by: Khem Raj <[email protected]>
8+
---
9+
src/util/u_atomic.c | 2 +-
10+
1 file changed, 1 insertion(+), 1 deletion(-)
11+
12+
diff --git a/src/util/u_atomic.c b/src/util/u_atomic.c
13+
index 5a5eab4..e499516 100644
14+
--- a/src/util/u_atomic.c
15+
+++ b/src/util/u_atomic.c
16+
@@ -21,7 +21,7 @@
17+
* IN THE SOFTWARE.
18+
*/
19+
20+
-#if defined(MISSING_64BIT_ATOMICS) && defined(HAVE_PTHREAD)
21+
+#if !defined(__clang__) && defined(MISSING_64BIT_ATOMICS) && defined(HAVE_PTHREAD)
22+
23+
#include <stdint.h>
24+
#include <pthread.h>

0 commit comments

Comments
 (0)