Hi folks,

I'm porting libstd of Rust to NuttX:

1. https://github.com/rust-lang/rust/pull/130595

2. https://github.com/rust-lang/libc/pull/3909


And get it run on QEMU for now, but there still have a problem about ABI 
compatibility, the libstd depends on libc crate which provide the

essential definition for the host libc, for example, struct stat, struct tm, 
etc.


And for now most of OS just dup the struct/macro definition in Rust since they 
have a stable ABI. For NuttX it's not easy since it's highly configurable, that 
means

the layout of many structure can be changed by Kconfig or a new patch, since 
the ABI compatibiliy is not so important at past, especially if compared to 
footprint

and optimization purpose (LTO).


The current approach posted on GitHub: 
https://github.com/apache/nuttx/issues/12960 and 
https://github.com/apache/nuttx/pull/13245


From my personal view, most of structure are from POSIX, so them should not be 
changed frequently.


For the structures that not strictly defined by POSIX, for example, 
pthread_mutex_t, the current approache allow shrink the size of it but will 
fail in static checker if size of it increased more than two pointers.


Is this OK or any suggetions ?


Regards.


#/******本邮件及其附件含有小米公司的保密信息,仅限于发送给上面地址中列出的个人或群组。禁止任何其他人以任何形式使用(包括但不限于全部或部分地泄露、复制、或散发)本邮件中的信息。如果您错收了本邮件,请您立即电话或邮件通知发件人并删除本邮件!
 This e-mail and its attachments contain confidential information from XIAOMI, 
which is intended only for the person or entity whose address is listed above. 
Any use of the information contained herein in any way (including, but not 
limited to, total or partial disclosure, reproduction, or dissemination) by 
persons other than the intended recipient(s) is prohibited. If you receive this 
e-mail in error, please notify the sender by phone or email immediately and 
delete it!******/#

Reply via email to