Skip to content

Commit

Permalink
rv: Compile rv32ui examples in rv32i mode, not rv32im
Browse files Browse the repository at this point in the history
  • Loading branch information
cpitclaudel committed Mar 31, 2020
1 parent 48c8cad commit a3a8447
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions examples/rv/tests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ RISCVOBJDUMP32_ARGS := --disassemble --source --full-contents

cc := $(RISCVCC32) $(RISCVCC32_ARGS)
objdump := $(RISCVOBJDUMP32) $(RISCVOBJDUMP32_ARGS)
cc32i := $(cc) -march=rv32im -mabi=ilp32 -T$(build)/rv32i/link.ld
cc32e := $(cc) -march=rv32e -mabi=ilp32e -T$(build)/rv32e/link.ld -DRV32E
iarch = $(if $(findstring riscv_tests/rv32ui,$1),rv32i,rv32im)
cc32i = $(cc) -T$(build)/rv32i/link.ld -mabi=ilp32
cc32e = $(cc) -T$(build)/rv32e/link.ld -DRV32E -mabi=ilp32e -march=rv32e

all: $(rv32_targets) $(vmh_targets) $(dump_targets);

Expand All @@ -49,10 +50,10 @@ $(build)/rv32e/%.rv32: %.c init.S init.S mmio.c $(build)/rv32e/link.ld | dirs
$(cc32e) init.S mmio.c $< -o $@

$(build)/rv32i/%.rv32: %.S $(build)/rv32i/link.ld | dirs
$(cc32i) $< -o $@
$(cc32i) -march=$(call iarch,$<) $< -o $@

$(build)/rv32i/%.rv32: %.c init.S mmio.c $(build)/rv32i/link.ld | dirs
$(cc32i) init.S mmio.c $< -o $@
$(cc32i) -march=$(call iarch,$<) init.S mmio.c $< -o $@

$(build)/%.dump: $(build)/%.rv32
$(objdump) $< > $@
Expand Down

0 comments on commit a3a8447

Please sign in to comment.