From 7817c5e85cb6f9f6d5b98f6702fa4b7d1fb99e02 Mon Sep 17 00:00:00 2001 From: "Hsiang-Chia.Huang" Date: Wed, 22 May 2019 00:37:14 -0700 Subject: Setup default options for dhrystone release. --- scripts/standalone.mk | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'scripts') diff --git a/scripts/standalone.mk b/scripts/standalone.mk index 913b24b..6b83a29 100644 --- a/scripts/standalone.mk +++ b/scripts/standalone.mk @@ -37,6 +37,12 @@ ifeq ($(RISCV_CMODEL),) RISCV_CMODEL = medany endif +ifeq ($(PROGRAM),dhrystone) +ifeq ($(LINK_TARGET),) +LINK_TARGET = ramrodata +endif +endif + ifeq ($(LINK_TARGET),) LINK_TARGET = default endif @@ -101,6 +107,20 @@ RISCV_CCASFLAGS += --specs=nano.specs RISCV_CFLAGS += --specs=nano.specs RISCV_CXXFLAGS += --specs=nano.specs +ifeq ($(PROGRAM),dhrystone) +ifeq ($(DHRY_OPTION),) +# Ground rules (default) +RISCV_XCFLAGS += -mexplicit-relocs -fno-inline +else ifeq ($(DHRY_OPTION),fast) +# With inline and without lto +RISCV_XCFLAGS += -mexplicit-relocs -finline +else ifeq ($(DHRY_OPTION),best) +# Best Score +RISCV_XCFLAGS += -finline -flto -fwhole-program +endif +RISCV_XCFLAGS += -DDHRY_ITERS=$(TARGET_DHRY_ITERS) +endif + # Turn on garbage collection for unused sections RISCV_LDFLAGS += -Wl,--gc-sections # Turn on linker map file generation @@ -152,6 +172,7 @@ $(PROGRAM_ELF): \ CCASFLAGS="$(RISCV_CCASFLAGS)" \ CFLAGS="$(RISCV_CFLAGS)" \ CXXFLAGS="$(RISCV_CXXFLAGS)" \ + XCFLAGS="$(RISCV_XCFLAGS)" \ LDFLAGS="$(RISCV_LDFLAGS)" \ LDLIBS="$(RISCV_LDLIBS)" mv $(SRC_DIR)/$(basename $(notdir $@)).map $(dir $@) -- cgit v1.2.3