[Sanitizers] Don't use clang_rt.sancov_{begin,end} on Solaris
authorRainer Orth <ro@gcc.gnu.org>
Mon, 8 Jul 2019 22:04:25 +0000 (22:04 +0000)
committerRainer Orth <ro@gcc.gnu.org>
Mon, 8 Jul 2019 22:04:25 +0000 (22:04 +0000)
As explained in https://reviews.llvm.org/D63601, there's no point using clang_rt.sancov_{begin,end}
on Solaris any longer.

This companion patch to the above removes their use from the driver.

Tested on amd64-pc-solaris2.11

Differential Revision: https://reviews.llvm.org/D63602

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@365396 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/ToolChains/Solaris.cpp

index 9ea905801e813506528dc9d96ab4da5907b0dd22..c65b78373959886dc4998997cfcffd7b51b73771 100644 (file)
@@ -96,13 +96,6 @@ void solaris::Linker::ConstructJob(Compilation &C, const JobAction &JA,
         Args.MakeArgString(getToolChain().GetFilePath("crtbegin.o")));
   }
 
-  // Provide __start___sancov_guards.  Solaris ld doesn't automatically create
-  // __start_SECNAME labels.
-  CmdArgs.push_back("--whole-archive");
-  CmdArgs.push_back(
-      getToolChain().getCompilerRTArgString(Args, "sancov_begin"));
-  CmdArgs.push_back("--no-whole-archive");
-
   getToolChain().AddFilePathLibArgs(Args, CmdArgs);
 
   Args.AddAllArgs(CmdArgs, {options::OPT_L, options::OPT_T_Group,
@@ -131,13 +124,6 @@ void solaris::Linker::ConstructJob(Compilation &C, const JobAction &JA,
       linkSanitizerRuntimeDeps(getToolChain(), CmdArgs);
   }
 
-  // Provide __stop___sancov_guards.  Solaris ld doesn't automatically create
-  // __stop_SECNAME labels.
-  CmdArgs.push_back("--whole-archive");
-  CmdArgs.push_back(
-      getToolChain().getCompilerRTArgString(Args, "sancov_end"));
-  CmdArgs.push_back("--no-whole-archive");
-
   if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nostartfiles)) {
     CmdArgs.push_back(
         Args.MakeArgString(getToolChain().GetFilePath("crtend.o")));