Skip to content

Commit

Permalink
[ToolChain] Simple fix to the default flags for linking the OpenCilk …
Browse files Browse the repository at this point in the history
…runtime system on Darwin
  • Loading branch information
neboat committed Jul 4, 2020
1 parent 68e7d10 commit 6c8688b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions clang/lib/Driver/ToolChain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1045,7 +1045,8 @@ llvm::opt::DerivedArgList *ToolChain::TranslateOpenMPTargetArgs(
}

static void addRuntimeRunPath(const ToolChain &TC, const ArgList &Args,
ArgStringList &CmdArgs) {
ArgStringList &CmdArgs,
const llvm::Triple &Triple) {
// Allow the -fno-rtlib-add-rpath flag to prevent adding this default
// directory to the runpath.
if (!Args.hasFlag(options::OPT_frtlib_add_rpath,
Expand All @@ -1059,7 +1060,8 @@ static void addRuntimeRunPath(const ToolChain &TC, const ArgList &Args,
CmdArgs.push_back("-rpath");
CmdArgs.push_back(Args.MakeArgString(CandidateRPath->c_str()));
// TODO: Check the portability of the --enable-new-dtags flag.
CmdArgs.push_back("--enable-new-dtags");
if (!Triple.isOSDarwin())
CmdArgs.push_back("--enable-new-dtags");
}
}
}
Expand Down Expand Up @@ -1096,7 +1098,7 @@ void ToolChain::AddTapirRuntimeLibArgs(const ArgList &Args,

// Add to the executable's runpath the default directory containing OpenCilk
// runtime, when the runtime is compiled as an integrated component.
addRuntimeRunPath(*this, Args, CmdArgs);
addRuntimeRunPath(*this, Args, CmdArgs, Triple);
if (OnlyStaticOpenCilk)
CmdArgs.push_back("-Bdynamic");
CmdArgs.push_back("-lpthread");
Expand Down

0 comments on commit 6c8688b

Please sign in to comment.