From 367537507299e289d1441b5af53f47aa3297ece1 Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Fri, 7 Apr 2017 11:43:05 +0200 Subject: [PATCH] Update riscv-gnu-toolchain to git rev 0c8f87d --- Makefile | 4 ++-- README.md | 9 +++++---- firmware/riscv.ld | 4 ++-- firmware/riscv_ld.diff | 10 +++++----- 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index 42060bf..01a6fc0 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ -RISCV_GNU_TOOLCHAIN_GIT_REVISION = 914224e +RISCV_GNU_TOOLCHAIN_GIT_REVISION = 0c8f87d RISCV_GNU_TOOLCHAIN_INSTALL_PREFIX = /opt/riscv32 SHELL = bash @@ -11,7 +11,7 @@ TOOLCHAIN_PREFIX = $(RISCV_GNU_TOOLCHAIN_INSTALL_PREFIX)i/bin/riscv32-unknown-el COMPRESSED_ISA = C # Add things like "export http_proxy=... https_proxy=..." here -GIT_ENV = +GIT_ENV = true test: testbench.vvp firmware/firmware.hex vvp -N $< diff --git a/README.md b/README.md index a7ed093..900f02d 100644 --- a/README.md +++ b/README.md @@ -612,15 +612,16 @@ The following commands will build the RISC-V GNU toolchain and libraries for a pure RV32I target, and install it in `/opt/riscv32i`: # Ubuntu packages needed: - sudo apt-get install autoconf automake autotools-dev curl libmpc-dev libmpfr-dev \ - libgmp-dev gawk build-essential bison flex texinfo gperf libtool patchutils bc + sudo apt-get install autoconf automake autotools-dev curl libmpc-dev \ + libmpfr-dev libgmp-dev gawk build-essential bison flex texinfo \ + gperf libtool patchutils bc zlib1g-dev git sudo mkdir /opt/riscv32i sudo chown $USER /opt/riscv32i git clone https://github.com/riscv/riscv-gnu-toolchain riscv-gnu-toolchain-rv32i cd riscv-gnu-toolchain-rv32i - git checkout 914224e + git checkout 0c8f87d git submodule update --init --recursive mkdir build; cd build @@ -649,7 +650,7 @@ By default calling any of those make targets will (re-)download the toolchain sources. Run `make download-tools` to download the sources to `/var/cache/distfiles/` once in advance. -*Note: This instructions are for git rev 914224e (2017-01-06) of riscv-gnu-toolchain.* +*Note: This instructions are for git rev 0c8f87d (2017-04-05) of riscv-gnu-toolchain.* Linking binaries with newlib for PicoRV32 diff --git a/firmware/riscv.ld b/firmware/riscv.ld index 20fd2fb..3e7002d 100644 --- a/firmware/riscv.ld +++ b/firmware/riscv.ld @@ -1,5 +1,5 @@ /* Default linker script, for normal executables */ -/* Copyright (C) 2014-2016 Free Software Foundation, Inc. +/* Copyright (C) 2014-2017 Free Software Foundation, Inc. Copying and distribution of this script, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. */ @@ -125,7 +125,7 @@ SECTIONS we can shorten the on-disk segment size. */ .sdata : { - _gp = . + 0x800; + __global_pointer$ = . + 0x800; *(.srodata.cst16) *(.srodata.cst8) *(.srodata.cst4) *(.srodata.cst2) *(.srodata .srodata.*) *(.sdata .sdata.* .gnu.linkonce.s.*) } diff --git a/firmware/riscv_ld.diff b/firmware/riscv_ld.diff index 104a245..511ecff 100644 --- a/firmware/riscv_ld.diff +++ b/firmware/riscv_ld.diff @@ -1,20 +1,20 @@ ---- <(riscv32-unknown-elf-ld -z nocombreloc -verbose) 2017-01-13 16:55:07.569030165 +0100 -+++ riscv.ld 2017-01-13 16:56:47.796761642 +0100 +--- <(riscv32-unknown-elf-ld -z nocombreloc -verbose) ++++ riscv.ld @@ -1,9 +1,3 @@ --GNU ld (GNU Binutils) 2.28.51.20170101 +-GNU ld (GNU Binutils) 2.28.0.20170322 - Supported emulations: - elf32lriscv - elf64lriscv -using internal linker script: -================================================== /* Default linker script, for normal executables */ - /* Copyright (C) 2014-2016 Free Software Foundation, Inc. + /* Copyright (C) 2014-2017 Free Software Foundation, Inc. Copying and distribution of this script, with or without modification, @@ -13,62 +7,26 @@ "elf32-littleriscv") OUTPUT_ARCH(riscv) ENTRY(_start) --SEARCH_DIR("/opt/new_riscv32i/riscv32-unknown-elf/lib"); +-SEARCH_DIR("/opt/riscv32i/riscv32-unknown-elf/lib"); SECTIONS { - /* Read-only sections, merged into text segment: */