Skip to content

Commit 6bf3337

Browse files
committed
mesa: fix cross compilation
starting with 25.0.0, mesa no longer builds CLC executables when cross compiling: it finds the `mesa-clc` & others we explicitly provide it, decides there's no reason to build new versions of those components, and so cross-compiled mesa no longer produces any `cross_tools` output. excerpted from upstream src/compiler/clc/meson.build: ```meson if get_option('mesa-clc') != 'system' and (with_gallium_asahi or \ with_asahi_vk or \ with_intel_vk or \ with_gallium_iris or \ get_option('install-mesa-clc')) prog_mesa_clc = executable( 'mesa_clc', ['mesa_clc.c'], include_directories : [inc_include, inc_src], c_args : [pre_args, no_override_init_args], link_args : [ld_args_build_id], dependencies : [idep_mesaclc, dep_llvm, dep_spirv_tools, idep_getopt], # If we can run host binaries directly, just build mesa_clc for the host. # Most commonly this happens when doing a cross compile from an x86_64 build # machine to an x86 host native : not meson.can_run_host_binaries(), install : get_option('install-mesa-clc'), ) endif ```
1 parent 2d9e445 commit 6bf3337

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

pkgs/development/libraries/mesa/default.nix

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,13 @@ in stdenv.mkDerivation {
172172
# libspirv2dxil itself is pretty chonky, so relocate it to its own output in
173173
# case anything wants to use it at some point
174174
"spirv2dxil"
175-
# tools for the host platform to be used when cross-compiling
175+
] ++ lib.optionals (!needNativeCLC) [
176+
# tools for the host platform to be used when cross-compiling.
177+
# mesa builds these only when not already built. hence:
178+
# - for a non-cross build (needNativeCLC = false), we do not provide mesa
179+
# with any `*-clc` binaries, so it builds them and installs them.
180+
# - for a cross build (needNativeCLC = true), we provide mesa with `*-clc`
181+
# binaries, so it skips building & installing any new CLC files.
176182
"cross_tools"
177183
];
178184

0 commit comments

Comments
 (0)