From 296b6196f437fa909ea03a9a8ec069f0f63e917c Mon Sep 17 00:00:00 2001 From: WangRunji Date: Sat, 4 Aug 2018 23:02:50 +0800 Subject: [PATCH] rv64 toolchain configure for riscv-pk --- kernel/Makefile | 6 +++--- riscv-pk/configure | 4 ++-- riscv-pk/configure.ac | 4 ++-- riscv-pk/machine/minit.c | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/kernel/Makefile b/kernel/Makefile index 137bda8..aff0125 100644 --- a/kernel/Makefile +++ b/kernel/Makefile @@ -80,7 +80,7 @@ ifeq ($(uname), Darwin) prefix := x86_64-elf- endif ifeq ($(arch), riscv32) -prefix := riscv32-unknown-elf- +prefix := riscv64-unknown-elf- endif ld := $(prefix)ld @@ -128,10 +128,10 @@ build/riscv32/os.iso: $(kernel) mkdir -p build && \ cd build && \ ../configure \ + --enable-32bit \ --enable-logo \ - --prefix=$(RISCV) \ --disable-fp-emulation \ - --host=riscv32-unknown-elf \ + --host=riscv64-unknown-elf \ --with-payload=$(abspath $(kernel)) && \ make && \ cp bbl ../../kernel/$@ diff --git a/riscv-pk/configure b/riscv-pk/configure index c3b9c2a..49dddf3 100755 --- a/riscv-pk/configure +++ b/riscv-pk/configure @@ -4084,8 +4084,8 @@ fi case "${BUILD_32BIT}" in yes|default) echo "Building 32-bit pk" - CFLAGS="$default_CFLAGS -m32" - LDFLAGS="-m32" + CFLAGS="$default_CFLAGS -march=rv32i -mabi=ilp32" + LDFLAGS="-march=rv32i -mabi=ilp32" install_subdir="riscv32-unknown-elf" ;; *) diff --git a/riscv-pk/configure.ac b/riscv-pk/configure.ac index 5c08278..107a3f2 100644 --- a/riscv-pk/configure.ac +++ b/riscv-pk/configure.ac @@ -88,8 +88,8 @@ AC_ARG_ENABLE([32bit], case "${BUILD_32BIT}" in yes|default) echo "Building 32-bit pk" - CFLAGS="$default_CFLAGS -m32" - LDFLAGS="-m32" + CFLAGS="$default_CFLAGS -march=rv32i -mabi=ilp32" + LDFLAGS="-march=rv32i -mabi=ilp32" install_subdir="riscv32-unknown-elf" ;; *) diff --git a/riscv-pk/machine/minit.c b/riscv-pk/machine/minit.c index 7690341..c3fce3d 100644 --- a/riscv-pk/machine/minit.c +++ b/riscv-pk/machine/minit.c @@ -91,7 +91,7 @@ static void memory_init() static void hart_init() { mstatus_init(); - fp_init(); +// fp_init(); delegate_traps(); }