diff mbox series

add PREFERRED_PROVIDER variables for llvm

Message ID 20231127100204.236485-1-f_l_k@t-online.de
State New
Headers show
Series add PREFERRED_PROVIDER variables for llvm | expand

Commit Message

Markus Volk Nov. 27, 2023, 10:02 a.m. UTC
gallium-llvm needs to be built with clang if you, for example
want to have support for opencl or want to build the intel-clc compiler.
meta-clang recommends to set

PREFERRED_PROVIDER_llvm = "clang"
PREFERRED_PROVIDER_llvm-native = "clang-native"

The current problem is that this is not taken into account in mesa and therefore
both llvm and clang are included. This leads to files that are provided by both
packages and would also unnecessarily increase the build time.

Add PREFERRED_PROVIDER_llvm and PREFERRED_PROVIDER_llvm-native and make sure that the mesa recipe takes these variables into account.

Signed-off-by: Markus Volk <f_l_k@t-online.de>
---
 meta/conf/distro/include/default-providers.inc | 2 ++
 meta/recipes-graphics/mesa/mesa.inc            | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/meta/conf/distro/include/default-providers.inc b/meta/conf/distro/include/default-providers.inc
index d18173c744..819d71628b 100644
--- a/meta/conf/distro/include/default-providers.inc
+++ b/meta/conf/distro/include/default-providers.inc
@@ -37,6 +37,8 @@  PREFERRED_PROVIDER_dbus-glib ?= "dbus-glib"
 PREFERRED_PROVIDER_dbus-glib-native ?= "dbus-glib-native"
 PREFERRED_PROVIDER_gdk-pixbuf ?= "gdk-pixbuf"
 PREFERRED_PROVIDER_libgcc ?= "libgcc"
+PREFERRED_PROVIDER_llvm ?= "llvm"
+PREFERRED_PROVIDER_llvm-native ?= "llvm-native"
 PREFERRED_PROVIDER_nativesdk-libgcc ?= "nativesdk-libgcc"
 PREFERRED_PROVIDER_linux-libc-headers ?= "linux-libc-headers"
 PREFERRED_PROVIDER_nativesdk-linux-libc-headers ?= "nativesdk-linux-libc-headers"
diff --git a/meta/recipes-graphics/mesa/mesa.inc b/meta/recipes-graphics/mesa/mesa.inc
index e5c405a972..1a971242c9 100644
--- a/meta/recipes-graphics/mesa/mesa.inc
+++ b/meta/recipes-graphics/mesa/mesa.inc
@@ -183,7 +183,7 @@  GALLIUMDRIVERS:append = "${@bb.utils.contains('PACKAGECONFIG', 'r600', ',r600',
 GALLIUMDRIVERS:append = "${@bb.utils.contains('PACKAGECONFIG', 'virgl', ',virgl', '', d)}"
 
 PACKAGECONFIG[gallium] = "-Dgallium-drivers=${@strip_comma('${GALLIUMDRIVERS}')}, -Dgallium-drivers='', libdrm"
-PACKAGECONFIG[gallium-llvm] = "-Dllvm=enabled -Dshared-llvm=enabled, -Dllvm=disabled, llvm llvm-native elfutils"
+PACKAGECONFIG[gallium-llvm] = "-Dllvm=enabled -Dshared-llvm=enabled, -Dllvm=disabled, ${PREFERRED_PROVIDER_llvm} ${PREFERRED_PROVIDER_llvm-native} elfutils"
 PACKAGECONFIG[xa]  = "-Dgallium-xa=enabled, -Dgallium-xa=disabled"
 PACKAGECONFIG[va] = "-Dgallium-va=enabled,-Dgallium-va=disabled,libva-initial"
 PACKAGECONFIG[vdpau] = "-Dgallium-vdpau=enabled,-Dgallium-vdpau=disabled,libvdpau"