jhuber6 created this revision. jhuber6 added reviewers: tra, yaxunl. Herald added a subscriber: mattd. Herald added a project: All. jhuber6 requested review of this revision. Herald added subscribers: cfe-commits, MaskRay. Herald added a project: clang.
When cross-compiling NVPTX we use the triple to indicate which paths to search for the CUDA toolchain. Currently this uses the default target triple. This might not be exactly correct, as this is the default triple used to compile binaries, not the host system. We want the host triple because it indicates which folders should hold CUDA. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D150136 Files: clang/lib/Driver/ToolChains/Cuda.cpp Index: clang/lib/Driver/ToolChains/Cuda.cpp =================================================================== --- clang/lib/Driver/ToolChains/Cuda.cpp +++ clang/lib/Driver/ToolChains/Cuda.cpp @@ -711,8 +711,7 @@ /// system's default triple if not provided. NVPTXToolChain::NVPTXToolChain(const Driver &D, const llvm::Triple &Triple, const ArgList &Args) - : NVPTXToolChain(D, Triple, - llvm::Triple(llvm::sys::getDefaultTargetTriple()), Args, + : NVPTXToolChain(D, Triple, llvm::Triple(LLVM_HOST_TRIPLE), Args, /*Freestanding=*/true) {} llvm::opt::DerivedArgList *
Index: clang/lib/Driver/ToolChains/Cuda.cpp =================================================================== --- clang/lib/Driver/ToolChains/Cuda.cpp +++ clang/lib/Driver/ToolChains/Cuda.cpp @@ -711,8 +711,7 @@ /// system's default triple if not provided. NVPTXToolChain::NVPTXToolChain(const Driver &D, const llvm::Triple &Triple, const ArgList &Args) - : NVPTXToolChain(D, Triple, - llvm::Triple(llvm::sys::getDefaultTargetTriple()), Args, + : NVPTXToolChain(D, Triple, llvm::Triple(LLVM_HOST_TRIPLE), Args, /*Freestanding=*/true) {} llvm::opt::DerivedArgList *
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits