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

Sunho Kim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 26 07:49:46 PDT 2022


sunho added inline comments.


================
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);
----------------
lhames wrote:
> sunho wrote:
> > lhames wrote:
> > > 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?
> > We want to search the dll file that is not inside specified -L serach directories as well. One way is extend existing -l flag to also look up system dynamic library if everything else fails in search directorires and print warning message. How does that sound to you?
> How is MSVC / LINK.EXE handling this? Do they just have a fallback list of search paths to search on? I'd be fine with including those as if they were `-L` arguments by default (maybe with a switch to turn them off explicitly where they're not wanted)
It would just rely on windows kernel to do the dll search which is described in https://docs.microsoft.com/en-us/windows/win32/dlls/dynamic-link-library-search-order.  However, common use cases of llvm-jitlink wouldn't really want to look pathes other than MSVC installations and probably some windows system path. So, I think it's fine to go with adding some default path to -L way. 


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

https://reviews.llvm.org/D129952



More information about the llvm-commits mailing list