[clang] 9482a83 - [PS5][Driver] Ensure stack sizes are emitted by LTO (#100592)
via cfe-commits
cfe-commits at lists.llvm.org
Fri Jul 26 00:21:45 PDT 2024
Author: Edd Dawson
Date: 2024-07-26T08:21:42+01:00
New Revision: 9482a8385b94f2c32379fb0b946516ff54261b32
URL: https://github.com/llvm/llvm-project/commit/9482a8385b94f2c32379fb0b946516ff54261b32
DIFF: https://github.com/llvm/llvm-project/commit/9482a8385b94f2c32379fb0b946516ff54261b32.diff
LOG: [PS5][Driver] Ensure stack sizes are emitted by LTO (#100592)
... when requested.
Upstreaming a private patch.
SIE tracker: TOOLCHAIN-16575
Added:
Modified:
clang/lib/Driver/ToolChains/PS4CPU.cpp
clang/test/Driver/stack-size-section.c
Removed:
################################################################################
diff --git a/clang/lib/Driver/ToolChains/PS4CPU.cpp b/clang/lib/Driver/ToolChains/PS4CPU.cpp
index 813a0fbedd2b1..f883f29f0c8ca 100644
--- a/clang/lib/Driver/ToolChains/PS4CPU.cpp
+++ b/clang/lib/Driver/ToolChains/PS4CPU.cpp
@@ -266,6 +266,10 @@ void tools::PS5cpu::Linker::ConstructJob(Compilation &C, const JobAction &JA,
if (UseJMC)
AddLTOFlag("-enable-jmc-instrument");
+ if (Args.hasFlag(options::OPT_fstack_size_section,
+ options::OPT_fno_stack_size_section, false))
+ AddLTOFlag("-stack-size-section");
+
if (Arg *A = Args.getLastArg(options::OPT_fcrash_diagnostics_dir))
AddLTOFlag(Twine("-crash-diagnostics-dir=") + A->getValue());
diff --git a/clang/test/Driver/stack-size-section.c b/clang/test/Driver/stack-size-section.c
index 71b9f85692b99..7cd41e491a817 100644
--- a/clang/test/Driver/stack-size-section.c
+++ b/clang/test/Driver/stack-size-section.c
@@ -14,6 +14,7 @@
// RUN: %clang -### --target=x86_64-linux-gnu -flto -fstack-size-section %s 2>&1 | FileCheck %s --check-prefix=LTO
// RUN: %clang -### --target=x86_64-linux-gnu -flto -fstack-size-section -fno-stack-size-section %s 2>&1 | FileCheck %s --check-prefix=LTO-NO
+// RUN: %clang -### --target=x86_64-sie-ps5 -fstack-size-section %s 2>&1 | FileCheck %s --check-prefix=LTO
// LTO: "-plugin-opt=-stack-size-section"
// LTO-NO-NOT: "-plugin-opt=-stack-size-section"
More information about the cfe-commits
mailing list