r352610 - [clang] [Driver] [NetBSD] Append -rpath for shared compiler-rt runtimes
Michal Gorny via cfe-commits
cfe-commits at lists.llvm.org
Wed Jan 30 00:20:24 PST 2019
Author: mgorny
Date: Wed Jan 30 00:20:24 2019
New Revision: 352610
URL: http://llvm.org/viewvc/llvm-project?rev=352610&view=rev
Log:
[clang] [Driver] [NetBSD] Append -rpath for shared compiler-rt runtimes
Append appropriate -rpath when using shared compiler-rt runtimes,
e.g. '-fsanitize=address -shared-libasan'. There's already a similar
logic in CommonArgs.cpp but it uses non-standard arch-suffixed
installation directory while we want our driver to work with standard
installation paths.
Differential Revision: https://reviews.llvm.org/D57303
Modified:
cfe/trunk/lib/Driver/ToolChains/NetBSD.cpp
Modified: cfe/trunk/lib/Driver/ToolChains/NetBSD.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/NetBSD.cpp?rev=352610&r1=352609&r2=352610&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains/NetBSD.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains/NetBSD.cpp Wed Jan 30 00:20:24 2019
@@ -255,6 +255,13 @@ void netbsd::Linker::ConstructJob(Compil
bool NeedsXRayDeps = addXRayRuntime(ToolChain, Args, CmdArgs);
AddLinkerInputs(getToolChain(), Inputs, Args, CmdArgs, JA);
+ const SanitizerArgs &SanArgs = ToolChain.getSanitizerArgs();
+ if (SanArgs.needsSharedRt()) {
+ CmdArgs.push_back("-rpath");
+ CmdArgs.push_back(Args.MakeArgString(
+ ToolChain.getCompilerRTPath().c_str()));
+ }
+
unsigned Major, Minor, Micro;
ToolChain.getTriple().getOSVersion(Major, Minor, Micro);
bool useLibgcc = true;
More information about the cfe-commits
mailing list