[llvm-bugs] [Bug 45993] New: CudaInstallationDetector initialized with wrong triple

via llvm-bugs llvm-bugs at lists.llvm.org
Tue May 19 09:40:10 PDT 2020


https://bugs.llvm.org/show_bug.cgi?id=45993

            Bug ID: 45993
           Summary: CudaInstallationDetector initialized with wrong triple
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: CUDA
          Assignee: unassignedclangbugs at nondot.org
          Reporter: paul_robinson at playstation.sony.com
                CC: llvm-bugs at lists.llvm.org

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.)

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200519/67e6ccf6/attachment.html>


More information about the llvm-bugs mailing list