
The following discrepancies concerning `-isysroot` and `--sysroot` motivated this change: - The SDK directory can be specified via `-isysroot`, but `--sysroot` has no influence over this. Yet, we check for the presence of either switch to determine whether we ought to warn about a missing SDK *headers*. - The presence of `-isysroot` is ignored when deciding whether to warn about missing SDK *libraries*, depsite it being the only switch capable of specifying a non-default SDK location. - The `--sysroot`s passed to the PlayStation linkers by the driver are unrelated to the SDK directory resolved in the PS4PS5Base constructor. Following this change, we attempt to derive an SDK root from a platform- specific environment variable. Failing that, we derive it from the location of the driver. This then becomes the default root directory for both header and library search. `--sysroot` overrides both search roots. `-isysroot` overrides only the header search root. If both are specified, `--sysroot` specifies the library search root and `-isysroot` specifies the header search root. For each search root that was not overridden, a warning is emitted if expected header/library search paths are missing inside that root. The test updates to ps{4,5}-sdk-root.c were of the scale of a rewrite so I also took the opportunity to clarify the purpose of each part, eliminate some redundancy and add some missing coverage. SIE tracker: TOOLCHAIN-16704
40 lines
2.0 KiB
C
40 lines
2.0 KiB
C
// Test that -static is forwarded to the linker
|
|
|
|
// RUN: %clang --target=x86_64-scei-ps4 -static %s -### 2>&1 | FileCheck --check-prefixes=CHECK-STATIC %s
|
|
|
|
// CHECK-STATIC: {{ld(\.exe)?}}"
|
|
// CHECK-STATIC-SAME: "-static"
|
|
|
|
// Test the driver's control over the JustMyCode behavior with linker flags.
|
|
|
|
// RUN: %clang --target=x86_64-scei-ps4 -fjmc %s -### 2>&1 | FileCheck --check-prefixes=CHECK-LTO,CHECK-LIB %s
|
|
// RUN: %clang --target=x86_64-scei-ps4 -flto=thin -fjmc %s -### 2>&1 | FileCheck --check-prefixes=CHECK-LTO,CHECK-LIB %s
|
|
// RUN: %clang --target=x86_64-scei-ps4 -flto=full -fjmc %s -### 2>&1 | FileCheck --check-prefixes=CHECK-LTO,CHECK-LIB %s
|
|
|
|
// CHECK-LTO: "-lto-debug-options= -enable-jmc-instrument"
|
|
|
|
// Check the default library name.
|
|
// CHECK-LIB: "--whole-archive" "-lSceDbgJmc" "--no-whole-archive"
|
|
|
|
// Test the driver's control over the -fcrash-diagnostics-dir behavior with linker flags.
|
|
|
|
// RUN: %clang --target=x86_64-scei-ps4 -fcrash-diagnostics-dir=mydumps %s -### 2>&1 | FileCheck --check-prefixes=CHECK-DIAG-LTO %s
|
|
// RUN: %clang --target=x86_64-scei-ps4 -flto=thin -fcrash-diagnostics-dir=mydumps %s -### 2>&1 | FileCheck --check-prefixes=CHECK-DIAG-LTO %s
|
|
// RUN: %clang --target=x86_64-scei-ps4 -flto=full -fcrash-diagnostics-dir=mydumps %s -### 2>&1 | FileCheck --check-prefixes=CHECK-DIAG-LTO %s
|
|
|
|
// CHECK-DIAG-LTO: "-lto-debug-options= -crash-diagnostics-dir=mydumps"
|
|
|
|
// Test that -lto-debug-options is only supplied to the linker when necessary
|
|
|
|
// RUN: %clang --target=x86_64-scei-ps4 %s -### 2>&1 | FileCheck --check-prefixes=CHECK-NO-LTO %s
|
|
// CHECK-NO-LTO-NOT: -lto-debug-options
|
|
|
|
// Test the driver passes a sysroot to the linker. Without --sysroot, its value
|
|
// is sourced from the SDK environment variable.
|
|
|
|
// RUN: env SCE_ORBIS_SDK_DIR=mysdk %clang --target=x64_64-scei-ps4 %s -### 2>&1 | FileCheck --check-prefixes=CHECK-SYSROOT %s
|
|
// RUN: env SCE_ORBIS_SDK_DIR=other %clang --target=x64_64-scei-ps4 %s -### --sysroot=mysdk 2>&1 | FileCheck --check-prefixes=CHECK-SYSROOT %s
|
|
|
|
// CHECK-SYSROOT: {{ld(\.exe)?}}"
|
|
// CHECK-SYSROOT-SAME: "--sysroot=mysdk"
|