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

Scope of future function implementations #18

Open
gmmyung opened this issue Jan 22, 2024 · 3 comments
Open

Scope of future function implementations #18

gmmyung opened this issue Jan 22, 2024 · 3 comments

Comments

@gmmyung
Copy link
Contributor

gmmyung commented Jan 22, 2024

Hi, I am working on binding against a C library compiled with Newlib headers. This requires implementations of some functions that:

  • requires extern crate alloc such as malloc and free
  • are not part of libc, but part of the Newlib header such as __errno(), __assert_func()
  • are just stubs for non-existent functions such as fopen, printf
  • part of math.h (implementation of those are easy, just re-export the libm functions)

What is the scope of future function implementation in tinyrlibc?

@thejpster
Copy link
Member

It's not impossible, but you may find it easier to just link newlib.

@gmmyung
Copy link
Contributor Author

gmmyung commented Jan 23, 2024

Linking with Newlib does work, but offering a Rust version would significantly simplify the process for users. Currently, there's no official release of the GNU RISC-V toolchain, requiring users to either build the entire toolchain (which demands 8 GiB of disk space) or use various third-party prebuilt sources with different configurations. Following that, building Newlib from source with the compiler is necessary. Using Clang and tinyrlibc seems like a more straightforward option for crate user experience.

@thejpster
Copy link
Member

As long as it still does its original job (linking with the nrf9160 libraries) and it doesn't hit the new cargo feature limit, this seems fine to me.

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

No branches or pull requests

2 participants