-
Notifications
You must be signed in to change notification settings - Fork 704
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 riscv32 support #1880
Add riscv32 support #1880
Conversation
blue-freedom-technologies
commented
Jan 4, 2024
•
edited
Loading
edited
Hi @briansmith, There are two points here that we need your advise: Thank you for your time. Cheers, |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1880 +/- ##
==========================================
- Coverage 96.03% 96.02% -0.02%
==========================================
Files 136 136
Lines 20761 20776 +15
Branches 226 226
==========================================
+ Hits 19938 19950 +12
- Misses 789 792 +3
Partials 34 34 ☔ View full report in Codecov by Sentry. |
--target=riscv32gc-unknown-linux-gnu) | ||
use_clang=1 | ||
install_packages \ | ||
#https://github.com/riscv-collab/riscv-gnu-toolchain#installation-newliblinux-multilib |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see that this target is quite difficult to support. I read "If you need riscv32-linux, then yes you will need to build it." from riscv-collab/riscv-gnu-toolchain#808.
It seems like my niave and underinformed guess that riscv32gc-unknown-linux-gnu would be the easiest riscv32 target to support was wrong.
Is riscv32gc-unknown-linux-gnu the actual target you are trying to support, or were you just trying to follow my suggestion? If you don't need riscv32gc-unknown-linux-gnu but instead need a different target, I think we should focus on the one that's actually useful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for taking the time for this analysis.
Ok, don't forget you ask for it not me.... don't kill the messenger.
Now the bad news:
our target riscv32imac-esp-espidf is a Tier 3. Meaning target is supported but not built, distributed, or guaranteed to work.
So, for our target to work we need to have the ESP-IDF Toolchain and then have a config.toml similar to this :
[build]
target = "riscv32imac-esp-espidf"
[target.riscv32imac-esp-espidf]
linker = "/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/riscv32-esp-elf/bin/ld"
[unstable]
build-std = ["std", "panic_abort"]
[env]
MCU="esp32c6"
ESP_IDF_VERSION = "v5.1.1"
TARGET_CC = "/tools/riscv32-esp-elf/esp-12.2.0_20230208/riscv32-esp-elf/bin/riscv32-esp-elf-cc"
For the ring crate build.
As example let's run the test case ed25519_tests:
cargo build --test ed25519_tests
Result...
So
On a more happy note I have added the target_os = "espidf". Thank you for your time addressing all of these troubles. Cheers, |