<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/138751>138751</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [apt.llvm.org] libclc packages should include the targets spirv-mesa3d- and spirv64-mesa3d-
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          TheRealCuran
      </td>
    </tr>
</table>

<pre>
    Running `RUSTICL_ENABLE=radeonsi clinfo` with the latest `llvm-toolchain-snapshot` packages from apt.llvm.org results in the following error:
```
Libclc failed to load. Please make sure it is installed and provides spirv-mesa3d-.spv and/or spirv64-mesa3d-.spv
```
Later in the output `clinfo` reports, that no devices were found.

At the moment the `llvm-toolchain-snapshot` packages won't install any `*.spv` artifacts in `libclc`, see https://salsa.debian.org/pkg-llvm-team/llvm-toolchain/-/blob/snapshot/debian/libclc-X.Y.install.in#L2

On top of that non will be built, because `debian/rules` tests for the existence of `llvm-spirv` or `llvm-spirv-$LLVM_VERSION` in https://salsa.debian.org/pkg-llvm-team/llvm-toolchain/-/blob/snapshot/debian/rules#L359-L363 (which should never be true).

This is a bit of a hen egg issue, since you need LLVM/CLang headers available (besides the `spirv-headers` and the `spirv-tools`). Thus you could either do the libclc build extra and have the other parts built individually (first LLVM/CLang, then the headers, tools, then `llvm-spirv` and finally libclc) or, if I read https://github.com/llvm/llvm-project/blob/main/libclc/CMakeLists.txt#L109 correctly, by providing the required sources in the LLVM build tree.

`llvm-spirv` from https://github.com/KhronosGroup/SPIRV-LLVM-Translator must match the major version of LLVM (and usually needs to be pretty up-to-date for it to be buildable with `HEAD` of LLVM. So far Debian has an individual spirv-llvm-translator package, but that hasn't been updated in a while. And I have no idea what would be better with regards to the apt.llvm.org build of libclc (ie. providing `llvm-spirv` in-tree or building it extra).

Anyway: please provide the `spirv-mesa3d-` and `spirv64-mesa3d-` targets in the apt.llvm.org Debian package builds of `llvm-toolchain-snapshot`. Thanks!
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJy0Vk1v4zgS_TX0pWBBpvx58MHtxLvBuj-QZBu7p0ZJLFvs0KSGpOz2vx8UJSVx92AwcxjAB0Msll69V_VKGII-WqK1mH0Qs7sRtrF2fv1c0yOh2bYe7ah06rp-bK3V9ghinj_-9-n5Ybv_dv9p82F_L4o7j4qcDRoqo-3BiXkOFx1riDWBwUgh8jVjzqdxdM5UNWo7DhabULvI0Q1WL3ikAAfvToBNzDg4c_4InkJrYgBtU7qDM8ZdGAh577woNiLfiHne__LNXpeVqeCA2pCC6MA4VBl8MYSB4IQvBKH1BDqC5qwhouFItAoa785aUYDQaH8enyhgocZZaM58LOTO-e5oPn1_-DMCjOQHvK6NTZvKf-PGU-N8DEJuIdYYwTpQdNYVBbiQ5xpbqzLOmm82MaU5uRPZ7u9fZPLirJCLOFQIaK98VchNgjzPAX3UB6w6bjlrYi7FbCEQQR1jE5hhuRNyF9AEzBSVGi0rI-SueTmOOyyEJyF3t7iE3I2F3JXGlXx9ACl3XQ6OT28c_y_7f9bDzPhasZdd8Z8tRNeAOww8WbhoY6AkKFttIgMtqcI2JFpe8_rWUOASufUCHJxPzNEPHSLZijjjQGPSk2Odv302FnK633_9-O3r_ePTw-dPHKPtP09KB14W-2K2Gu-LeQFCLi-1rmoItWuNAktn8kxC9C0Juepb5bnmhg6AUOrIJSLUZIGOR9AhcOQWgubyr64FS6SA6xNyt92jPUJNqMgHwDNqg6UhfnFJIU1E33kdM31kaiKrbs-40pCaaJXBc92G9LYqAScda_KgXOcM3aSykgroR_SYstV4pm50UnCDPoZObtBW6bNWLRpzZXAH7UO8KaKbKepmb4DJzxKq4fAX7fm9B21T3n4M5Aqc5xv6AA_gCdVP0h91rNsyq9wg8qB14913quKbyqdO9yHxbvsRX2ivQwxZ_BFZ6km-gsp5T1U019TV196M2Om4Fk-_tdqTguBaz07R-ws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