<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>15831</bug_id>
          
          <creation_ts>2025-04-14 20:09:23 +0000</creation_ts>
          <short_desc>mesa fails to build when rm_work is enabled</short_desc>
          <delta_ts>2025-07-17 18:49:02 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>OE-Core</product>
          <component>graphics</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WORKSFORME</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>5.3 M1</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Khem Raj">raj.khem</reporter>
          <assigned_to name="Khem Raj">raj.khem</assigned_to>
          <cc>dbaryshkov</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>randy.macleod</cc>
    
    <cc>ross.burton</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>101644</commentid>
    <comment_count>0</comment_count>
    <who name="Khem Raj">raj.khem</who>
    <bug_when>2025-04-14 20:09:23 +0000</bug_when>
    <thetext>mesa 25 upgrade is newly building clc pieces for which it use mesa_clc tool to do the conversion to SPIRV backend and utilizes clang to do the work underneath. Clang argument are passed on commandline after -- separator.

This works ok when rm_work is not enabled however when INHERIT:append = &quot; rm_work&quot; in local.conf and use MACHINE = &quot;qemux86-64&quot;

Then build mesa

bitbake -ccleansstate mesa-native mesa
bitbake mesa

It ends up in errors e.g.

/mnt/b/yoe/master/build/tmp/work/core2-64-yoe-linux/mesa/25.0.2/recipe-sysroot-native/usr/bin/mesa_clc ../mesa-25.0.2/src/intel/shaders/libintel_shaders.h ../mesa-25.0.2/src/intel/shaders/generate.cl ../mesa-25.0.2/src/intel/shaders/generate_draws.cl ../mesa-25.0.2/src/intel/shaders/generate_draws_iris.cl ../mesa-25.0.2/src/intel/shaders/query_copy.cl ../mesa-25.0.2/src/intel/shaders/util.cl -o src/intel/shaders/intel_gfx90_shaders.spv -- -DNDEBUG=1 -DGFX_VERx10=90 -I/mnt/b/yoe/master/build/tmp/work/core2-64-yoe-linux/mesa/25.0.2/mesa-25.0.2/src/intel/shaders/. -I/mnt/b/yoe/master/build/tmp/work/core2-64-yoe-linux/mesa/25.0.2/mesa-25.0.2/src/compiler/libcl -I/mnt/b/yoe/master/build/tmp/work/core2-64-yoe-linux/mesa/25.0.2/mesa-25.0.2/src -I/mnt/b/yoe/master/build/tmp/work/core2-64-yoe-linux/mesa/25.0.2/mesa-25.0.2/src/intel -I/mnt/b/yoe/master/build/tmp/work/core2-64-yoe-linux/mesa/25.0.2/build/src/intel -I/mnt/b/yoe/master/build/tmp/work/core2-64-yoe-linux/mesa/25.0.2/mesa-25.0.2/src/intel/genxml
&lt;built-in&gt;:1:10: fatal error: &apos;opencl-c-base.h&apos; file not found
Error executing LLVM compilation action.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>101645</commentid>
    <comment_count>1</comment_count>
    <who name="Khem Raj">raj.khem</who>
    <bug_when>2025-04-14 20:34:19 +0000</bug_when>
    <thetext>I manually appended --isysroot=/mnt/b/yoe/master/build/tmp/work/core2-64-yoe-linux/mesa/25.0│
│.2/recipe-sysroot

this gets into next error

Couldn&apos;t create Clang invocation.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>101674</commentid>
    <comment_count>2</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2025-04-17 15:03:52 +0000</bug_when>
    <thetext>Between this and the meta-clang breakage our llvm/clang recipes are pretty broken.

I&apos;m close to advocating we revert the llvm changes in core... Khem, Dmitry: can you work out how to resolve this?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>101680</commentid>
    <comment_count>3</comment_count>
    <who name="Dmitry Baryshkov">dbaryshkov</who>
    <bug_when>2025-04-18 01:03:03 +0000</bug_when>
    <thetext>With the following I can successfully build nodistro + mesa doing the build package-by-package, so that rm_work can kick in inbetween.

- current github/master
- https://lore.kernel.org/openembedded-core/20250418-mesa-25-fixes-v2-0-e110ccfe291f@oss.qualcomm.com/
- https://github.com/kraj/meta-clang/pull/1085

I definitely don&apos;t think that reverting llvm / mesa in acceptable solution: this means shipping a very outdated and not supported component.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>101681</commentid>
    <comment_count>4</comment_count>
    <who name="Khem Raj">raj.khem</who>
    <bug_when>2025-04-18 01:22:14 +0000</bug_when>
    <thetext>(In reply to Ross Burton from comment #2)
&gt; Between this and the meta-clang breakage our llvm/clang recipes are pretty
&gt; broken.
&gt; 
&gt; I&apos;m close to advocating we revert the llvm changes in core... Khem, Dmitry:
&gt; can you work out how to resolve this?

I have pushed a new branch to contrib tree which contains a clang merge into core.

https://web.git.yoctoproject.org/poky-contrib/log/?h=kraj/clang-merge-2

 Please look into it and lets make it work. I can build mesa with this and also full featured clang compiler. I will start adapting meta-clang to remove clang and make adjustments as needed to work with clang coming from core.

I think this will straighten the path forward.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>101682</commentid>
    <comment_count>5</comment_count>
    <who name="Khem Raj">raj.khem</who>
    <bug_when>2025-04-18 01:52:47 +0000</bug_when>
    <thetext>(In reply to Dmitry Baryshkov from comment #3)
&gt; With the following I can successfully build nodistro + mesa doing the build
&gt; package-by-package, so that rm_work can kick in inbetween.
&gt; 
&gt; - current github/master
&gt; -
&gt; https://lore.kernel.org/openembedded-core/20250418-mesa-25-fixes-v2-0-
&gt; e110ccfe291f@oss.qualcomm.com/

I have staged these patches into kraj/clang-merge-2 branch

&gt; - https://github.com/kraj/meta-clang/pull/1085
&gt; 

I think this wont be needed.

&gt; I definitely don&apos;t think that reverting llvm / mesa in acceptable solution:
&gt; this means shipping a very outdated and not supported component.

yes, I am hopeful that we don&apos;t have to take this step.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>102481</commentid>
    <comment_count>6</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2025-07-17 18:49:02 +0000</bug_when>
    <thetext>From IRC, #yocto

Randy: khem: RP thinks that this issue has been resolved, do you agree?
Khem:  I think yes,I have not seen this failures on CI systems for some weeks now</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>