For linking on FreeBSD, don't add a hardcoded "-L/usr/lib", but
retrieve the library paths from the ToolChain object instead.

Copy the relevant code from linuxtools::Link::ConstructJob(), and
replace the std::string stuff with llvm::StringRef, while we're here.


Index: tools/clang/lib/Driver/Tools.cpp
===================================================================
--- tools/clang/lib/Driver/Tools.cpp	(revision 126502)
+++ tools/clang/lib/Driver/Tools.cpp	(working copy)
@@ -3200,7 +3200,12 @@ void freebsd::Link::ConstructJob(Compilation &C, c
   }
 
   Args.AddAllArgs(CmdArgs, options::OPT_L);
-  CmdArgs.push_back("-L/usr/lib");
+
+  const ToolChain::path_list Paths = getToolChain().getFilePaths();
+  for (ToolChain::path_list::const_iterator i = Paths.begin(), e = Paths.end();
+       i != e; ++i)
+    CmdArgs.push_back(Args.MakeArgString(llvm::StringRef("-L") + *i));
+
   Args.AddAllArgs(CmdArgs, options::OPT_T_Group);
   Args.AddAllArgs(CmdArgs, options::OPT_e);
   Args.AddAllArgs(CmdArgs, options::OPT_s);
@@ -3562,14 +3567,10 @@ void linuxtools::Link::ConstructJob(Compilation &C
   Args.AddAllArgs(CmdArgs, options::OPT_L);
 
   const ToolChain::path_list Paths = ToolChain.getFilePaths();
+  for (ToolChain::path_list::const_iterator i = Paths.begin(), e = Paths.end();
+       i != e; ++i)
+    CmdArgs.push_back(Args.MakeArgString(llvm::StringRef("-L") + *i));
 
-  for (ToolChain::path_list::const_iterator i = Paths.begin(),
-         e = Paths.end();
-       i != e; ++i) {
-    const std::string &s = *i;
-    CmdArgs.push_back(Args.MakeArgString(std::string("-L") + s));
-  }
-
   AddLinkerInputs(ToolChain, Inputs, Args, CmdArgs);
 
   if (D.CCCIsCXX && !Args.hasArg(options::OPT_nostdlib)) {


