File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -1617,6 +1617,10 @@ void DarwinClang::AddLinkRuntimeLibArgs(const ArgList &Args,
16171617 }
16181618 }
16191619
1620+ if (Sanitize.needsMemProfRt ())
1621+ if (hasExportSymbolDirective (Args))
1622+ addExportedSymbol (CmdArgs, " ___memprof_default_options_str" );
1623+
16201624 const XRayArgs &XRay = getXRayArgs ();
16211625 if (XRay.needsXRayRt ()) {
16221626 AddLinkRuntimeLib (Args, CmdArgs, " xray" );
Original file line number Diff line number Diff line change 1717
1818// RUN: not %clangxx --target=x86_64-linux-gnu -fprofile-generate -fmemory-profile-use=foo %s -### 2>&1 | FileCheck %s --check-prefix=CONFLICTWITHPGOINSTR
1919// CONFLICTWITHPGOINSTR: error: invalid argument '-fmemory-profile-use=foo' not allowed with '-fprofile-generate'
20+
21+ // Test that we export the __memprof_default_options_str on Darwin because it has WeakAnyLinkage
22+ // RUN: %clangxx --target=arm64-apple-ios -fmemory-profile %s -### 2>&1 | FileCheck %s -check-prefix=EXPORT-BASE --implicit-check-not=exported_symbol
23+ // RUN: %clangxx --target=x86_64-linux-gnu -fmemory-profile %s -### 2>&1 | FileCheck %s -check-prefix=EXPORT-BASE --implicit-check-not=exported_symbol
24+ // RUN: %clangxx --target=arm64-apple-ios -fmemory-profile -exported_symbols_list /dev/null %s -### 2>&1 | FileCheck %s --check-prefixes=EXPORT-BASE,EXPORT
25+ // FIXME: Darwin needs to link in the runtime, then we can use the regular CHECK prefix
26+ // EXPORT-BASE: "-cc1" {{.*}} "-fmemory-profile"
27+ // EXPORT: "-exported_symbol" "___memprof_default_options_str"
You can’t perform that action at this time.
0 commit comments