Skip to content

Commit 6c8688b

Browse files
committed
[ToolChain] Simple fix to the default flags for linking the OpenCilk runtime system on Darwin
1 parent 68e7d10 commit 6c8688b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

clang/lib/Driver/ToolChain.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1045,7 +1045,8 @@ llvm::opt::DerivedArgList *ToolChain::TranslateOpenMPTargetArgs(
10451045
}
10461046

10471047
static void addRuntimeRunPath(const ToolChain &TC, const ArgList &Args,
1048-
ArgStringList &CmdArgs) {
1048+
ArgStringList &CmdArgs,
1049+
const llvm::Triple &Triple) {
10491050
// Allow the -fno-rtlib-add-rpath flag to prevent adding this default
10501051
// directory to the runpath.
10511052
if (!Args.hasFlag(options::OPT_frtlib_add_rpath,
@@ -1059,7 +1060,8 @@ static void addRuntimeRunPath(const ToolChain &TC, const ArgList &Args,
10591060
CmdArgs.push_back("-rpath");
10601061
CmdArgs.push_back(Args.MakeArgString(CandidateRPath->c_str()));
10611062
// TODO: Check the portability of the --enable-new-dtags flag.
1062-
CmdArgs.push_back("--enable-new-dtags");
1063+
if (!Triple.isOSDarwin())
1064+
CmdArgs.push_back("--enable-new-dtags");
10631065
}
10641066
}
10651067
}
@@ -1096,7 +1098,7 @@ void ToolChain::AddTapirRuntimeLibArgs(const ArgList &Args,
10961098

10971099
// Add to the executable's runpath the default directory containing OpenCilk
10981100
// runtime, when the runtime is compiled as an integrated component.
1099-
addRuntimeRunPath(*this, Args, CmdArgs);
1101+
addRuntimeRunPath(*this, Args, CmdArgs, Triple);
11001102
if (OnlyStaticOpenCilk)
11011103
CmdArgs.push_back("-Bdynamic");
11021104
CmdArgs.push_back("-lpthread");

0 commit comments

Comments
 (0)