diff options
author | Claire Xen <claire@clairexen.net> | 2021-12-06 16:10:29 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-06 16:10:29 +0100 |
commit | 1d9f5b7678c008fd4ab71d9c742a70ff2365f186 (patch) | |
tree | 790399a5de1d58ef79e314a2e641bbd21d2e121a | |
parent | 6b1397700f0555d5764b936cea1adc01be017108 (diff) | |
parent | 2cce6f4e8bb341b002352107215d8e93abda1988 (diff) | |
download | picorv32-1d9f5b7678c008fd4ab71d9c742a70ff2365f186.tar.gz picorv32-1d9f5b7678c008fd4ab71d9c742a70ff2365f186.zip |
Merge pull request #166 from tommythorn/master
Enable the use of 64-bit riscv tools
-rw-r--r-- | Makefile | 10 | ||||
-rw-r--r-- | README.md | 3 | ||||
-rw-r--r-- | picosoc/Makefile | 4 |
3 files changed, 10 insertions, 7 deletions
@@ -107,19 +107,19 @@ firmware/firmware.bin: firmware/firmware.elf chmod -x $@ firmware/firmware.elf: $(FIRMWARE_OBJS) $(TEST_OBJS) firmware/sections.lds - $(TOOLCHAIN_PREFIX)gcc -Os -ffreestanding -nostdlib -o $@ \ - -Wl,-Bstatic,-T,firmware/sections.lds,-Map,firmware/firmware.map,--strip-debug \ + $(TOOLCHAIN_PREFIX)gcc -Os -mabi=ilp32 -march=rv32im$(subst C,c,$(COMPRESSED_ISA)) -ffreestanding -nostdlib -o $@ \ + -Wl,--build-id=none,-Bstatic,-T,firmware/sections.lds,-Map,firmware/firmware.map,--strip-debug \ $(FIRMWARE_OBJS) $(TEST_OBJS) -lgcc chmod -x $@ firmware/start.o: firmware/start.S - $(TOOLCHAIN_PREFIX)gcc -c -march=rv32im$(subst C,c,$(COMPRESSED_ISA)) -o $@ $< + $(TOOLCHAIN_PREFIX)gcc -c -mabi=ilp32 -march=rv32im$(subst C,c,$(COMPRESSED_ISA)) -o $@ $< firmware/%.o: firmware/%.c - $(TOOLCHAIN_PREFIX)gcc -c -march=rv32i$(subst C,c,$(COMPRESSED_ISA)) -Os --std=c99 $(GCC_WARNS) -ffreestanding -nostdlib -o $@ $< + $(TOOLCHAIN_PREFIX)gcc -c -mabi=ilp32 -march=rv32i$(subst C,c,$(COMPRESSED_ISA)) -Os --std=c99 $(GCC_WARNS) -ffreestanding -nostdlib -o $@ $< tests/%.o: tests/%.S tests/riscv_test.h tests/test_macros.h - $(TOOLCHAIN_PREFIX)gcc -c -march=rv32im -o $@ -DTEST_FUNC_NAME=$(notdir $(basename $<)) \ + $(TOOLCHAIN_PREFIX)gcc -c -mabi=ilp32 -march=rv32im -o $@ -DTEST_FUNC_NAME=$(notdir $(basename $<)) \ -DTEST_FUNC_TXT='"$(notdir $(basename $<))"' -DTEST_FUNC_RET=$(notdir $(basename $<))_ret $< download-tools: @@ -9,6 +9,9 @@ contains a built-in interrupt controller. Tools (gcc, binutils, etc..) can be obtained via the [RISC-V Website](https://riscv.org/software-status/). The examples bundled with PicoRV32 expect various RV32 toolchains to be installed in `/opt/riscv32i[m][c]`. See the [build instructions below](#building-a-pure-rv32i-toolchain) for details. +Many Linux distributions now include the tools for RISC-V (for example +Ubuntu 20.04 has `gcc-riscv64-unknown-elf`). To compile using those set +`TOOLCHAIN_PREFIX` accordingly (eg. `make TOOLCHAIN_PREFIX=riscv64-unknown-elf-`). PicoRV32 is free and open hardware licensed under the [ISC license](http://en.wikipedia.org/wiki/ISC_license) (a license that is similar in terms to the MIT license or the 2-clause BSD license). diff --git a/picosoc/Makefile b/picosoc/Makefile index 2f40df4..9c80745 100644 --- a/picosoc/Makefile +++ b/picosoc/Makefile @@ -40,7 +40,7 @@ hx8kdemo_sections.lds: sections.lds $(CROSS)cpp -P -DHX8KDEMO -o $@ $^ hx8kdemo_fw.elf: hx8kdemo_sections.lds start.s firmware.c - $(CROSS)gcc $(CFLAGS) -DHX8KDEMO -march=rv32imc -Wl,-Bstatic,-T,hx8kdemo_sections.lds,--strip-debug -ffreestanding -nostdlib -o hx8kdemo_fw.elf start.s firmware.c + $(CROSS)gcc $(CFLAGS) -DHX8KDEMO -mabi=ilp32 -march=rv32imc -Wl,--build-id=none,-Bstatic,-T,hx8kdemo_sections.lds,--strip-debug -ffreestanding -nostdlib -o hx8kdemo_fw.elf start.s firmware.c hx8kdemo_fw.hex: hx8kdemo_fw.elf $(CROSS)objcopy -O verilog hx8kdemo_fw.elf hx8kdemo_fw.hex @@ -86,7 +86,7 @@ icebreaker_sections.lds: sections.lds $(CROSS)cpp -P -DICEBREAKER -o $@ $^ icebreaker_fw.elf: icebreaker_sections.lds start.s firmware.c - $(CROSS)gcc $(CFLAGS) -DICEBREAKER -march=rv32ic -Wl,-Bstatic,-T,icebreaker_sections.lds,--strip-debug -ffreestanding -nostdlib -o icebreaker_fw.elf start.s firmware.c + $(CROSS)gcc $(CFLAGS) -DICEBREAKER -mabi=ilp32 -march=rv32ic -Wl,-Bstatic,-T,icebreaker_sections.lds,--strip-debug -ffreestanding -nostdlib -o icebreaker_fw.elf start.s firmware.c icebreaker_fw.hex: icebreaker_fw.elf $(CROSS)objcopy -O verilog icebreaker_fw.elf icebreaker_fw.hex |