r204939 - InstrProf: Pull in runtime on non-Darwin

Kostya Serebryany kcc at google.com
Fri Mar 28 00:42:27 PDT 2014


This does not help.
For asan&co we solve the same problem by
adding -whole-archive/-no-whole-archive around the library in the linker
command.

--kcc


On Thu, Mar 27, 2014 at 8:20 PM, Duncan P. N. Exon Smith <
dexonsmith at apple.com> wrote:

> Author: dexonsmith
> Date: Thu Mar 27 11:20:02 2014
> New Revision: 204939
>
> URL: http://llvm.org/viewvc/llvm-project?rev=204939&view=rev
> Log:
> InstrProf: Pull in runtime on non-Darwin
>
> r204379 changed the way the profile runtime gets pulled in, but missed
> updating non-Darwin targets.
>
> Modified:
>     cfe/trunk/lib/Driver/Tools.cpp
>
> Modified: cfe/trunk/lib/Driver/Tools.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=204939&r1=204938&r2=204939&view=diff
>
> ==============================================================================
> --- cfe/trunk/lib/Driver/Tools.cpp (original)
> +++ cfe/trunk/lib/Driver/Tools.cpp Thu Mar 27 11:20:02 2014
> @@ -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");
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140328/d80a38e9/attachment.html>


More information about the cfe-commits mailing list