summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathaniel Graff <nathaniel.graff@sifive.com>2019-06-18 21:24:43 +0000
committerGitHub <noreply@github.com>2019-06-18 21:24:43 +0000
commit00a58b4a52a6a3678c1359d76a8647fd5f528b9b (patch)
tree30cc14ed83083f9dd62a8e5b33d158dabb74d7c9
parentb6d3042a135969177e80255216f49197c02754d8 (diff)
parent296af1ce268c943f6a2b884409efcb1d2571867d (diff)
Merge pull request #285 from sifive/benchmark-debug-flags
Reorder CFLAGS for benchmarks
-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
#############################################################