summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver/Tools.cpp
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2015-07-02 01:48:12 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2015-07-02 01:48:12 +0000
commit581f438f4c8d100fe864ecf71c48a60699e9c095 (patch)
tree79e984de998ed6f732a525809ff1fe54833326a8 /clang/lib/Driver/Tools.cpp
parentd3b9917d854131e34a85c2af138085e078fde296 (diff)
downloadbcm5719-llvm-581f438f4c8d100fe864ecf71c48a60699e9c095.tar.gz
bcm5719-llvm-581f438f4c8d100fe864ecf71c48a60699e9c095.zip
Driver: add support for linking the UBSan runtime library on Windows.
On Windows the user may invoke the linker directly, so we might not have an opportunity to add runtime library flags to the linker command line. Instead, instruct the code generator to embed linker directive in the object file that cause the required runtime libraries to be linked. We might also want to do something similar for ASan, but it seems to have its own special complexities which may make this infeasible. Differential Revision: http://reviews.llvm.org/D10862 llvm-svn: 241225
Diffstat (limited to 'clang/lib/Driver/Tools.cpp')
-rw-r--r--clang/lib/Driver/Tools.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp
index bb56c659e89..05b0e08c1d5 100644
--- a/clang/lib/Driver/Tools.cpp
+++ b/clang/lib/Driver/Tools.cpp
@@ -2231,10 +2231,6 @@ static void CollectArgsForIntegratedAssembler(Compilation &C,
// Until ARM libraries are build separately, we have them all in one library
static StringRef getArchNameForCompilerRTLib(const ToolChain &TC) {
- // FIXME: handle 64-bit
- if (TC.getTriple().isOSWindows() &&
- !TC.getTriple().isWindowsItaniumEnvironment())
- return "i386";
if (TC.getArch() == llvm::Triple::arm || TC.getArch() == llvm::Triple::armeb)
return "arm";
return TC.getArchName();
@@ -2251,8 +2247,8 @@ static SmallString<128> getCompilerRTLibDir(const ToolChain &TC) {
return Res;
}
-static SmallString<128> getCompilerRT(const ToolChain &TC, StringRef Component,
- bool Shared = false) {
+SmallString<128> tools::getCompilerRT(const ToolChain &TC, StringRef Component,
+ bool Shared) {
const char *Env = TC.getTriple().getEnvironment() == llvm::Triple::Android
? "-android"
: "";
@@ -3927,7 +3923,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
}
const SanitizerArgs &Sanitize = getToolChain().getSanitizerArgs();
- Sanitize.addArgs(Args, CmdArgs);
+ Sanitize.addArgs(getToolChain(), Args, CmdArgs, InputType);
// Report an error for -faltivec on anything other than PowerPC.
if (const Arg *A = Args.getLastArg(options::OPT_faltivec)) {
OpenPOWER on IntegriCloud