[PATCH] D48574: OpenBSD driver needs ld.lld in sanitiser context

David CARLIER via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 25 15:29:44 PDT 2018


devnexen created this revision.
devnexen added a reviewer: dberris.
devnexen created this object with visibility "All Users".
Herald added a subscriber: cfe-commits.

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


Repository:
  rC Clang

https://reviews.llvm.org/D48574

Files:
  lib/Driver/ToolChains/OpenBSD.cpp


Index: lib/Driver/ToolChains/OpenBSD.cpp
===================================================================
--- lib/Driver/ToolChains/OpenBSD.cpp
+++ lib/Driver/ToolChains/OpenBSD.cpp
@@ -230,7 +230,9 @@
           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));
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D48574.152791.patch
Type: text/x-patch
Size: 616 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180625/d56c3920/attachment.bin>


More information about the cfe-commits mailing list