[PATCH] D58107: [MinGW] Add the profiling library when necessary

Martin Storsjö via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 12 23:26:38 PST 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL353917: [MinGW] Add the profiling library when necessary (authored by mstorsjo, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D58107?vs=186411&id=186588#toc

Repository:
  rL LLVM

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

https://reviews.llvm.org/D58107

Files:
  cfe/trunk/lib/Driver/ToolChains/MinGW.cpp
  cfe/trunk/test/Driver/instrprof-ld.c


Index: cfe/trunk/test/Driver/instrprof-ld.c
===================================================================
--- cfe/trunk/test/Driver/instrprof-ld.c
+++ cfe/trunk/test/Driver/instrprof-ld.c
@@ -121,3 +121,11 @@
 //
 // CHECK-WINDOWS-X86-64: "{{.*}}link{{(.exe)?}}"
 // CHECK-WINDOWS-X86-64: "{{.*}}clang_rt.profile-x86_64.lib"
+//
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 -fuse-ld=lld \
+// RUN:     -target x86_64-mingw32 -fprofile-instr-generate \
+// RUN:     -resource-dir=%S/Inputs/resource_dir \
+// RUN:   | FileCheck --check-prefix=CHECK-MINGW-X86-64 %s
+//
+// CHECK-MINGW-X86-64: "{{(.*[^-.0-9A-Z_a-z])?}}ld.lld{{(.exe)?}}"
+// CHECK-MINGW-X86-64: "{{.*}}/Inputs/resource_dir{{/|\\\\}}lib{{/|\\\\}}windows{{/|\\\\}}libclang_rt.profile-x86_64.a"
Index: cfe/trunk/lib/Driver/ToolChains/MinGW.cpp
===================================================================
--- cfe/trunk/lib/Driver/ToolChains/MinGW.cpp
+++ cfe/trunk/lib/Driver/ToolChains/MinGW.cpp
@@ -264,6 +264,8 @@
         CmdArgs.push_back(Args.MakeArgString("--no-whole-archive"));
       }
 
+      TC.addProfileRTLibs(Args, CmdArgs);
+
       if (!HasWindowsApp) {
         // Add system libraries. If linking to libwindowsapp.a, that import
         // library replaces all these and we shouldn't accidentally try to


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D58107.186588.patch
Type: text/x-patch
Size: 1315 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190213/8eb939fc/attachment.bin>


More information about the cfe-commits mailing list