[PATCH] D63602: [Sanitizers] Don't use clang_rt.sancov_{begin, end} on Solaris

Rainer Orth via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 20 07:23:40 PDT 2019


ro created this revision.
ro added a reviewer: alekseyshl.
Herald added a subscriber: fedor.sergeev.
Herald added a project: clang.

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`, ok for trunk?


Repository:
  rC Clang

https://reviews.llvm.org/D63602

Files:
  lib/Driver/ToolChains/Solaris.cpp


Index: lib/Driver/ToolChains/Solaris.cpp
===================================================================
--- lib/Driver/ToolChains/Solaris.cpp
+++ lib/Driver/ToolChains/Solaris.cpp
@@ -96,13 +96,6 @@
         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 @@
       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")));


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D63602.205809.patch
Type: text/x-patch
Size: 1230 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190620/44aa09a5/attachment.bin>


More information about the cfe-commits mailing list