|
|
|
|
|
by thu
2001 days ago
|
|
What a coincidence, I was trying to compile it yesterday but for instance, the `fp` register is not recognized. I can rename it to `s0` (a synonym) but I'm wondering what should I do to avoid this error: jonesforth.S:540: Error: illegal operands `addi fp,fp,-8'
Any idea?For those interested, I'm using the nixpkgs cross-toolchain. Some documentation is here[0]. Here is a possible `shell.nix` file content: { pkgs ? import <nixpkgs> {} }:
let
riscv64-pkgs = import <nixpkgs> {
crossSystem = (import <nixpkgs/lib>).systems.examples.riscv64;
};
in
{
riscv64 = riscv64-pkgs.mkShell {
buildInputs = [
];
nativeBuildInputs = [
riscv64-pkgs.buildPackages.gdb
];
};
}
This works well enough to compile my hello-world example (available here[1]) but I'd like to use that `fp` register naming...[0]: https://nixos.wiki/wiki/Cross_Compiling [1]: https://github.com/noteed/riscv-hello-asm |
|