[PATCH] D104531: [LLD] [MinGW] Allow linking to DLLs directly
Martin Storsjö via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 18 23:55:14 PDT 2021
mstorsjo updated this revision to Diff 353172.
mstorsjo added a comment.
Updated to rerun CI after fixing a test in the base patch
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D104531/new/
https://reviews.llvm.org/D104531
Files:
lld/MinGW/Driver.cpp
lld/test/MinGW/lib.test
Index: lld/test/MinGW/lib.test
===================================================================
--- lld/test/MinGW/lib.test
+++ lld/test/MinGW/lib.test
@@ -40,7 +40,7 @@
RUN: echo > %t/lib/libnoimplib.dll
RUN: echo > %t/lib/noprefix_noimplib.dll
-RUN: not ld.lld -### -m i386pep -L%t/lib -lnoimplib 2>&1 | FileCheck -check-prefix=UNSUPPORTED-DLL1 %s
-RUN: not ld.lld -### -m i386pep -L%t/lib -lnoprefix_noimplib 2>&1 | FileCheck -check-prefix=UNSUPPORTED-DLL2 %s
-UNSUPPORTED-DLL1: lld doesn't support linking directly against {{.*}}libnoimplib.dll, use an import library
-UNSUPPORTED-DLL2: lld doesn't support linking directly against {{.*}}noprefix_noimplib.dll, use an import library
+RUN: ld.lld -### -m i386pep -L%t/lib -lnoimplib | FileCheck -check-prefix=DLL1 %s
+RUN: ld.lld -### -m i386pep -L%t/lib -lnoprefix_noimplib | FileCheck -check-prefix=DLL2 %s
+DLL1: libnoimplib.dll
+DLL2: noprefix_noimplib.dll
Index: lld/MinGW/Driver.cpp
===================================================================
--- lld/MinGW/Driver.cpp
+++ lld/MinGW/Driver.cpp
@@ -142,16 +142,10 @@
if (!bStatic) {
if (Optional<std::string> s = findFile(dir, name + ".lib"))
return *s;
- if (Optional<std::string> s = findFile(dir, "lib" + name + ".dll")) {
- error("lld doesn't support linking directly against " + *s +
- ", use an import library");
- return "";
- }
- if (Optional<std::string> s = findFile(dir, name + ".dll")) {
- error("lld doesn't support linking directly against " + *s +
- ", use an import library");
- return "";
- }
+ if (Optional<std::string> s = findFile(dir, "lib" + name + ".dll"))
+ return *s;
+ if (Optional<std::string> s = findFile(dir, name + ".dll"))
+ return *s;
}
}
error("unable to find library -l" + name);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D104531.353172.patch
Type: text/x-patch
Size: 1867 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210619/b2a4b40a/attachment.bin>
More information about the llvm-commits
mailing list