-
-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
switch: updated build environment for Nintendo Switch. #476
base: main
Are you sure you want to change the base?
Conversation
@@ -161,11 +195,6 @@ else() | |||
target_link_libraries(chiaki-lib OpenSSL::Crypto) | |||
endif() | |||
|
|||
if (CHIAKI_USE_SYSTEM_CURL) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if curl comes after mbedtls, it fails at linking time as it is unable to find the mbedtls references.
@@ -251,7 +251,7 @@ static void set_timeout(struct timespec *timeout, uint64_t ms_from_now) | |||
} | |||
#endif | |||
|
|||
#if !__APPLE__ | |||
#if !__APPLE__ && !__SWITCH__ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pthread_clockjoin_np is not avaliable in aarch64_none_elf. It appears that this function is used in chiaki-cli only (I believe) so I have removed it for switch for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it can be removed for switch, it's just used for the discover command in the cli
@@ -384,7 +387,7 @@ CHIAKI_EXPORT ChiakiErrorCode chiaki_gkcrypt_gmac(ChiakiGKCrypt *gkcrypt, uint64 | |||
} | |||
|
|||
// encrypt without additional data | |||
if(mbedtls_gcm_starts(&actx, MBEDTLS_GCM_ENCRYPT, iv, CHIAKI_GKCRYPT_BLOCK_SIZE, NULL, 0) != 0) | |||
if(mbedtls_gcm_starts(&actx, MBEDTLS_GCM_ENCRYPT, iv, CHIAKI_GKCRYPT_BLOCK_SIZE) != 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe switch is the only build that uses mbedtls, I can add switch ifdefs around the mbedtls api updates if need be.
In other areas, mbedtls 3.x breaks a ton of stuff especially around ecdh calculation as all the variables are private. I have patched switch-mbedtls to remove the private checks on the structs as I don't see a clear way in the public API to extract the required variables to recalculate dhk.
@@ -108,7 +108,7 @@ class IO | |||
|
|||
~IO(); | |||
void SetMesaConfig(); | |||
bool VideoCB(uint8_t *buf, size_t buf_size); | |||
bool VideoCB(uint8_t *buf, size_t buf_size, int32_t frames_lost, bool frame_recovered, void *user); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
libavcodec api changes
@@ -28,7 +28,6 @@ bool appletMainLoop() | |||
// use a custom nintendo switch socket config | |||
// chiaki requiers many threads with udp/tcp sockets | |||
static const SocketInitConfig g_chiakiSocketInitConfig = { | |||
.bsdsockets_version = 1, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
libnx changes, doxygen
@xlanor the icon is different from the logo and is here: https://github.com/streetpea/chiaki-ng/blob/main/gui/chiaking.png |
Will swap in the morning |
other than the icon swapping and potentially looking at setting CPATH instead of hardcoding the path, LGTM |
Signed-off-by: xlanor <[email protected]>
Signed-off-by: xlanor <[email protected]>
Signed-off-by: xlanor <[email protected]>
@streetpea changes made! |
Signed-off-by: xlanor <[email protected]>
hmm I just realised the changes worked for mbedtls + curl but not jsonc. Will come back and look at json c again. For some reason the INCLUDE_DIRECTORIES is not being set which I think is causing this
Will look at it tonight. |
can someone upload a compiled .nro for the switch 2 use? |
This is not ready for use yet, only updates the build environment.
Please keep this PR to dev discussion
…Sent from my iPhone
On Sat, 16 Nov 2024 at 11:23, Black-Hill852 ***@***.***> wrote:
can someone upload a compiled .ro for the switch 2 use?
—
Reply to this email directly, view it on GitHub
<#476 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AG64FNRKNT3OVPNZMDYQXVL2A4TLZAVCNFSM6AAAAABR4DVI6SVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIOBQGUZDQNRRGU>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
okay thanks for that info. I use the old chiaki.nro and there is the Problem, no Pin Support. |
Signed-off-by: xlanor <[email protected]>
Signed-off-by: xlanor <[email protected]>
THIS DOES NOT INDICATE THAT CHIAKI-NG IS READY FOR THE SWITCH!
This is an initial PR fixes the build environment and updates some libraries for Nintendo Switch environment. Tested against fw 18.1.
A basic compilation works and I am able to connect locally. However, note that things like unlocking the PS5 doesnt seem to work.
I'm pretty sure the cmake stuff that I changed is not optimal but thats the only thing that can find the right libraries at compile time. open to suggestions.
switch-curl and switch-mbedtls have been updated past the devkitpro supplied versions to 8.11.0 and 3.6.2 respectively.
Both of them have been patched before compilation for compatibility with existing code in libchiaki/switch architecture. You can find the build scripts and patches for the updated development and compilation environment here. I will move them into this repository once I have stopped pushing changes every other day to test different things out.
The gist of the changes is that switch-curl has been bumped to 8.11.0 with WSS and mbedtls has been re-enabled, while mbed-tls has been bumped to 3.6.2 and patched to removed private variables in structs.
Thanks to ngynkvyn as well for helping to debug some of the environment stuff.
I am sure there will be more work to be done, but this gets the switch code to a state where it is buildable at least.
Those in #355 who wanted to help with development, this is probably a good time now that it can be compiled.