diff --git a/lib/Driver/ToolChains/Hcc.cpp b/lib/Driver/ToolChains/Hcc.cpp index 3e81940c574..f9f6788d996 100755 --- a/lib/Driver/ToolChains/Hcc.cpp +++ b/lib/Driver/ToolChains/Hcc.cpp @@ -47,9 +47,9 @@ HCCInstallationDetector::HCCInstallationDetector(const Driver &D, const llvm::op HCCPathCandidates.push_back( Args.getLastArgValue(options::OPT_hcc_path_EQ)); - HCCPathCandidates.push_back(InstallPath + "/.."); - HCCPathCandidates.push_back(BinPath + "/.."); HCCPathCandidates.push_back(BinPath + "/../.."); + HCCPathCandidates.push_back(InstallPath + "/.."); + HCCPathCandidates.push_back(RocmInstallation + "/hcc"); for (const auto &HCCPath: HCCPathCandidates) { if (HCCPath.empty() || @@ -68,7 +68,8 @@ HCCInstallationDetector::HCCInstallationDetector(const Driver &D, const llvm::op void HCCInstallationDetector::AddHCCIncludeArgs(const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args) const { if (IsValid) { CC1Args.push_back(DriverArgs.MakeArgString("-I" + IncPath + "/include")); - CC1Args.push_back(DriverArgs.MakeArgString("-I" + IncPath + "/hcc/include")); + // fall back to /opt/rocm/include if the user includes + CC1Args.push_back(DriverArgs.MakeArgString("-I" + RocmInstallation + "/include")); } } diff --git a/lib/Driver/ToolChains/Hcc.h b/lib/Driver/ToolChains/Hcc.h index dcf76a14862..ad0aa58f7d7 100755 --- a/lib/Driver/ToolChains/Hcc.h +++ b/lib/Driver/ToolChains/Hcc.h @@ -30,6 +30,7 @@ class HCCInstallationDetector { std::string IncPath; std::string LibPath; + const std::string RocmInstallation = "/opt/rocm"; std::vector SystemLibs = {"-ldl", "-lm", "-lpthread", "-lunwind"}; std::vector RuntimeLibs = {"-lhc_am", "-lmcwamp"};