[llvm-branch-commits] [clang] [libclc] clang/AMDGPU: Do not look for rocm device libs if environment is llvm (PR #180922)

Matt Arsenault via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Feb 11 05:20:44 PST 2026


================
@@ -3068,15 +3068,25 @@ void tools::addOpenMPDeviceRTL(const Driver &D,
   }
 }
 
-void tools::addOpenCLBuiltinsLib(const Driver &D,
+void tools::addOpenCLBuiltinsLib(const Driver &D, const llvm::Triple &TT,
                                  const llvm::opt::ArgList &DriverArgs,
                                  llvm::opt::ArgStringList &CC1Args) {
+
+  StringRef LibclcNamespec;
   const Arg *A = DriverArgs.getLastArg(options::OPT_libclc_lib_EQ);
-  if (!A)
-    return;
+  if (A) {
+    // If the namespec is of the form :filename we use it exactly.
+    LibclcNamespec = A->getValue();
+  } else {
+    if (!TT.isAMDGPU() || TT.getEnvironment() != llvm::Triple::LLVM)
+      return;
+
+    // TODO: Should this accept following -stdlib to override?
----------------
arsenm wrote:

I did that originally, but undid it since I don't know how that is supposed to interact with -nodefaultlibs. 

https://github.com/llvm/llvm-project/pull/180922


More information about the llvm-branch-commits mailing list