Skip to content
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

armv7 PSVita OS support via newlib #3209

Merged
merged 1 commit into from Apr 26, 2023
Merged

armv7 PSVita OS support via newlib #3209

merged 1 commit into from Apr 26, 2023

Conversation

nikarh
Copy link
Contributor

@nikarh nikarh commented Apr 20, 2023

Added support for ps vita via newlib.
Similar to #2480, but for a different device.

I'm working on adding support of std for vita, and this is essentially a prerequisite.

@rustbot
Copy link
Collaborator

rustbot commented Apr 20, 2023

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @JohnTitor (or someone else) soon.

Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (S-waiting-on-review and S-waiting-on-author) stays updated, invoking these commands when appropriate:

  • @rustbot author: the review is finished, PR author should check the comments and take action accordingly
  • @rustbot review: the author is ready for a review, this PR will be queued again in the reviewer's queue

@JohnTitor
Copy link
Member

We received a report about a similar target in the past (sorry, I cannot reveal it as it's sensitive), so I'd like to confirm with the core team if everything is OK before accepting this.

@nikarh
Copy link
Contributor Author

nikarh commented Apr 26, 2023

Sure!

Just wanted to mention, that this PR should probably have the same implications as #2480.
Basically, no vendor API's are exposed here, only standard C APIs provided by newlib, and it's up to newlib provider how they are implemented. So technically, no NDA is breached here and no IP is exposed here.

@JohnTitor
Copy link
Member

Ah, we can go ahead then. Thank you for clarifying! @bors r+

@bors
Copy link
Contributor

bors commented Apr 26, 2023

📌 Commit 04fae4b has been approved by JohnTitor

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Apr 26, 2023

⌛ Testing commit 04fae4b with merge 6f07eda...

bors added a commit that referenced this pull request Apr 26, 2023
armv7 PSVita OS support via newlib

Added support for ps vita via newlib.
Similar to #2480, but for a different device.

I'm working on adding support of std for vita, and this is essentially a prerequisite.
@bors
Copy link
Contributor

bors commented Apr 26, 2023

💥 Test timed out

@JohnTitor
Copy link
Member

@bors retry

@bors
Copy link
Contributor

bors commented Apr 26, 2023

⌛ Testing commit 04fae4b with merge 4c27d5d...

@bors
Copy link
Contributor

bors commented Apr 26, 2023

☀️ Test successful - checks-actions, checks-cirrus-freebsd-12, checks-cirrus-freebsd-13, checks-cirrus-freebsd-14
Approved by: JohnTitor
Pushing 4c27d5d to master...

@bors bors merged commit 4c27d5d into rust-lang:master Apr 26, 2023
11 checks passed
@bors bors mentioned this pull request Apr 26, 2023
bors added a commit that referenced this pull request May 1, 2023
Added getentropy to vita target

This is a late addition to #3209. This definition is required in order to implement random in std correctly.

As the previous PR, getentropy is a standard C function, should be implemented by newlib provider, and is not Sony's intellectual property.
JohnTitor added a commit to JohnTitor/rust that referenced this pull request May 8, 2023
STD support for PSVita

This PR adds std support for `armv7-sony-vita-newlibeabihf` target.

The work here is fairly similar to rust-lang#95897, just for a different target platform.

This depends on the following pull requests:

rust-lang/backtrace-rs#523
rust-lang/libc#3209
bors added a commit that referenced this pull request May 26, 2023
Fixed vita libc definitions

This fixes definitions that were incorrect in my initial PR (#3209). As with the previous one, this relies on open-source newlib implementation and doesn't use Sony internal API's or expose Sony internal data structures.

This fixes:
- fs API that uses `dirent` and stat
- sockets
- pthreads

A couple of explanations
- Unfortunately `dirent` in vita newlib is not very POSIX'y, before `d_name` it has a field with an internal data structure, which is of no use for std (no inodes, no file type inside), so I've just stubbed it as an `__offset`. Also, Vita doesn't expose inodes - `dirent` doesn't have it at all, and in `stat` it is always `0`. I am not sure what would be the best approach here. Maybe I should move the POSIX `dirent` to `generic.rs` and reexpose it in all targets, and redefine it in `vita/mod.rs`?
- All pthread types on Vita are pointers, and the backing data structure is allocated by corresponding init functions, so their sizeof's are all 4. I also changed `pthread_attr_t` and `pthread_rwlockattr_t` to reflect their sizes and not be constant. May be in relation to rust-lang/rust#95496 it would be better to move existing thread definitions to generic, and for vita specifically make them pointer types instead of byte arrays.

The fixes in std will be in rust-lang/rust#111819
bors added a commit that referenced this pull request Jul 10, 2023
Add missing PS Vita definitions, fix some unused ones

This PR improves vita's newlib support for std by adding some missing definitions and fixing some duplicated ones (e.g. `EAI_NONAME` from `src/unix/newlib/vita/mod.rs` was not being used as it was already defined on `src/unix/newlib/mod.rs`)

Previous work: #3209 #3255

cc `@nikarh`
thomcc pushed a commit to tcdi/postgrestd that referenced this pull request Jul 18, 2023
STD support for PSVita

This PR adds std support for `armv7-sony-vita-newlibeabihf` target.

The work here is fairly similar to #95897, just for a different target platform.

This depends on the following pull requests:

rust-lang/backtrace-rs#523
rust-lang/libc#3209
bors added a commit that referenced this pull request Sep 23, 2023
Add missing PS Vita definitions, fix some unused ones

This PR improves vita's newlib support for std by adding some missing definitions and fixing some duplicated ones (e.g. `EAI_NONAME` from `src/unix/newlib/vita/mod.rs` was not being used as it was already defined on `src/unix/newlib/mod.rs`)

Previous work: #3209 #3255

cc `@nikarh`
bors added a commit that referenced this pull request Sep 24, 2023
Add missing PS Vita definitions, fix some unused ones

This PR improves vita's newlib support for std by adding some missing definitions and fixing some duplicated ones (e.g. `EAI_NONAME` from `src/unix/newlib/vita/mod.rs` was not being used as it was already defined on `src/unix/newlib/mod.rs`)

Previous work: #3209 #3255

cc `@nikarh`
bors added a commit that referenced this pull request Sep 24, 2023
Add missing PS Vita definitions, fix some unused ones

This PR improves vita's newlib support for std by adding some missing definitions and fixing some duplicated ones (e.g. `EAI_NONAME` from `src/unix/newlib/vita/mod.rs` was not being used as it was already defined on `src/unix/newlib/mod.rs`)

Previous work: #3209 #3255

cc `@nikarh`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants