5 Commits

Author SHA1 Message Date
Edd Dawson
1a1dbac5bc
[PS4/PS5][Driver] Observe <sysroot>/target/lib for libraries (#123350)
On PS5, if a custom --sysroot is supplied, `<sysroot>/target/lib` should
be added to the library search paths (this already occurs if the default
`--sysroot` is not overridden). 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.

On PS4 the library search paths remain unchanged. The proprietary linker
will continue to handle this aspect.

On either platform, warn if `<sysroot>/target/lib` is absent.
Previously, such warnings were emitted only when the default --sysroot
was not overridden.

SIE tracker: TOOLCHAIN-16704
2025-01-22 10:46:17 +00:00
Edd Dawson
1e23a6142a
[PS4,PS5][Driver] Detangle --sysroot and -isysroot (#107410)
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
2024-09-17 12:09:38 +01:00
Edd Dawson
f574b9c929
[PS4,PS5][Driver] Check for absent SDK when -nostdlib/-nodefaultlibs (#107112)
The PlayStation drivers emit warnings if it looks like SDK libraries are
missing. Until this point, the check was skipped when either `-nostdlib`
or `-nodefaultlibs` was supplied. I believe the idea is that if you
aren't linking default libraries, you won't be in need of the SDK.

However, in a situation where these switches are supplied, users may
still want to pass `-lSomeSDKLib` to the driver/linker with the
expectation that libSomeSDKLib.a will be sourced from the SDK. That is,
`-nodefaultlibs` and `-nostdlib` affect the libraries passed to the
linker, but not the library search paths.

So this change removes `-nostdlib`/`-nodefaultlibs` from consideration
when deciding whether or not to probe for the SDK's existence.

N.B. complete behaviour for `-nostdlib` and `-nodefaultlibs` is yet to
be added to the PlayStation compiler drivers. Coming soon.

SIE tracker: TOOLCHAIN-16704
2024-09-04 20:36:24 +01:00
Ying Yi
0e5fe1cdac Remove REQUIRES: x86-registered-target from ps4/ps5 driver tests
Reviewed By: probinson

Differential Revision: https://reviews.llvm.org/D132950
2022-08-31 09:56:37 +01:00
Paul Robinson
7726ad04e2 [PS5] Add basic PS5 driver behavior
This adds a PS5-specific ToolChain subclass, which defines some basic
PS5 driver behavior. Future patches will add more target-specific
driver behavior.
2022-04-14 12:45:33 -07:00