[PATCH] D129952: [ORC][COFF] Handle COFF import files of static archive.

Lang Hames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 20 17:12:19 PDT 2022


lhames added a comment.

Does obj2yaml work for archives? If so it'd be cool to have a testcase for this. If obj2yaml doesn't support this I'm not sure we could count on having available tools that would produce an archive with COFF imports in it, could we?



================
Comment at: llvm/include/llvm/ExecutionEngine/Orc/ExecutionUtils.h:290-295
+  /// Returns a list of filenames of dynamic libraries that this archive has
+  /// imported. This class does not load these libraries by itself. User is
+  /// responsible for making sure these libraries are avaliable to the JITDylib.
+  const std::set<std::string> &getImportedDynamicLibraries() const {
+    return ImportedDynamicLibraries;
+  }
----------------
Eventually I think we'll want this to be a separate structure returned by the `Create`, rather than a method on `StaticLibraryDefinitionGenerator`, but it's early days for this API -- I don't mind if it lands like this initially.


================
Comment at: llvm/tools/llvm-jitlink/llvm-jitlink.cpp:1665-1667
+    for (auto FileName : (*G)->getImportedDynamicLibraries())
+      if (auto Err = S.loadDynamicLibrary(FileName))
+        return std::move(Err);
----------------
This is always going to load the library as a real dylib (via EPCDynamicLibrarySearchGenerator), right?

Could we have it treated as if it were a `-L` argument instead?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D129952/new/

https://reviews.llvm.org/D129952



More information about the llvm-commits mailing list