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

llvm-svn: 335856
This commit is contained in:
David Carlier 2018-06-28 13:49:41 +00:00
parent e666545a71
commit 11f1d7e9e4
1 changed files with 3 additions and 1 deletions

View File

@ -230,7 +230,9 @@ void openbsd::Linker::ConstructJob(Compilation &C, const JobAction &JA,
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));
}