[clang] [libclc] [clang] Add the ability to link libclc OpenCL libraries (PR #146503)

Fraser Cormack via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 7 04:23:41 PDT 2025


================
@@ -2942,6 +2942,65 @@ void tools::addHIPRuntimeLibArgs(const ToolChain &TC, Compilation &C,
   }
 }
 
+void tools::addOpenCLBuiltinsLib(const Driver &D,
+                                 const llvm::opt::ArgList &DriverArgs,
+                                 llvm::opt::ArgStringList &CC1Args) {
+  // Check whether user specifies a libclc bytecode library
+  if (const Arg *A = DriverArgs.getLastArg(options::OPT_libclc_lib_EQ)) {
+    SmallVector<StringRef, 8> LibraryPaths;
+
+    // Add user defined library paths from LIBRARY_PATH.
+    std::optional<std::string> LibPath =
+        llvm::sys::Process::GetEnv("LIBRARY_PATH");
----------------
frasercrmck wrote:

I've removed checking on LIBRARY_PATH, thanks.

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


More information about the cfe-commits mailing list