r335856 - OpenBSD driver needs ld.lld in sanitizer context

David Carlier via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 28 06:49:41 PDT 2018


Author: devnexen
Date: Thu Jun 28 06:49:41 2018
New Revision: 335856

URL: http://llvm.org/viewvc/llvm-project?rev=335856&view=rev
Log:
OpenBSD driver needs ld.lld in sanitizer context

Base GNU ld is pretty ancient and does not support --dynamic-list flag.
For conveniency, we can it automatically when compile with ubsan sanitizer flag.

Reviewers: dberris

Reviewed by: dberris

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

Modified:
    cfe/trunk/lib/Driver/ToolChains/OpenBSD.cpp

Modified: cfe/trunk/lib/Driver/ToolChains/OpenBSD.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/OpenBSD.cpp?rev=335856&r1=335855&r2=335856&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains/OpenBSD.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains/OpenBSD.cpp Thu Jun 28 06:49:41 2018
@@ -230,7 +230,9 @@ void openbsd::Linker::ConstructJob(Compi
           Args.MakeArgString(getToolChain().GetFilePath("crtendS.o")));
   }
 
-  const char *Exec = Args.MakeArgString(getToolChain().GetLinkerPath());
+  const char *Exec = Args.MakeArgString(
+      !NeedsSanitizerDeps ? getToolChain().GetLinkerPath()
+                          : getToolChain().GetProgramPath("ld.lld"));
   C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
 }
 




More information about the cfe-commits mailing list