Skip to contentSkip to conversation

Reproducibility of mesa with opencl feature enabled

PATCH Markus Volk 2 participants 3 messages Apr 2, 2024 Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#0 lore raw

I have a question regarding the reproducibility of mesa.

When mesa is built with opencl a lot of .so files have buildpath leakage. Since I finally looked into this, I have gained some insights.

1. The leak comes from CLANG_RESOURCE_DIR which contains the path of ${STAGING_DIR_HOST}.

In my ninja.build it looks like this:
-DCLANG_RESOURCE_DIR="/home/flk/poky/build-hypr/tmp/work/corei7-64-poky-linux/mesa/24.0.2/recipe-sysroot/usr/lib/clang/18.1.0/include

2.The include for this happens here:
<https://gitlab.freedesktop.org/mesa/mesa/-/blob/main/src/gallium/frontends/clover/meson.build?ref_type=heads#L69>

3. This include is wrong in any case
dep_llvm.version() = 18.0.1 (and should be 18 for current clang) Setting a different path therefore probably does not break anything
additionally
but helps to remove the build paths from the binaries and the
source.

What I have done under the assumption that this include is not needed for oe:

src/gallium/frontends/clover/meson.build +1 -2
@@ -66,8 +66,7 @@
    clover_cpp_args,
    clover_opencl_cpp_args,
    clover_spirv_cpp_args,
-    '-DCLANG_RESOURCE_DIR="@0@"'.format(join_paths(
-      dep_llvm.get_variable(cmake : 'LLVM_LIBRARY_DIR', configtool: 'libdir'), 'clang',
+    '-DCLANG_RESOURCE_DIR="@0@"'.format(join_paths( '/usr/lib/clang',
      dep_llvm.version(), 'include',
    )),
  ],

Not vaild, because dep_llvm.version() still != 18 but
Because the path was already wrong before, mesa compiled without errors as expected.

Is setting CLANG_RESOURCE_DIR really not needed in oe or is this a bug and the missing headers have simply been silently ignored so far?

#1 lore raw

Can we inject LLVM_LIBRARY_DIR from recipe ?

Quoted 47 lines · Markus Volk

I have a question regarding the reproducibility of mesa.

When mesa is built with opencl a lot of .so files have buildpath leakage. Since I finally looked into this, I have gained some insights.

1. The leak comes from CLANG_RESOURCE_DIR which contains the path of ${STAGING_DIR_HOST}.

In my ninja.build it looks like this:
-DCLANG_RESOURCE_DIR="/home/flk/poky/build-hypr/tmp/work/corei7-64-poky-linux/mesa/24.0.2/recipe-sysroot/usr/lib/clang/18.1.0/include

2.The include for this happens here:
https://gitlab.freedesktop.org/mesa/mesa/-/blob/main/src/gallium/frontends/clover/meson.build?ref_type=heads#L69

3. This include is wrong in any case
dep_llvm.version() = 18.0.1 (and should be 18 for current clang) Setting a different path therefore probably does not break anything additionally but helps to remove the build paths from the binaries and the source.

What I have done under the assumption that this include is not needed for oe:

src/gallium/frontends/clover/meson.build 2024-04-02 13:10:38.351443132 +0200 renamed from src/gallium/frontends/clover/meson.build 2024-02-28 19:29:18.000000000 +0100 +1 -2
@@ -66,8 +66,7 @@
     clover_cpp_args,
     clover_opencl_cpp_args,
     clover_spirv_cpp_args,
-    '-DCLANG_RESOURCE_DIR="@0@"'.format(join_paths(
-      dep_llvm.get_variable(cmake : 'LLVM_LIBRARY_DIR', configtool: 'libdir'), 'clang',
+    '-DCLANG_RESOURCE_DIR="@0@"'.format(join_paths( '/usr/lib/clang',
       dep_llvm.version(), 'include',
     )),
   ],

Not vaild, because dep_llvm.version() still != 18 but
Because the path was already wrong before, mesa compiled without errors as expected.

Is setting CLANG_RESOURCE_DIR really not needed in oe or is this a bug and the missing headers have simply been silently ignored so far?

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#109783): https://lists.openembedded.org/g/openembedded-devel/message/109783
Mute This Topic: https://lists.openembedded.org/mt/105290484/1997914
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#2 lore raw
Quoted 1 line · Khem Raj

Can we inject LLVM_LIBRARY_DIR from recipe ?

Not in a direct way. Unfortunately only with patch or sed