Skip to contentSkip to conversation

spirv-llvm-translator: small recipe cleanup

PATCH In review Ross Burton 2 participants 4 messages Sep 16, 2025 – Sep 17, 2025

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/3 spirv-llvm-translator: small recipe cleanup

- There is no need for python3native, as this recipe doesn't depend on other python modules.

- Inherit lib_package so the llvm-spirv binary is in a separate package to the libLLVMSPIRVLib.so library.

- Remove obsolete CMake options that no longer appear to be required.

- Change CMAKE_SKIP_RPATH to CMAKE_SKIP_BUILD_RPATH as this stops the ELF editing on install without potentially removing any explicit RPATHs, and aligns with a change I've proposed for cmake.bbclass.

---
 .../spir/spirv-llvm-translator_21.1.0.bb              | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)
meta/recipes-graphics/spir/spirv-llvm-translator_21.1.0.bb +2 -9
index 63fae47377e..13a93f3c5e5 100644
@@ -15,19 +15,12 @@ UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>\d+(\.\d+)+)"
 
 DEPENDS = "llvm spirv-tools spirv-headers"
 
-inherit cmake pkgconfig python3native
+inherit cmake pkgconfig lib_package
 
-# Specify any options you want to pass to cmake using EXTRA_OECMAKE:
-# for CMAKE_SHARED_LIBS=OFF see https://github.com/KhronosGroup/SPIRV-LLVM-Translator/issues/1868
 EXTRA_OECMAKE = "\
     -DBASE_LLVM_VERSION='${@oe.utils.trim_version('${PV}', 3)}' \
+    -DCMAKE_SKIP_BUILD_RPATH=ON \
     -DBUILD_SHARED_LIBS=ON \
-    -DCMAKE_BUILD_TYPE=Release \
-    -DCMAKE_POSITION_INDEPENDENT_CODE=ON \
-    -DCMAKE_SKIP_RPATH=ON \
-    -DLLVM_EXTERNAL_LIT=lit \
-    -DLLVM_INCLUDE_TESTS=ON \
-    -Wno-dev \
     -DLLVM_EXTERNAL_SPIRV_HEADERS_SOURCE_DIR=${STAGING_INCDIR}/.. \
 "
 
Signature · 1 line
2.43.0
#1 lore raw

PATCH v2 2/3 spirv-tools: improve packaging

spirv-tools is a set of libraries and some binaries that link to those libraries, so inherit lib_package so that the binaries and the libraries are packaged separately.

The lesspipe script hasn't needed bash since 2018[1], so remove the bash dependency and package the script with the other binaries.

The build type unless specified is Debug, explicitly set RelWithDebInfo.

[1] spirv-tools f70e9e "tools/lesspipe: Allow generic shell (#2255)"

---
 meta/recipes-graphics/spir/spirv-tools_1.4.321.0.bb | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
meta/recipes-graphics/spir/spirv-tools_1.4.321.0.bb +2 -5
index 30c42e915f9..c3e0d17d87a 100644
@@ -19,11 +19,12 @@ PE = "1"
 # upstream considers a release.
 UPSTREAM_CHECK_GITTAGREGEX = "sdk-(?P<pver>\d+(\.\d+)+)"
 
-inherit cmake
+inherit cmake lib_package
 
 DEPENDS = "spirv-headers"
 
 EXTRA_OECMAKE += "\
+    -DCMAKE_BUILD_TYPE=RelWithDebInfo \
     -DSPIRV-Headers_SOURCE_DIR=${STAGING_EXECPREFIXDIR} \
     -DSPIRV_TOOLS_BUILD_STATIC=OFF \
     -DBUILD_SHARED_LIBS=ON \
@@ -46,8 +47,4 @@ do_install:append:class-target() {
 SOLIBS = ".so"
 FILES_SOLIBSDEV = ""
 
-PACKAGES =+ "${PN}-lesspipe"
-FILES:${PN}-lesspipe = "${base_bindir}/spirv-lesspipe.sh"
-RDEPENDS:${PN}-lesspipe += "${PN} bash"
-
 BBCLASSEXTEND = "native nativesdk"
Signature · 1 line
2.43.0
#2 lore raw

PATCH v2 3/3 mesa: clean up libopencl-mesa dependencies

In reply to Ross Burton

The libraries in spirv-tools and spirv-llvm-translator are linked to libopencl, so the correct dependencies are generated automatically.

---
 meta/recipes-graphics/mesa/mesa.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-graphics/mesa/mesa.inc +1 -1
index 5dee19fae9e..39924508ca9 100644
@@ -224,7 +224,7 @@ DEV_PKG_DEPENDENCY = ""
 RPROVIDES:libgles2-mesa += "libgles3-mesa"
 RPROVIDES:libgles2-mesa-dev += "libgles3-mesa-dev"
 
-RDEPENDS:libopencl-mesa += "${@bb.utils.contains('PACKAGECONFIG', 'opencl', 'libclc spirv-tools spirv-llvm-translator', '', d)}"
+RDEPENDS:libopencl-mesa += "${@bb.utils.contains('PACKAGECONFIG', 'opencl', 'libclc', '', d)}"
 
 PACKAGES =+ "libegl-mesa libegl-mesa-dev \
              libgallium \
Signature · 1 line
2.43.0
Reviewed-by on v2 3/3
#3 lore raw

Re: [PATCH v2 3/3] mesa: clean up libopencl-mesa dependencies

Quoted 8 lines · Ross Burton

The libraries in spirv-tools and spirv-llvm-translator are linked to libopencl, so the correct dependencies are generated automatically.

---
 meta/recipes-graphics/mesa/mesa.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Signature · 2 lines
With best wishes
Dmitry