From: Cordell Bloor <cgmb@debian.org>
Date: Mon, 22 Sep 2025 14:45:13 -0600
Subject: specify clang version

---
 amd/hipcc/src/hipBin_amd.h | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

--- a/amd/hipcc/src/hipBin_amd.h
+++ b/amd/hipcc/src/hipBin_amd.h
@@ -153,7 +153,7 @@
   string hipLdFlags;
   const string& hipClangPath = getCompilerPath();
   // If $HIPCC clang++ is not compiled, use clang instead
-  string hipCC = "\"" + hipClangPath + "/clang++";
+  string hipCC = "\"" + hipClangPath + "/clang++-21";
   if (!fs::exists(hipCC)) {
     hipLdFlags = "--driver-mode=g++";
   }
@@ -227,10 +227,10 @@
   const string& hipClangPath = getCompilerPath();
   const string& hipPath = getHipPath();
   if (isWindows()) {
-    string cmd = hipClangPath + "/clang++ --version";
+    string cmd = hipClangPath + "/clang++-21 --version";
     system(cmd.c_str());  // hipclang version
     cout << "llc-version :" << endl;
-    cmd = hipClangPath + "/llc --version";
+    cmd = hipClangPath + "/llc-21 --version";
     system(cmd.c_str());  // llc version
     cout << "hip-clang-cxxflags :" << endl;
     cmd = hipPath + "/bin/hipcc  --cxxflags";
@@ -240,9 +240,9 @@
     system(cmd.c_str());  // ld flags
     cout << endl;
   } else {
-    string cmd = hipClangPath + "/clang++ --version";
+    string cmd = hipClangPath + "/clang++-21 --version";
     system(cmd.c_str());  // hipclang version
-    cmd = hipClangPath + "/llc --version";
+    cmd = hipClangPath + "/llc-21 --version";
     system(cmd.c_str());  // llc version
     cout << "hip-clang-cxxflags :" << endl;
     cmd = hipPath + "/bin/hipcc --cxxflags";
@@ -258,7 +258,7 @@
   string out, compilerVersion;
   const string& hipClangPath = getCompilerPath();
   fs::path cmdAmd = hipClangPath;
-  cmdAmd /= "clang++";
+  cmdAmd /= "clang++-21";
   if (canRunCompiler(cmdAmd.string(), out) || canRunCompiler("amdclang++", out)) {
     regex regexp("([0-9.]+)");
     smatch m;
@@ -340,7 +340,7 @@
   constructCompilerPath();
   const string& hipClangPath = getCompilerPath();
   fs::path cmdAmd = hipClangPath;
-  cmdAmd /= "clang++";
+  cmdAmd /= "clang++-21";
   const EnvVariables& var = getEnvVariables();
   bool detected = false;
   if (var.hipPlatformEnv_.empty()) {
@@ -386,7 +386,7 @@
   if (isWindows())
     compiler /= "clang.exe";
   else
-    compiler /= "clang++";
+    compiler /= "clang++-21";
 
   if (!fs::exists(compiler)) {
     fs::path compiler = hipClangPath;
