https://github.com/kwk created https://github.com/llvm/llvm-project/pull/196483

Now that #194607 landed we use a normalized triple in the README for the SPIRV 
targets. Before `spirv-mesa3d-` and `spirv64-mesa3d-` were being used and those 
will be normalized to `spirv-unknown-mesa3d` and `spirv64-unknown-mesa3d` by 
the following command in `runtimes/CMakeLists.txt` with this command:

```console
$ clang --target=spirv-mesa3d- -print-target-triple
spirv-unknown-mesa3d
```

This is because in `llvm/lib/TargetParser/Triple.cpp` the term `mesa3d` is 
recognized as an OS and placed in third position. The install path for 
`libclc.spv` there ends up in `spirv-unknown-mesa3d/libclc.spv`.

With this change we suggest to use triples that "survive" the normalization:

```console
$ clang --target=spirv-mesa-mesa3d -print-target-triple
spirv-mesa-mesa3d
```

See also this discussion: 
https://github.com/llvm/llvm-project/pull/194607#issuecomment-4378126607

>From e9a36feb8e809a111cd65b4bcdaba61ec779befd Mon Sep 17 00:00:00 2001
From: Konrad Kleine <[email protected]>
Date: Fri, 8 May 2026 08:00:23 +0000
Subject: [PATCH] [libclc] Use spirv[65]-mesa-mesa3d triple in README.md

Now that #194607 landed we use a normalized triple in the README for
the SPIRV targets. Before `spirv-mesa3d-` and `spirv64-mesa3d-` were
being used and those will be normalized to `spirv-unknown-mesa3d` and
`spirv64-unknown-mesa3d` by the following command in
`runtimes/CMakeLists.txt` with this command:

```console
$ clang --target=spirv-mesa3d- -print-target-triple
spirv-unknown-mesa3d
```

This is because in `llvm/lib/TargetParser/Triple.cpp` the term
`mesa3d` is recognized as an OS and placed in third position.
The install path for `libclc.spv` there ends up in
`spirv-unknown-mesa3d/libclc.spv`.

With this change we suggest to use triples that "survive" the
normalization:

```console
$ clang --target=spirv-mesa-mesa3d -print-target-triple
spirv-mesa-mesa3d
```

See also this discussion: 
https://github.com/llvm/llvm-project/pull/194607#issuecomment-4378126607
---
 libclc/README.md | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libclc/README.md b/libclc/README.md
index 81ce1553d139c..e096a070ee878 100644
--- a/libclc/README.md
+++ b/libclc/README.md
@@ -61,9 +61,9 @@ cmake ../llvm -G Ninja -DLLVM_ENABLE_PROJECTS="clang" 
-DCMAKE_BUILD_TYPE=Release
 #### Configure for SPIR-V targets
 ```
 cmake ../llvm -G Ninja -DLLVM_ENABLE_PROJECTS="clang" 
-DCMAKE_BUILD_TYPE=Release \
-  -DRUNTIMES_spirv-mesa3d-_LLVM_ENABLE_RUNTIMES=libclc \
-  -DRUNTIMES_spirv64-mesa3d-_LLVM_ENABLE_RUNTIMES=libclc \
-  -DLLVM_RUNTIME_TARGETS="spirv-mesa3d-;spirv64-mesa3d-"
+  -DRUNTIMES_spirv-mesa-mesa3d_LLVM_ENABLE_RUNTIMES=libclc \
+  -DRUNTIMES_spirv64-mesa-mesa3d_LLVM_ENABLE_RUNTIMES=libclc \
+  -DLLVM_RUNTIME_TARGETS="spirv-mesa-mesa3d;spirv64-mesa-mesa3d"
 ```
 
 To build multiple targets, pass them as a semicolon-separated list in

_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to