Skip to content

Commit

Permalink
Merge pull request #980 from mkroening/riscv64-rustup
Browse files Browse the repository at this point in the history
fix(xtask): misc
  • Loading branch information
mkroening authored Nov 16, 2023
2 parents 630855d + 3d50316 commit 728f1a1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/publish_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Rustup (apply rust-toolchain.toml)
run: rustup show
- uses: mkroening/rust-toolchain-toml@main
- run: rustup target add x86_64-unknown-none
- name: Generate documentation
run: cargo doc --target x86_64-unknown-none --package hermit-kernel
- name: Generate index.html
Expand Down
16 changes: 7 additions & 9 deletions xtask/src/arch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,11 @@ pub enum Arch {

impl Arch {
pub fn install(&self) -> Result<()> {
eprintln!("Installing target");
let sh = crate::sh()?;
match self {
Self::X86_64 => {
let triple = self.triple();
cmd!(sh, "rustup target add {triple}").run()?;
}
Self::Aarch64 => {}
Self::Riscv64 => {}
if self == &Self::X86_64 {
eprintln!("Installing target");
let triple = self.triple();
cmd!(sh, "rustup target add {triple}").run()?;
}
Ok(())
}
Expand Down Expand Up @@ -78,13 +74,15 @@ impl Arch {
Self::X86_64 => &["--target=x86_64-unknown-none"],
Self::Aarch64 => &[
"--target=aarch64-unknown-none-softfloat",
// We can't use prebuilt std for aarch64 because it is built with
// We can't use prebuilt std here because it is built with
// relocation-model=static and we need relocation-model=pic
"-Zbuild-std=core,alloc",
"-Zbuild-std-features=compiler-builtins-mem",
],
Self::Riscv64 => &[
"--target=riscv64gc-unknown-none-elf",
// We can't use prebuilt std here because it is built with
// relocation-model=static and we need relocation-model=pic
"-Zbuild-std=core,alloc",
"-Zbuild-std-features=compiler-builtins-mem",
],
Expand Down

0 comments on commit 728f1a1

Please sign in to comment.