Skip to content

Commit ae258f6

Browse files
playstation-eddsmallp-o-p
authored andcommitted
[PS5][Driver] Pass a target emulation to the linker (llvm#114060)
Until now, this has been hardcoded as a downstream patch in lld. Add it to the driver so that the private patch can be removed. PS5 only. On PS4, the equivalent hardcoded configuration will remain in the proprietary linker. SIE tracker: TOOLCHAIN-16704
1 parent b50e5b9 commit ae258f6

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

clang/lib/Driver/ToolChains/PS4CPU.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,9 @@ void tools::PS5cpu::Linker::ConstructJob(Compilation &C, const JobAction &JA,
241241
// handled somewhere else.
242242
Args.ClaimAllArgs(options::OPT_w);
243243

244+
CmdArgs.push_back("-m");
245+
CmdArgs.push_back("elf_x86_64_fbsd");
246+
244247
CmdArgs.push_back(
245248
Args.MakeArgString("--sysroot=" + TC.getSDKLibraryRootDir()));
246249

clang/test/Driver/ps5-linker.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
// Test that a target emulation is supplied to the linker
2+
3+
// RUN: %clang --target=x86_64-sie-ps5 %s -### 2>&1 | FileCheck --check-prefixes=CHECK-EMU %s
4+
5+
// CHECK-EMU: {{ld(\.exe)?}}"
6+
// CHECK-EMU-SAME: "-m" "elf_x86_64_fbsd"
7+
18
// Test that PIE is the default for main components
29

310
// RUN: %clang --target=x86_64-sie-ps5 %s -### 2>&1 | FileCheck --check-prefixes=CHECK-PIE %s

0 commit comments

Comments
 (0)