Skip to content

Commit 9482a83

Browse files
[PS5][Driver] Ensure stack sizes are emitted by LTO (#100592)
... when requested. Upstreaming a private patch. SIE tracker: TOOLCHAIN-16575
1 parent ed1c67b commit 9482a83

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

clang/lib/Driver/ToolChains/PS4CPU.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,10 @@ void tools::PS5cpu::Linker::ConstructJob(Compilation &C, const JobAction &JA,
266266
if (UseJMC)
267267
AddLTOFlag("-enable-jmc-instrument");
268268

269+
if (Args.hasFlag(options::OPT_fstack_size_section,
270+
options::OPT_fno_stack_size_section, false))
271+
AddLTOFlag("-stack-size-section");
272+
269273
if (Arg *A = Args.getLastArg(options::OPT_fcrash_diagnostics_dir))
270274
AddLTOFlag(Twine("-crash-diagnostics-dir=") + A->getValue());
271275

clang/test/Driver/stack-size-section.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
// RUN: %clang -### --target=x86_64-linux-gnu -flto -fstack-size-section %s 2>&1 | FileCheck %s --check-prefix=LTO
1616
// RUN: %clang -### --target=x86_64-linux-gnu -flto -fstack-size-section -fno-stack-size-section %s 2>&1 | FileCheck %s --check-prefix=LTO-NO
17+
// RUN: %clang -### --target=x86_64-sie-ps5 -fstack-size-section %s 2>&1 | FileCheck %s --check-prefix=LTO
1718

1819
// LTO: "-plugin-opt=-stack-size-section"
1920
// LTO-NO-NOT: "-plugin-opt=-stack-size-section"

0 commit comments

Comments
 (0)