diff --git a/CHANGELOG.md b/CHANGELOG.md index ad0949741..c1a764d1b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Fixed - Measure the `wfi` stalls and stalls caused by `opc` properly - Fix the allocator initialization +- After building GCC, copy `riscv.ld` required for cMake to install folder +- Disable GCC tree-loop-distribute-patterns optimizations causing stack overflows +- Disable problematic GCC `memset` and `memcpy` built-in functions ### Changed - Increase the default AXI width to 512 for MemPool and TeraPool diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index e9d157650..35d800382 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -11,5 +11,6 @@ Thanks to all. * Luca Rufer * Marc Gantenbein * Marco Bertuletti +* Philip Wiese * Sergio Mazzola * Yichao Zhang diff --git a/Makefile b/Makefile index 28f730921..7ebb1cca8 100644 --- a/Makefile +++ b/Makefile @@ -78,7 +78,8 @@ tc-riscv-gcc: mkdir -p $(GCC_INSTALL_DIR) cd $(CURDIR)/toolchain/riscv-gnu-toolchain && rm -rf build && mkdir -p build && cd build && \ ../configure --prefix=$(GCC_INSTALL_DIR) --with-arch=rv32im --with-cmodel=medlow --enable-multilib && \ - $(MAKE) MAKEINFO=true -j4 + $(MAKE) MAKEINFO=true -j4 && \ + cp ../riscv.ld $(GCC_INSTALL_DIR)/riscv32-unknown-elf/lib tc-llvm: mkdir -p $(LLVM_INSTALL_DIR) diff --git a/software/runtime/runtime.mk b/software/runtime/runtime.mk index 74fe9401c..b6e89cd48 100644 --- a/software/runtime/runtime.mk +++ b/software/runtime/runtime.mk @@ -85,8 +85,8 @@ RISCV_LLVM_TARGET ?= --target=$(RISCV_TARGET) --sysroot=$(GCC_INSTALL_DIR)/$(RI RISCV_WARNINGS += -Wunused-variable -Wconversion -Wall -Wextra # -Werror RISCV_FLAGS_COMMON_TESTS ?= -march=$(RISCV_ARCH) -mabi=$(RISCV_ABI) -I$(ROOT_DIR) -I$(HALIDE_INCLUDE) -static -RISCV_FLAGS_COMMON ?= $(RISCV_FLAGS_COMMON_TESTS) -g -std=gnu99 -O3 -ffast-math -fno-common -fno-builtin-printf $(DEFINES) $(RISCV_WARNINGS) -RISCV_FLAGS_GCC ?= -mcmodel=medany -Wa,-march=$(RISCV_ARCH_AS) -mtune=mempool # -falign-loops=32 -falign-jumps=32 +RISCV_FLAGS_COMMON ?= $(RISCV_FLAGS_COMMON_TESTS) -g -std=gnu99 -O3 -fno-builtin-memcpy -fno-builtin-memset -ffast-math -fno-common -fno-builtin-printf $(DEFINES) $(RISCV_WARNINGS) +RISCV_FLAGS_GCC ?= -mcmodel=medany -Wa,-march=$(RISCV_ARCH_AS) -mtune=mempool -fno-tree-loop-distribute-patterns # -falign-loops=32 -falign-jumps=32 RISCV_FLAGS_LLVM ?= -mcmodel=small -mcpu=mempool-rv32 -mllvm -misched-topdown ifeq ($(COMPILER),gcc)