Allow the compiler driver to link the libclang_rt.profile library.
authorfcambus <fcambus@openbsd.org>
Fri, 3 Sep 2021 16:11:45 +0000 (16:11 +0000)
committerfcambus <fcambus@openbsd.org>
Fri, 3 Sep 2021 16:11:45 +0000 (16:11 +0000)
With this change, passing -fprofile-instr-generate -fcoverage-mapping
when building programs will attempt linking against libclang_rt.profile.a.

Please note that we do not ship the library yet.

OK jca@

gnu/llvm/clang/lib/Driver/ToolChains/OpenBSD.cpp

index 41df6d9..863ca52 100644 (file)
@@ -220,6 +220,8 @@ void openbsd::Linker::ConstructJob(Compilation &C, const JobAction &JA,
     CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath(crtend)));
   }
 
+  ToolChain.addProfileRTLibs(Args, CmdArgs);
+
   const char *Exec = Args.MakeArgString(ToolChain.GetLinkerPath());
   C.addCommand(std::make_unique<Command>(
       JA, *this, ResponseFileSupport::AtFileCurCP(), Exec, CmdArgs, Inputs));