10
10
#include " CommonArgs.h"
11
11
#include " clang/Config/config.h"
12
12
#include " clang/Driver/Compilation.h"
13
+ #include " clang/Driver/SanitizerArgs.h"
13
14
#include " llvm/Support/Path.h"
14
15
15
16
using namespace clang ::driver;
@@ -100,6 +101,7 @@ void haiku::Linker::ConstructJob(Compilation &C, const JobAction &JA,
100
101
D.getLTOMode () == LTOK_Thin);
101
102
}
102
103
104
+ bool NeedsSanitizerDeps = addSanitizerRuntimes (ToolChain, Args, CmdArgs);
103
105
addLinkerCompressDebugSectionsOption (ToolChain, Args, CmdArgs);
104
106
AddLinkerInputs (ToolChain, Inputs, Args, CmdArgs, JA);
105
107
@@ -125,6 +127,9 @@ void haiku::Linker::ConstructJob(Compilation &C, const JobAction &JA,
125
127
addFortranRuntimeLibs (ToolChain, Args, CmdArgs);
126
128
}
127
129
130
+ if (NeedsSanitizerDeps)
131
+ linkSanitizerRuntimeDeps (ToolChain, Args, CmdArgs);
132
+
128
133
CmdArgs.push_back (" -lgcc" );
129
134
130
135
CmdArgs.push_back (" --push-state" );
@@ -281,3 +286,11 @@ void Haiku::addLibCxxIncludePaths(const llvm::opt::ArgList &DriverArgs,
281
286
Tool *Haiku::buildLinker () const { return new tools::haiku::Linker (*this ); }
282
287
283
288
bool Haiku::HasNativeLLVMSupport () const { return true ; }
289
+
290
+ SanitizerMask Haiku::getSupportedSanitizers () const {
291
+ SanitizerMask Res = ToolChain::getSupportedSanitizers ();
292
+
293
+ Res |= SanitizerKind::Address;
294
+
295
+ return Res;
296
+ }
0 commit comments