<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - 'Clang :: Driver/rocm-detect.hip' fails on Gentoo"
   href="https://bugs.llvm.org/show_bug.cgi?id=51404">51404</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>'Clang :: Driver/rocm-detect.hip' fails on Gentoo
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>-New Bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>mgorny@gentoo.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org, neeilans@live.com, richard-llvm@metafoo.co.uk, yaxun.liu@amd.com
          </td>
        </tr>

        <tr>
          <th>Blocks</th>
          <td>51236
          </td>
        </tr></table>
      <p>
        <div>
        <pre>If I'm not mistaken, the test fails due to hardcoding bad assumptions about
clang's resource dir.

Our resource dir is specified as:

  -DCLANG_RESOURCE_DIR="../../../../lib/clang/${clang_version}"


The relevant FileCheck output is:

+ : 'RUN: at line 44'
+ /usr/lib/llvm/13/bin/FileCheck -check-prefixes=SPACK
/var/tmp/portage/sys-devel/clang-13.0.0.9999/work/clang/test/Driver/rocm-detect.hip
+
/var/tmp/portage/sys-devel/clang-13.0.0.9999/work/x/y/clang-abi_x86_32.x86/test/Driver/Output/rocm-spack/llvm-amdgpu-4.0.0-ieagcs7inf7runpyfvepqkurasoglq4z/bin/clang
-### -v -target x86_64-linux-gnu --cuda-gpu-arch=gfx900
--print-rocm-search-dirs
/var/tmp/portage/sys-devel/clang-13.0.0.9999/work/clang/test/Driver/rocm-detect.hip
/var/tmp/portage/sys-devel/clang-13.0.0.9999/work/clang/test/Driver/rocm-detect.hip:86:11:
error: SPACK: expected string not found in input
// SPACK: ROCm installation search path:
[[CLANG]]/{{(llvm/)?}}lib{{[0-9]*}}/clang/{{[0-9.]+}}
          ^
<stdin>:3:187: note: scanning from here
ROCm installation search path:
/var/tmp/portage/sys-devel/clang-13.0.0.9999/work/x/y/clang-abi_x86_32.x86/test/Driver/Output/rocm-spack/llvm-amdgpu-4.0.0-ieagcs7inf7runpyfvepqkurasoglq4z
                                                                               
                                                                               
                          ^
<stdin>:3:187: note: with "CLANG" equal to
"/var/tmp/portage/sys-devel/clang-13\\.0\\.0\\.9999/work/x/y/clang-abi_x86_32\\.x86"
ROCm installation search path:
/var/tmp/portage/sys-devel/clang-13.0.0.9999/work/x/y/clang-abi_x86_32.x86/test/Driver/Output/rocm-spack/llvm-amdgpu-4.0.0-ieagcs7inf7runpyfvepqkurasoglq4z
                                                                               
                                                                               
                          ^
<stdin>:4:1: note: possible intended match here
ROCm installation search path:
/var/tmp/portage/sys-devel/clang-13.0.0.9999/work/x/y/clang-abi_x86_32.x86
^

Input file: <stdin>
Check file:
/var/tmp/portage/sys-devel/clang-13.0.0.9999/work/clang/test/Driver/rocm-detect.hip

-dump-input=help explains the following input dump.

Input was:
<<<<<<
            1: ROCm installation search path (Spack 4.0.0):
/var/tmp/portage/sys-devel/clang-13.0.0.9999/work/x/y/clang-abi_x86_32.x86/test/Driver/Output/rocm-spack 
            2: ROCm installation search path:
/var/tmp/portage/sys-devel/clang-13.0.0.9999/work/x/y/clang-abi_x86_32.x86 
            3: ROCm installation search path:
/var/tmp/portage/sys-devel/clang-13.0.0.9999/work/x/y/clang-abi_x86_32.x86/test/Driver/Output/rocm-spack/llvm-amdgpu-4.0.0-ieagcs7inf7runpyfvepqkurasoglq4z 
check:86'0                                                                     
                                                                               
                                         X error: no match found
check:86'1                                                                     
                                                                               
                                           with "CLANG" equal to
"/var/tmp/portage/sys-devel/clang-13\\.0\\.0\\.9999/work/x/y/clang-abi_x86_32\\.x86"
            4: ROCm installation search path:
/var/tmp/portage/sys-devel/clang-13.0.0.9999/work/x/y/clang-abi_x86_32.x86 
check:86'0    
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
check:86'2     ?                                                               
                                          possible intended match
            5: ROCm installation search path:
/var/tmp/portage/sys-devel/clang-13.0.0.9999/work/x/y/clang-abi_x86_32.x86/bin/../../../../lib/clang/13.0.0 
check:86'0    
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            6: ROCm installation search path: /opt/rocm 
check:86'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            7: clang version 13.0.0 
check:86'0     ~~~~~~~~~~~~~~~~~~~~~
            8: Target: x86_64-unknown-linux-gnu 
check:86'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            9: Thread model: posix 
check:86'0     ~~~~~~~~~~~~~~~~~~~~
            .
            .
            .
<span class="quote">>>>>>></span ></pre>
        </div>
      </p>

        <div id="referenced">
          <hr style="border: 1px dashed #969696">
          <b>Referenced Bugs:</b>
          <ul>
              <li>
                [<a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [meta] 13.0.0 Release Blockers"
   href="https://bugs.llvm.org/show_bug.cgi?id=51236">Bug 51236</a>] [meta] 13.0.0 Release Blockers
              </li>
          </ul>
        </div>
        <br>

      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>