rv_tests/hello_world: Rename PREFIX var to CROSS_PREFIX and make it configurable

And set it in devShell
This commit is contained in:
Artturin 2025-03-14 01:09:02 +02:00
parent ac8a2ea238
commit 0960ceb53a
2 changed files with 8 additions and 5 deletions

View file

@ -62,6 +62,9 @@
riscv64-linux.binutils
riscv64-linux.glibc
];
shellHook = ''
export CROSS_PREFIX="riscv64-none-elf"
'';
};
}
) { };

View file

@ -1,9 +1,9 @@
# RISC-V toolchain
PREFIX = riscv64-unknown-elf
CC = $(PREFIX)-gcc
AS = $(PREFIX)-as
LD = $(PREFIX)-ld
OBJCOPY = $(PREFIX)-objcopy
CROSS_PREFIX ?= riscv64-unknown-elf
CC = $(CROSS_PREFIX)-gcc
AS = $(CROSS_PREFIX)-as
LD = $(CROSS_PREFIX)-ld
OBJCOPY = $(CROSS_PREFIX)-objcopy
QEMU = qemu-system-riscv64
# Compilation flags