You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If we're ever going to support both riscv32e and riscv32i, it would be helpful to remove the hardcoded rv32e feature flag added in #15 and make this detection automatic instead. See #1 (comment).
I don't think it's possible to do this using plain compiler directives. They're not granular enough to distinguish between the two; both show up as target_arch = riscv32. However auto-detection could be done in a build script based on the target:
build.rs:
use std::env;fnmain(){// Example: Check an environment variable to determine if we're targeting `riscv32e`let target = env::var("TARGET").unwrap_or_default();if target.contains("riscv32e"){println!("cargo:rustc-cfg=feature=\"riscv32e\"");}}
inline:
#![cfg_attr(feature = "riscv32e", allow(dead_code))]#[cfg(feature = "riscv32e")]fnriscv32e_specific_function(){// Implementation for riscv32e}
The text was updated successfully, but these errors were encountered:
If we're ever going to support both riscv32e and riscv32i, it would be helpful to remove the hardcoded
rv32e
feature flag added in #15 and make this detection automatic instead. See #1 (comment).I don't think it's possible to do this using plain compiler directives. They're not granular enough to distinguish between the two; both show up as
target_arch = riscv32
. However auto-detection could be done in a build script based on the target:build.rs:
inline:
The text was updated successfully, but these errors were encountered: