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

    <tr>
        <th>Summary</th>
        <td>
            The openmp-offload-amdgpu-runtime bot uses mismatched x86_64-{pc,unknown}-linux-gnu triples
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue,
            openmp:libomptarget
      </td>
    </tr>

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

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

<pre>
    The built toolchain appears to set `LLVM_DEFAULT_TARGET_TRIPLE` to `x86_64-unknown-linux-gnu`. 
```
-- LLVM host triple: x86_64-unknown-linux-gnu
-- Native target architecture is X86
...
-- LLVM default target triple: x86_64-unknown-linux-gnu
```

However, the `check check-offload` test step uses a different triple `-fopenmp-targets=x86_64-pc-linux-gnu`.

The test output contains this notice:
```
FAIL: libomptarget :: x86_64-pc-linux-gnu :: api/is_initial_device.c (233 of 750)
```

```
******************** TEST 'libomptarget :: x86_64-pc-linux-gnu :: api/assert.c' FAILED ********************
Exit Code: 1
Command Output (stdout):
--
# RUN: at line 1
/home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.build/./bin/clang -fopenmp    -I /home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.src/offload/test -I /home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -L /home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/offload -L /home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.build/./lib -L /home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -nogpulib -Wl,-rpath,/home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/offload -Wl,-rpath,/home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -Wl,-rpath,/home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.build/./lib -fopenmp-targets=x86_64-pc-linux-gnu /home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.src/offload/test/api/assert.c -o /home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/offload/test/x86_64-pc-linux-gnu/api/Output/assert.c.tmp /home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.build/./lib/libomptarget.devicertl.a && /home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/offload/test/x86_64-pc-linux-gnu/api/Output/assert.c.tmp | /home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.build/./bin/FileCheck /home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.src/offload/test/api/assert.c
# executed command: /home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.build/./bin/clang -fopenmp -I /home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.src/offload/test -I /home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -L /home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/offload -L /home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.build/./lib -L /home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -nogpulib -Wl,-rpath,/home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/offload -Wl,-rpath,/home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -Wl,-rpath,/home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.build/./lib -fopenmp-targets=x86_64-pc-linux-gnu /home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.src/offload/test/api/assert.c -o /home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.build/runtimes/runtimes-bins/offload/test/x86_64-pc-linux-gnu/api/Output/assert.c.tmp /home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.build/./lib/libomptarget.devicertl.a
# .---command stderr------------
# | ld.lld: error: cannot open crtbeginS.o: No such file or directory
# | ld.lld: error: cannot open crtendS.o: No such file or directory
# | clang: error: linker command failed with exit code 1 (use -v to see invocation)
# | /home/ompworker/bbot/openmp-offload-amdgpu-runtime/llvm.build/bin/clang-linker-wrapper: error: 'clang' failed
# | clang: error: linker command failed with exit code 1 (use -v to see invocation)
# `-----------------------------
# error: command failed with exit status: 1

```

---

`clang --target=x86_64-pc-linux-gnu` probing `x86_64-unknown-linux-gnu` library/include directories or the converse
is a loose driver behavior that we have been slowly migrating away for the past few years.
(
We have done a few things including:

* Discouraging new additions to `*Libs` arrays in `clang/lib/Driver/ToolChains/Gnu.cpp:CollectLibDirsAndTriples`.
* `--target=x86_64-unknown-linux-gnu` no longer probes `x86_64-linux-android` library/include directories
* `--target=x86_64-unknown-linux-gnu` no longer probes some niche triples
)

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzsWE1v2zwS_jX0ZSBBoWM5Pvjg1466BdzuInW3ewsoaizNhiIFkrLjf7-gJMdO0aRfaRYvEMNwFHE4H88M55FGOEelRpyzyV9sshqJ1lfGzj8Id3cjDqPcFIf5pkLIW1IevDFKVoI0iKZBYR14Aw49sDRZr__94XZ1nS0-rze3m8XNu-vN7ebm_b_W1yxNghxLk_ur9Da9jFp9p81eR4p0ex-VumVpEgNLVixZsDQZvt2_UQRBMVTGefCWGoVsvIAnFR03fRSedghe2BI9CCsr8ih9axHIwX-u0l4yjuPHdgrcijZE2m_8UYtfed3__sPscYeW8SX4CkP8skJ5B91vZLZbZUTRgYPOg_PYQOvQgYCCtlu0qI8OhL3R1jSo6ybqXXNsvBp8auRjJM99CLnr1JvWN60HabQXpB34ihxo40mG8L4ZRbZ4vw6hK8pN3QyIBO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