@@ -146,6 +146,8 @@ void hexagon::Assembler::ConstructJob(Compilation &C, const JobAction &JA,
146
146
" -mcpu=hexagon" +
147
147
toolchains::HexagonToolChain::GetTargetCPUVersion (Args)));
148
148
149
+ addSanitizerRuntimes (HTC, Args, CmdArgs);
150
+
149
151
if (Output.isFilename ()) {
150
152
CmdArgs.push_back (" -o" );
151
153
CmdArgs.push_back (Output.getFilename ());
@@ -223,6 +225,8 @@ constructHexagonLinkArgs(Compilation &C, const JobAction &JA,
223
225
bool UseShared = IsShared && !IsStatic;
224
226
StringRef CpuVer = toolchains::HexagonToolChain::GetTargetCPUVersion (Args);
225
227
228
+ bool NeedsSanitizerDeps = addSanitizerRuntimes (HTC, Args, CmdArgs);
229
+
226
230
// ----------------------------------------------------------------------------
227
231
// Silence warnings for various options
228
232
// ----------------------------------------------------------------------------
@@ -288,6 +292,12 @@ constructHexagonLinkArgs(Compilation &C, const JobAction &JA,
288
292
AddLinkerInputs (HTC, Inputs, Args, CmdArgs, JA);
289
293
290
294
if (!Args.hasArg (options::OPT_nostdlib, options::OPT_nodefaultlibs)) {
295
+ if (NeedsSanitizerDeps) {
296
+ linkSanitizerRuntimeDeps (HTC, CmdArgs);
297
+
298
+ CmdArgs.push_back (" -lunwind" );
299
+ }
300
+
291
301
CmdArgs.push_back (" -lclang_rt.builtins-hexagon" );
292
302
CmdArgs.push_back (" -lc" );
293
303
}
@@ -450,6 +460,13 @@ Optional<unsigned> HexagonToolChain::getSmallDataThreshold(
450
460
return None;
451
461
}
452
462
463
+ std::string HexagonToolChain::getCompilerRTPath () const {
464
+ SmallString<128 > Dir (getDriver ().SysRoot );
465
+ llvm::sys::path::append (Dir, " usr" , " lib" );
466
+ Dir += SelectedMultilib.gccSuffix ();
467
+ return std::string (Dir.str ());
468
+ }
469
+
453
470
void HexagonToolChain::getHexagonLibraryPaths (const ArgList &Args,
454
471
ToolChain::path_list &LibPaths) const {
455
472
const Driver &D = getDriver ();
0 commit comments