no1wudi commented on PR #13245:
URL: https://github.com/apache/nuttx/pull/13245#issuecomment-2322644369

   
   > libc/libstd definitely needs the participation of nuttx to be compiled, 
similar to the WAMR glue code we did before, which allows rust to be bound to a 
certain configuration to avoid doing these meaningless work. It is a common 
practice for different nuttx header files to generate different lib/libstd.
   
   @anchao You can refer to the libc crate for other supported platforms, for 
example TEEOS:
   
https://github.com/rust-lang/libc/blob/0e6afd534ed7a0406e9dfc9242c2c9370a5b8d05/src/teeos/mod.rs#L106-L109
   and newlib based ROTS:
   
https://github.com/rust-lang/libc/blob/0e6afd534ed7a0406e9dfc9242c2c9370a5b8d05/src/unix/newlib/mod.rs#L240-L272
   
   For NuttX, reuse the unix port is better.
   
   Only a few data structures need to be defined on the Rust side, and they 
should be kept in sync with the native definitions on the NuttX side, which are 
usually related to libc and POSIX/pthread. For function definitions, there 
should be no doubt; follow the standard definitions to proceed.
   
   For other NuttX private interfaces, such as various peripheral drivers and 
tasks, the bindgen method can be used for support. These additional packages 
are not within the scope of libstd and should be provided through additional 
crates.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to