[openmp] Disable affinity on WebAssembly Linux targets (#235840)

`KMP_AFFINITY_SUPPORTED` is turned off for WASI and Emscripten, but not
for clang's WebAssembly Linux target (`wasm32-unknown-linux-*`, WALI),
which defines `__linux__`. libomp then enables affinity there and the
build stops in `kmp_affinity.h`:

```
openmp/runtime/src/kmp_affinity.h:326:2: error: Unknown or unsupported architecture
```

because there are no `sched_{set,get}affinity` syscall numbers for
WebAssembly. WebAssembly has no way to pin a thread to a CPU on any of
these targets, so this change turns affinity off by architecture
(`KMP_ARCH_WASM32` / `KMP_ARCH_WASM64`) instead of by OS. WASI and
Emscripten are always WebAssembly, so nothing changes for them.

Testing:
- Built libomp for `wasm32-unknown-linux-musl` with upstream clang.
Before: the build fails with the error above. After: it builds.
- Linked an OpenMP program with the resulting static `libomp.a` (a
`parallel for` with a reduction and an `atomic` update, 4 threads) and
ran it on a WebAssembly Linux runtime. It gives the expected results.

This patch was prepared with the help of Claude Code (an AI tool), as
noted with `Assisted-by` in the commit message.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

GitOrigin-RevId: a490155f6c565b7cbab51e29f88ce369bd09c83d
1 file changed