[PATCH] D119234: [clang] [MinGW] Recognize -lcrtdll as a library replacing -lmsvcrt
Martin Storsjö via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Feb 8 04:54:40 PST 2022
mstorsjo created this revision.
mstorsjo added reviewers: mati865, rnk.
mstorsjo requested review of this revision.
Herald added a project: clang.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D119234
Files:
clang/lib/Driver/ToolChains/MinGW.cpp
clang/test/Driver/mingw-msvcrt.c
Index: clang/test/Driver/mingw-msvcrt.c
===================================================================
--- clang/test/Driver/mingw-msvcrt.c
+++ clang/test/Driver/mingw-msvcrt.c
@@ -2,6 +2,7 @@
// RUN: %clang -v -target i686-pc-windows-gnu -lmsvcr120 -### %s 2>&1 | FileCheck -check-prefix=CHECK_MSVCR120 %s
// RUN: %clang -v -target i686-pc-windows-gnu -lucrtbase -### %s 2>&1 | FileCheck -check-prefix=CHECK_UCRTBASE %s
// RUN: %clang -v -target i686-pc-windows-gnu -lucrt -### %s 2>&1 | FileCheck -check-prefix=CHECK_UCRT %s
+// RUN: %clang -v -target i686-pc-windows-gnu -lcrtdll -### %s 2>&1 | FileCheck -check-prefix=CHECK_CRTDLL %s
// CHECK_DEFAULT: "-lmingwex" "-lmsvcrt" "-ladvapi32"
// CHECK_DEFAULT-SAME: "-lmsvcrt" "-lkernel32" "{{.*}}crtend.o"
@@ -11,3 +12,5 @@
// CHECK_UCRTBASE-SAME: "-lmingwex" "-ladvapi32"
// CHECK_UCRT: "-lucrt"
// CHECK_UCRT-SAME: "-lmingwex" "-ladvapi32"
+// CHECK_CRTDLL: "-lcrtdll"
+// CHECK_CRTDLL-SAME: "-lmingwex" "-ladvapi32"
Index: clang/lib/Driver/ToolChains/MinGW.cpp
===================================================================
--- clang/lib/Driver/ToolChains/MinGW.cpp
+++ clang/lib/Driver/ToolChains/MinGW.cpp
@@ -86,7 +86,9 @@
CmdArgs.push_back("-lmoldname");
CmdArgs.push_back("-lmingwex");
for (auto Lib : Args.getAllArgValues(options::OPT_l))
- if (StringRef(Lib).startswith("msvcr") || StringRef(Lib).startswith("ucrt"))
+ if (StringRef(Lib).startswith("msvcr") ||
+ StringRef(Lib).startswith("ucrt") ||
+ StringRef(Lib).startswith("crtdll"))
return;
CmdArgs.push_back("-lmsvcrt");
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D119234.406774.patch
Type: text/x-patch
Size: 1600 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220208/c74a7836/attachment.bin>
More information about the cfe-commits
mailing list