================
@@ -1261,6 +1261,12 @@ searchLibraryBaseName(StringRef Name, StringRef Root,
     if (std::optional<std::string> File =
             findFile(Dir, Root, "lib" + Name + ".a"))
----------------
yxsamliu wrote:

I think the library search order needs to match the real host linker.

For example, lld MinGW searches `libfoo.dll.a` before `libfoo.a` for `-lfoo`. 
This patch searches `libfoo.a` first. If both files exist, the host linker may 
use `libfoo.dll.a`, but the wrapper may extract device code from `libfoo.a`, so 
host and device linking can disagree.

Can we make this search depend on the host linker style/triple, or otherwise 
mirror lld's search order more closely?

https://github.com/llvm/llvm-project/pull/216239
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to