Skip to content

Commit

Permalink
[Darwin] Avoid adding redundant rpath flags when linking OpenCilk run…
Browse files Browse the repository at this point in the history
…time libraries.
  • Loading branch information
neboat committed Dec 6, 2023
1 parent 2e33183 commit ffd26ee
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions clang/lib/Driver/ToolChains/Darwin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3459,10 +3459,7 @@ void DarwinClang::AddLinkTapirRuntime(const ArgList &Args,
case TapirTargetID::OpenCilk: {
bool StaticOpenCilk = Args.hasArg(options::OPT_static_libopencilk);
bool UseAsan = getSanitizerArgs(Args).needsAsanRt();

auto RLO = RLO_AlwaysLink;
if (!StaticOpenCilk)
RLO = RuntimeLinkOptions(RLO | RLO_AddRPath);

// If pedigrees are enabled, link the OpenCilk pedigree library.
if (Args.hasArg(options::OPT_fopencilk_enable_pedigrees))
Expand All @@ -3483,6 +3480,11 @@ void DarwinClang::AddLinkTapirRuntime(const ArgList &Args,
: "opencilk-personality-c",
RLO, !StaticOpenCilk);

if (!StaticOpenCilk)
// Add rpath flag for linking the final Tapir runtime library, to avoid
// warnings about ignoring duplicate rpaths.
RLO = RuntimeLinkOptions(RLO | RLO_AddRPath);

// Link the opencilk runtime. We do this after linking the personality
// function, to ensure that symbols are resolved correctly when using static
// linking.
Expand Down

0 comments on commit ffd26ee

Please sign in to comment.