@@ -1144,6 +1144,17 @@ void DarwinClang::AddLinkSanitizerLibArgs(const ArgList &Args,
11441144 AddLinkRuntimeLib (Args, CmdArgs, Sanitizer, RLO, Shared);
11451145}
11461146
1147+ void DarwinClang::AddCilktoolRTLibs (const ArgList &Args,
1148+ ArgStringList &CmdArgs) const {
1149+ if (Arg *A = Args.getLastArg (options::OPT_fcilktool_EQ)) {
1150+ StringRef Val = A->getValue ();
1151+ auto RLO = RuntimeLinkOptions (RLO_AlwaysLink);
1152+ AddLinkRuntimeLib (Args, CmdArgs, Val, RLO);
1153+ // Link in the C++ standard library
1154+ AddCXXStdlibLibArgs (Args, CmdArgs);
1155+ }
1156+ }
1157+
11471158ToolChain::RuntimeLibType DarwinClang::GetRuntimeLibType (
11481159 const ArgList &Args) const {
11491160 if (Arg* A = Args.getLastArg (options::OPT_rtlib_EQ)) {
@@ -1193,7 +1204,7 @@ void DarwinClang::AddLinkRuntimeLibArgs(const ArgList &Args,
11931204 if (Sanitize.needsTsanRt ())
11941205 AddLinkSanitizerLibArgs (Args, CmdArgs, " tsan" );
11951206 if (Sanitize.needsCilksanRt ())
1196- AddLinkSanitizerLibArgs (Args, CmdArgs, " cilk " );
1207+ AddLinkSanitizerLibArgs (Args, CmdArgs, " cilksan " );
11971208 if (Sanitize.needsFuzzer () && !Args.hasArg (options::OPT_dynamiclib)) {
11981209 AddLinkSanitizerLibArgs (Args, CmdArgs, " fuzzer" , /* shared=*/ false );
11991210
@@ -1205,6 +1216,8 @@ void DarwinClang::AddLinkRuntimeLibArgs(const ArgList &Args,
12051216 AddLinkSanitizerLibArgs (Args, CmdArgs, " stats" );
12061217 }
12071218
1219+ AddCilktoolRTLibs (Args, CmdArgs);
1220+
12081221 const XRayArgs &XRay = getXRayArgs ();
12091222 if (XRay.needsXRayRt ()) {
12101223 AddLinkRuntimeLib (Args, CmdArgs, " xray" );
0 commit comments