[clang] [clang-sycl-linker] Add support for linking static archives (PR #201253)

Nick Sarnie via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 3 07:47:52 PDT 2026


================
@@ -341,6 +342,38 @@ static Expected<LinkResult> linkInputs(ArrayRef<std::string> InputFiles,
 
   // Link in library files.
   for (auto &File : *BCLibFiles) {
+    // Static archives are unpacked and each bitcode member is linked
+    // individually with LinkOnlyNeeded.
+    StringRef Ext = sys::path::extension(File);
+    if (Ext == ".a" || Ext == ".lib") {
----------------
sarnex wrote:

instead of checking the ext should we use `llvm::identify_magic`?

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


More information about the cfe-commits mailing list