From 6c8688b5a0adec6d5453cbc1c66d15e347ffb932 Mon Sep 17 00:00:00 2001 From: TB Schardl Date: Fri, 3 Jul 2020 14:51:30 -0400 Subject: [PATCH] [ToolChain] Simple fix to the default flags for linking the OpenCilk runtime system on Darwin --- clang/lib/Driver/ToolChain.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/clang/lib/Driver/ToolChain.cpp b/clang/lib/Driver/ToolChain.cpp index c5a2b156f5b5..0303f2863115 100644 --- a/clang/lib/Driver/ToolChain.cpp +++ b/clang/lib/Driver/ToolChain.cpp @@ -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, @@ -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"); } } } @@ -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");