From 67b42c16493bf36abe7ab093ea0a1821b36a29cb Mon Sep 17 00:00:00 2001 From: "Duncan P. N. Exon Smith" Date: Thu, 27 Mar 2014 16:20:02 +0000 Subject: [PATCH] InstrProf: Pull in runtime on non-Darwin r204379 changed the way the profile runtime gets pulled in, but missed updating non-Darwin targets. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@204939 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Driver/Tools.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index ea60551b00..5b997e7d37 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -1807,6 +1807,13 @@ static void addProfileRT( Args.hasArg(options::OPT_coverage))) return; + // Pull in runtime for -fprofile-inst-generate. This is required since there + // are no calls to the runtime in the code. + if (Args.hasArg(options::OPT_fprofile_instr_generate)) { + CmdArgs.push_back("-u"); + CmdArgs.push_back("___llvm_profile_runtime"); + } + SmallString<128> LibProfile = getCompilerRTLibDir(TC); llvm::sys::path::append(LibProfile, Twine("libclang_rt.profile-") + getArchNameForCompilerRTLib(TC) + ".a"); -- 2.40.0