File amd-hipcc-add-clang-launcher.patch of Package rocm-llvm

diff --git a/amd/hipcc/src/hipBin_amd.h b/amd/hipcc/src/hipBin_amd.h
index 57d009804..1faa40711 100644
--- a/amd/hipcc/src/hipBin_amd.h
+++ b/amd/hipcc/src/hipBin_amd.h
@@ -867,6 +867,11 @@ void HipBinAmd::executeHipCCCmd(vector<string> argv) {
   string compiler;
   compiler = getHipCC();
   string CMD = compiler;
+
+  if (!var.hipClangLauncher_.empty()) {
+    CMD = "\"" + var.hipClangLauncher_ + "\" \"" + compiler + "\"";
+  }
+
   if (needCFLAGS) {
     CMD += " " + HIPCFLAGS;
   }
diff --git a/amd/hipcc/src/hipBin_base.h b/amd/hipcc/src/hipBin_base.h
index 6c1a7767b..34318e3fb 100644
--- a/amd/hipcc/src/hipBin_base.h
+++ b/amd/hipcc/src/hipBin_base.h
@@ -50,6 +50,7 @@ THE SOFTWARE.
 # define HIP_COMPILE_CXX_AS_HIP         "HIP_COMPILE_CXX_AS_HIP"
 # define HIPCC_VERBOSE                  "HIPCC_VERBOSE"
 # define HCC_AMDGPU_TARGET              "HCC_AMDGPU_TARGET"
+# define HIP_CLANG_LAUNCHER             "HIP_CLANG_LAUNCHER"
 
 # define HIP_BASE_VERSION_MAJOR     "6"
 # define HIP_BASE_VERSION_MINOR     "2"
@@ -157,6 +158,7 @@ struct EnvVariables {
   string hipClangHccCompactModeEnv_ = "";
   string hipCompileCxxAsHipEnv_ = "";
   string hccAmdGpuTargetEnv_ = "";
+  string hipClangLauncher_ = "";
   friend std::ostream& operator <<(std::ostream& os, const EnvVariables& var) {
     os << "Path: "                           << var.path_ << endl;
     os << "Hip Path: "                       << var.hipPathEnv_ << endl;
@@ -181,6 +183,7 @@ struct EnvVariables {
     os << "Hip Compile Cxx as Hip: "         <<
            var.hipCompileCxxAsHipEnv_ << endl;
     os << "Hcc Amd Gpu Target: "             << var.hccAmdGpuTargetEnv_ << endl;
+    os << "Hip Clang launcher: "             << var.hipClangLauncher_ << endl;
     return os;
   }
 };
@@ -316,6 +319,8 @@ void HipBinBase::readEnvVariables() {
     envVariables_.hipClangHccCompactModeEnv_ = hipClangHccCompactMode;
   if (const char* hipCompileCxxAsHip = std::getenv(HIP_COMPILE_CXX_AS_HIP))
     envVariables_.hipCompileCxxAsHipEnv_ = hipCompileCxxAsHip;
+  if (const char* hipClangLuancher = std::getenv(HIP_CLANG_LAUNCHER))
+    envVariables_.hipClangLauncher_ = hipClangLuancher;
 }
 
 // constructs the HIP path
openSUSE Build Service is sponsored by