<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 - CudaInstallationDetector initialized with wrong triple"
   href="https://bugs.llvm.org/show_bug.cgi?id=45993">45993</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>CudaInstallationDetector initialized with wrong triple
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

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

        <tr>
          <th>OS</th>
          <td>Windows NT
          </td>
        </tr>

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

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>CUDA
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>paul_robinson@playstation.sony.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>The constructor for CudaInstallationDetector expects to be passed the
*host* triple as a parameter, but actually it is being given the *target*
triple by the Generic_GCC constructor.  Toolchain classes are constructed
with the target triple, and Generic_GCC just passes this down to its
CudaInstallation member.  This happens to work for a non-cross compiler
but does the wrong thing for a cross-compiler.

I'm not finding a handy API to retrieve the host triple, but I did find
the LLVM_HOST_TRIPLE define, in llvm-config.h.  That's probably what
CudaInstallationDetector should use, instead of taking a triple as a
parameter.

(PS4 uses a Windows-hosted cross-compiler, which is why we found this.
But it's a potential bug for any cross-compiler.  We've advised our
licensees to use `--cuda-path-ignore-env` as a workaround, to avoid an
excessive number of failed file searches on startup.)</pre>
        </div>
      </p>


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

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