diff --git a/clang/lib/Driver/ToolChains/PS4CPU.cpp b/clang/lib/Driver/ToolChains/PS4CPU.cpp index 261c136de782e7..df43da93d77555 100644 --- a/clang/lib/Driver/ToolChains/PS4CPU.cpp +++ b/clang/lib/Driver/ToolChains/PS4CPU.cpp @@ -375,9 +375,10 @@ void tools::PS5cpu::Linker::ConstructJob(Compilation &C, const JobAction &JA, } if (UseJMC) { + CmdArgs.push_back("--push-state"); CmdArgs.push_back("--whole-archive"); CmdArgs.push_back("-lSceJmc_nosubmission"); - CmdArgs.push_back("--no-whole-archive"); + CmdArgs.push_back("--pop-state"); } if (Args.hasArg(options::OPT_fuse_ld_EQ)) { diff --git a/clang/test/Driver/ps5-linker.c b/clang/test/Driver/ps5-linker.c index 8a0ade91871295..95267942edc172 100644 --- a/clang/test/Driver/ps5-linker.c +++ b/clang/test/Driver/ps5-linker.c @@ -89,13 +89,13 @@ // Test the driver's control over the JustMyCode behavior with linker flags. -// RUN: %clang --target=x86_64-sie-ps5 -fjmc %s -### 2>&1 | FileCheck --check-prefixes=CHECK,CHECK-LIB %s -// RUN: %clang --target=x86_64-sie-ps5 -flto -fjmc %s -### 2>&1 | FileCheck --check-prefixes=CHECK,CHECK-LIB %s +// RUN: %clang --target=x86_64-sie-ps5 -fjmc %s -### 2>&1 | FileCheck --check-prefixes=CHECK,CHECK-JMC %s +// RUN: %clang --target=x86_64-sie-ps5 -flto -fjmc %s -### 2>&1 | FileCheck --check-prefixes=CHECK,CHECK-JMC %s // CHECK: -plugin-opt=-enable-jmc-instrument // Check the default library name. -// CHECK-LIB: "--whole-archive" "-lSceJmc_nosubmission" "--no-whole-archive" +// CHECK-JMC: "--push-state" "--whole-archive" "-lSceJmc_nosubmission" "--pop-state" // Test the driver's control over the -fcrash-diagnostics-dir behavior with linker flags.