Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Vita support #1

Open
zetanumbers opened this issue Sep 13, 2024 · 6 comments
Open

Vita support #1

zetanumbers opened this issue Sep 13, 2024 · 6 comments

Comments

@zetanumbers
Copy link

zetanumbers commented Sep 13, 2024

I would like to run this code on the armv7-sony-vita-newlibeabihf target. I can see how it can be done, but I would need to know is there any definition from newlib the ESP-IDF version lacks, which I would need to add back for vita?

I want to check and maybe correct the rust-lang/libc#3920

@SergioGasquez
Copy link
Owner

is there any definition from newlib the ESP-IDF version lacks.

Yes, even for ESP-IDF there were some definitions that I only found in libc and not in ESP-IDF. The easy way to know if the definition is on ESP-IDF is searching for it at https://docs.esp-rs.org/esp-idf-svc/esp_idf_svc/sys/index.html.

Regarding running this code on armv7-sony-vita-newlibeabihf, not sure how easy it could be, but maybe @ivmarkov can help there.

@ivmarkov
Copy link
Collaborator

is there any definition from newlib the ESP-IDF version lacks.

Yes, even for ESP-IDF there were some definitions that I only found in libc and not in ESP-IDF. The easy way to know if the definition is on ESP-IDF is searching for it at https://docs.esp-rs.org/esp-idf-svc/esp_idf_svc/sys/index.html.

Regarding running this code on armv7-sony-vita-newlibeabihf, not sure how easy it could be, but maybe @ivmarkov can help there.

What were these definitions? I would've expected esp-idf-sys to be a strict superset of libc, modulo stuff which is not supported by the ESP IDF, like processes and signals.

@ivmarkov
Copy link
Collaborator

Regarding running this code on armv7-sony-vita-newlibeabihf, not sure how easy it could be, but maybe @ivmarkov can help there.

The all-Rust approach we took can be applied on Vita only if you have Rust equivalents to the libc Rust types which are generated using the Rust bindgen utility. We already have these (bindgen generated) Rust types thanks to out ESP IDF "sys" crate. If you have an equivalent "sys" crate for the Vita platform, which generates bi dings for the newlib headers on Vita (and possibly for other C Vita APIs) then it should be no-brainer. Otherwise you have to do the bindgen heavy lifting yourself. Not that it is a rocket science, but that would take some time.

@SergioGasquez
Copy link
Owner

What were these definitions?

Here are some examples that were present in libc but not in esp-idf-sys. I can gather the full list if required

// newlib/espidf module
sockaddr_un
AF_UNIX
FIONBIO
// newlib module
rlim_t
lconv
statvfs
...
O_ACCMODE
...
SOL_TCP
CLOCK_REALTIME
CLOCK_MONOTONIC
CLOCK_BOOTTIME
SO_BINTIME
SO_NO_OFFLOAD
....
IFF_UP
IFF_BROADCAST
....
TCP_MAXSEG
....

@ivmarkov
Copy link
Collaborator

Yes if you can get the full list, so that we can audit.
Some/most items from the partial list are OK to be missing (i.e. no Unix Domain sockets on ESP IDF) some seem weird (IFF_UP / IFF_BROADCAST).

@SergioGasquez
Copy link
Owner

I think this is the full list, hopefully I didn't miss anything:

// newlib/espidf module
sockaddr_un
AF_UNIX
FIONBIO
// newlib module
rlim_t
lconv
statvfs
passwd
sem_t
Dl_info
utsname
cpu_set_t
pthread_rwlockattr_t
O_ACCMODE
RTLD_LAZY
FIOCLEX
FIONCLEX
SOL_TCP
CLOCK_REALTIME
CLOCK_MONOTONIC
CLOCK_BOOTTIME
SO_BINTIME
SO_NO_OFFLOAD
SO_NO_DDP
SO_REUSEPORT_LB
SO_LABEL
SO_PEERLABEL
SO_LISTENQLIMIT
SO_LISTENQLEN
SO_LISTENINCQLEN
SO_SETFIB
SO_USER_COOKIE
SO_PROTOCOL
SO_PROTOTYPE
SO_VENDOR
SO_TIMESTAMP
SO_NOSIGPIPE
SO_ACCEPTFILTER
IFF_UP
IFF_BROADCAST
IFF_DEBUG
IFF_LOOPBACK
IFF_POINTOPOINT
IFF_NOTRAILERS
IFF_RUNNING
IFF_NOARP
IFF_PROMISC
IFF_ALLMULTI
IFF_OACTIVE
IFF_SIMPLEX
IFF_LINK0
IFF_LINK1
IFF_LINK2
IFF_ALTPHYS
IFF_MULTICAST
TCP_MAXSEG
TCP_NOPUSH
TCP_NOOPT
NI_NOFQDN
NI_NUMERICHOST
NI_NAMEREQD
PRIO_PROCESS
PRIO_PGRP
PRIO_USER

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants