Skip to content

Commit dce3913

Browse files
Undo accidental behaviour change to -pie.
1 parent ec25e40 commit dce3913

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

clang/lib/Driver/ToolChains/PS4CPU.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -242,12 +242,13 @@ void tools::PS5cpu::Linker::ConstructJob(Compilation &C, const JobAction &JA,
242242
CmdArgs.push_back(
243243
Args.MakeArgString("--sysroot=" + TC.getSDKLibraryRootDir()));
244244

245-
if (!Relocatable) {
246-
// Default to PIE for non-static executables.
247-
const bool PIE = !Args.hasArg(options::OPT_shared, options::OPT_static);
248-
if (Args.hasFlag(options::OPT_pie, options::OPT_no_pie, PIE))
249-
CmdArgs.push_back("-pie");
245+
// Default to PIE for non-static executables.
246+
const bool PIE =
247+
!Args.hasArg(options::OPT_r, options::OPT_shared, options::OPT_static);
248+
if (Args.hasFlag(options::OPT_pie, options::OPT_no_pie, PIE))
249+
CmdArgs.push_back("-pie");
250250

251+
if (!Relocatable) {
251252
// Lazy binding of PLTs is not supported on PlayStation. They are placed in
252253
// the RelRo segment.
253254
CmdArgs.push_back("-z");

0 commit comments

Comments
 (0)