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

Add riscv64gc-unknown-linux-musl support #40

Open
2 tasks done
overheat opened this issue Sep 6, 2023 · 3 comments
Open
2 tasks done

Add riscv64gc-unknown-linux-musl support #40

overheat opened this issue Sep 6, 2023 · 3 comments

Comments

@overheat
Copy link

overheat commented Sep 6, 2023

Checklist

Describe your request

rustup target add riscv64gc-unknown-linux-musl

error: toolchain 'stable-x86_64-unknown-linux-gnu' does not contain component 'rust-std' for target 'riscv64gc-unknown-linux-musl'

How to build 'rust-std' for target 'riscv64gc-unknown-linux-musl'?

Describe why this would be a good inclusion for cross

more Risc-V linux enabled SoC.

@Emilgardis
Copy link
Member

Emilgardis commented Sep 6, 2023

not having std is fine, we can simply use build-std

if you have all the tools to build for this target, adding cargo +nightly build -Z build-std=core,std,panic_abort --target riscv64gc-unknown-linux-musl should work for you.

For us creating an image supporting this should be fairly simple. Since this is a T3 target this should probably be added according to https://github.com/cross-rs/cross/wiki/Contributing#adding-new-targets

@overheat
Copy link
Author

overheat commented Sep 6, 2023

@Emilgardis
Thanks. I will try to create an image supporting.

BTW, cargo +nightly build -Z build-std=core,std,panic_abort --target riscv64gc-unknown-linux-musl not works. the error is:

...
ld: cannot find -lunwind

I suppose it missing libunwind.rlib under ~/.rustup/toolchains/...

Do you know how to build 'rust-std' for target 'riscv64gc-unknown-linux-musl'? Maybe I can menully install it to my ~/.rustup/toolchains/.. folder

@Emilgardis
Copy link
Member

You can build std with https://rustc-dev-guide.rust-lang.org/building/how-to-build-and-run.html#building-targets-for-cross-compilation or simply using -Zbuild-std=std

I'll move this issue to cross-toolchains since it should belong there instead

@Emilgardis Emilgardis transferred this issue from cross-rs/cross Sep 6, 2023
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