Skip to content

Commit

Permalink
[Fuchsia] Never link in implicit "system dependencies" of sanitizer r…
Browse files Browse the repository at this point in the history
…untimes

This is never appropriate on Fuchsia and any future needs for
system library dependencies of compiler-supplied runtimes will
be addressed via .deplibs instead of driver hacks.

Patch By: mcgrathr

Differential Revision: https://reviews.llvm.org/D73734
  • Loading branch information
frobtech authored and petrhosek committed Jan 30, 2020
1 parent 809c872 commit fdf31ae
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions clang/lib/Driver/ToolChains/CommonArgs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -583,6 +583,11 @@ static bool addSanitizerDynamicList(const ToolChain &TC, const ArgList &Args,

void tools::linkSanitizerRuntimeDeps(const ToolChain &TC,
ArgStringList &CmdArgs) {
// Fuchsia never needs these. Any sanitizer runtimes with system
// dependencies use the `.deplibs` feature instead.
if (TC.getTriple().isOSFuchsia())
return;

// Force linking against the system libraries sanitizers depends on
// (see PR15823 why this is necessary).
CmdArgs.push_back("--no-as-needed");
Expand Down

0 comments on commit fdf31ae

Please sign in to comment.