summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorNathaniel Graff <nathaniel.graff@sifive.com>2019-06-17 14:44:39 -0700
committerNathaniel Graff <nathaniel.graff@sifive.com>2019-06-17 14:44:41 -0700
commit296af1ce268c943f6a2b884409efcb1d2571867d (patch)
tree30cc14ed83083f9dd62a8e5b33d158dabb74d7c9 /scripts
parentb6d3042a135969177e80255216f49197c02754d8 (diff)
Reorder CFLAGS for benchmarks
Add benchmark flags after loading the flags for the configuration so that the benchmarks can override the configuration's flags. Signed-off-by: Nathaniel Graff <nathaniel.graff@sifive.com>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/standalone.mk42
1 files changed, 21 insertions, 21 deletions
diff --git a/scripts/standalone.mk b/scripts/standalone.mk
index d0740cd..a29bce4 100644
--- a/scripts/standalone.mk
+++ b/scripts/standalone.mk
@@ -50,12 +50,10 @@ endif
endif
ifeq ($(PROGRAM),coremark)
-ifeq ($(CONFIGURATION),release)
ifeq ($(LINK_TARGET),)
LINK_TARGET = ramrodata
endif
endif
-endif
ifeq ($(LINK_TARGET),)
LINK_TARGET = default
@@ -121,6 +119,27 @@ RISCV_CCASFLAGS += --specs=nano.specs
RISCV_CFLAGS += --specs=nano.specs
RISCV_CXXFLAGS += --specs=nano.specs
+# Turn on garbage collection for unused sections
+RISCV_LDFLAGS += -Wl,--gc-sections
+# Turn on linker map file generation
+RISCV_LDFLAGS += -Wl,-Map,$(PROGRAM).map
+# Turn off the C standard library
+RISCV_LDFLAGS += -nostartfiles -nostdlib
+# Find the archive files and linker scripts
+RISCV_LDFLAGS += -L$(sort $(dir $(abspath $(filter %.a,$^)))) -T$(abspath $(filter %.lds,$^))
+
+# Link to the relevant libraries
+RISCV_LDLIBS += -Wl,--start-group -lc -lgcc -lmetal -lmetal-gloss -Wl,--end-group
+
+# Load the configuration Makefile
+CONFIGURATION_FILE = $(wildcard $(CONFIGURATION).mk)
+ifeq ($(words $(CONFIGURATION_FILE)),0)
+$(error Unable to find the Makefile $(CONFIGURATION).mk for CONFIGURATION=$(CONFIGURATION))
+endif
+include $(CONFIGURATION).mk
+
+# Benchmark CFLAGS go after loading the CONFIGURATION so that they can override the optimization level
+
ifeq ($(PROGRAM),dhrystone)
ifeq ($(DHRY_OPTION),)
# Ground rules (default)
@@ -144,25 +163,6 @@ endif
RISCV_XCFLAGS += -DITERATIONS=$(TARGET_CORE_ITERS)
endif
-# Turn on garbage collection for unused sections
-RISCV_LDFLAGS += -Wl,--gc-sections
-# Turn on linker map file generation
-RISCV_LDFLAGS += -Wl,-Map,$(PROGRAM).map
-# Turn off the C standard library
-RISCV_LDFLAGS += -nostartfiles -nostdlib
-# Find the archive files and linker scripts
-RISCV_LDFLAGS += -L$(sort $(dir $(abspath $(filter %.a,$^)))) -T$(abspath $(filter %.lds,$^))
-
-# Link to the relevant libraries
-RISCV_LDLIBS += -Wl,--start-group -lc -lgcc -lmetal -lmetal-gloss -Wl,--end-group
-
-# Load the configuration Makefile
-CONFIGURATION_FILE = $(wildcard $(CONFIGURATION).mk)
-ifeq ($(words $(CONFIGURATION_FILE)),0)
-$(error Unable to find the Makefile $(CONFIGURATION).mk for CONFIGURATION=$(CONFIGURATION))
-endif
-include $(CONFIGURATION).mk
-
#############################################################
# Software
#############################################################