From ad8f8fb636925666d2fb9a2216da868b82ba0e5b Mon Sep 17 00:00:00 2001 From: Zihao Yu Date: Fri, 30 Jun 2023 23:25:08 +0800 Subject: [PATCH] scripts,isa: merge riscv{32,64}.mk into riscv.mk --- scripts/isa/riscv.mk | 5 +++++ scripts/isa/riscv32.mk | 5 ----- scripts/isa/riscv64.mk | 5 ----- scripts/riscv32-nemu.mk | 4 +++- scripts/riscv64-nemu.mk | 2 +- scripts/riscv64-npc.mk | 2 +- scripts/spike.mk | 2 +- 7 files changed, 11 insertions(+), 14 deletions(-) create mode 100644 scripts/isa/riscv.mk delete mode 100644 scripts/isa/riscv32.mk delete mode 100644 scripts/isa/riscv64.mk diff --git a/scripts/isa/riscv.mk b/scripts/isa/riscv.mk new file mode 100644 index 0000000..adcc44f --- /dev/null +++ b/scripts/isa/riscv.mk @@ -0,0 +1,5 @@ +CROSS_COMPILE := riscv64-linux-gnu- +COMMON_CFLAGS := -fno-pic -march=rv64g -mcmodel=medany -mstrict-align +CFLAGS += $(COMMON_CFLAGS) -static +ASFLAGS += $(COMMON_CFLAGS) -O0 +LDFLAGS += -melf64lriscv diff --git a/scripts/isa/riscv32.mk b/scripts/isa/riscv32.mk deleted file mode 100644 index 65caffd..0000000 --- a/scripts/isa/riscv32.mk +++ /dev/null @@ -1,5 +0,0 @@ -CROSS_COMPILE := riscv64-linux-gnu- -COMMON_FLAGS := -fno-pic -march=rv32g -mabi=ilp32 -CFLAGS += $(COMMON_FLAGS) -static -ASFLAGS += $(COMMON_FLAGS) -O0 -LDFLAGS += -melf32lriscv diff --git a/scripts/isa/riscv64.mk b/scripts/isa/riscv64.mk deleted file mode 100644 index 67db3f2..0000000 --- a/scripts/isa/riscv64.mk +++ /dev/null @@ -1,5 +0,0 @@ -CROSS_COMPILE := riscv64-linux-gnu- -COMMON_FLAGS := -fno-pic -march=rv64g -mcmodel=medany -mstrict-align -CFLAGS += $(COMMON_FLAGS) -static -ASFLAGS += $(COMMON_FLAGS) -O0 -LDFLAGS += -melf64lriscv diff --git a/scripts/riscv32-nemu.mk b/scripts/riscv32-nemu.mk index fd0304f..a1bb6dc 100644 --- a/scripts/riscv32-nemu.mk +++ b/scripts/riscv32-nemu.mk @@ -1,6 +1,8 @@ -include $(AM_HOME)/scripts/isa/riscv32.mk +include $(AM_HOME)/scripts/isa/riscv.mk include $(AM_HOME)/scripts/platform/nemu.mk CFLAGS += -DISA_H=\"riscv/riscv.h\" +COMMON_CFLAGS += -march=rv32im_zicsr -mabi=ilp32e # overwrite +LDFLAGS += -melf32lriscv # overwrite AM_SRCS += riscv/nemu/start.S \ riscv/nemu/cte.c \ diff --git a/scripts/riscv64-nemu.mk b/scripts/riscv64-nemu.mk index 56c140b..e9959a5 100644 --- a/scripts/riscv64-nemu.mk +++ b/scripts/riscv64-nemu.mk @@ -1,4 +1,4 @@ -include $(AM_HOME)/scripts/isa/riscv64.mk +include $(AM_HOME)/scripts/isa/riscv.mk include $(AM_HOME)/scripts/platform/nemu.mk CFLAGS += -DISA_H=\"riscv/riscv.h\" diff --git a/scripts/riscv64-npc.mk b/scripts/riscv64-npc.mk index 3017874..7f186f3 100644 --- a/scripts/riscv64-npc.mk +++ b/scripts/riscv64-npc.mk @@ -1,4 +1,4 @@ -include $(AM_HOME)/scripts/isa/riscv64.mk +include $(AM_HOME)/scripts/isa/riscv.mk AM_SRCS := riscv/npc/start.S \ riscv/npc/trm.c \ diff --git a/scripts/spike.mk b/scripts/spike.mk index caca731..4ea391c 100644 --- a/scripts/spike.mk +++ b/scripts/spike.mk @@ -1,4 +1,4 @@ -include $(AM_HOME)/scripts/isa/riscv64.mk +include $(AM_HOME)/scripts/isa/riscv.mk AM_SRCS := riscv/spike/trm.c \ riscv/spike/ioe.c \