summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorHsiang-Chia.Huang <hsiangchiah@sifive.com>2019-05-22 00:37:14 -0700
committerHsiang-Chia.Huang <hsiangchiah@sifive.com>2019-05-22 19:58:17 -0700
commit7817c5e85cb6f9f6d5b98f6702fa4b7d1fb99e02 (patch)
treedc9652a6765fefad29d18da1a19645de104d8639 /scripts
parent9946f2062837098088e4c9701614a2eeffaa921b (diff)
Setup default options for dhrystone release.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/standalone.mk21
1 files changed, 21 insertions, 0 deletions
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 $@)