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

Cargo: More improvements for a no_std library build #17

Merged
merged 6 commits into from
Nov 9, 2023

Conversation

alistair23
Copy link
Collaborator

These are some of the last steps to allow a basic no_std build

libc::size_t is just an alias of usize [1], but doesn't work well on
no_std platforms, so just use usize directly instead.

1: https://docs.rs/libc/latest/libc/type.size_t.html

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
In order to avoid errors like this when cross compiling:

    error: unknown target triple 'riscv32imc-unknown-none-elf', please use -triple or -arch

we pass the host target to clang instead of the target.

See rust-lang/rust-bindgen#1728 for the
upstream issue.

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Copy link
Collaborator

@twilfredo twilfredo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@alistair23 alistair23 merged commit a0aadc3 into master Nov 9, 2023
@alistair23 alistair23 deleted the alistair/no_std branch November 9, 2023 23:53
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

Successfully merging this pull request may close these issues.

2 participants