[PATCH 03/17] bsp/riscv_generic: Use standard optimization flags
Sebastian Huber
sebastian.huber at embedded-brains.de
Fri Jun 22 11:59:00 UTC 2018
Update #3433.
---
bsps/riscv/riscv_generic/config/rv32i.cfg | 4 +++-
bsps/riscv/riscv_generic/config/rv32iac.cfg | 4 +++-
bsps/riscv/riscv_generic/config/rv32im.cfg | 4 +++-
bsps/riscv/riscv_generic/config/rv32imac.cfg | 4 +++-
bsps/riscv/riscv_generic/config/rv32imafc.cfg | 4 +++-
bsps/riscv/riscv_generic/config/rv64imac.cfg | 4 +++-
bsps/riscv/riscv_generic/config/rv64imafdc.cfg | 4 +++-
7 files changed, 21 insertions(+), 7 deletions(-)
diff --git a/bsps/riscv/riscv_generic/config/rv32i.cfg b/bsps/riscv/riscv_generic/config/rv32i.cfg
index 44a74166e7..a394590dc2 100644
--- a/bsps/riscv/riscv_generic/config/rv32i.cfg
+++ b/bsps/riscv/riscv_generic/config/rv32i.cfg
@@ -4,4 +4,6 @@ RTEMS_CPU = riscv
CPU_CFLAGS = -march=rv32i -mabi=ilp32
-CFLAGS_OPTIMIZE_V ?= -Os
+LDFLAGS = -Wl,--gc-sections
+
+CFLAGS_OPTIMIZE_V ?= -O2 -g -ffunction-sections -fdata-sections
diff --git a/bsps/riscv/riscv_generic/config/rv32iac.cfg b/bsps/riscv/riscv_generic/config/rv32iac.cfg
index c321aef017..369f2c441d 100644
--- a/bsps/riscv/riscv_generic/config/rv32iac.cfg
+++ b/bsps/riscv/riscv_generic/config/rv32iac.cfg
@@ -4,4 +4,6 @@ RTEMS_CPU = riscv
CPU_CFLAGS = -march=rv32iac -mabi=ilp32
-CFLAGS_OPTIMIZE_V ?= -Os
+LDFLAGS = -Wl,--gc-sections
+
+CFLAGS_OPTIMIZE_V ?= -O2 -g -ffunction-sections -fdata-sections
diff --git a/bsps/riscv/riscv_generic/config/rv32im.cfg b/bsps/riscv/riscv_generic/config/rv32im.cfg
index c4171ba20d..46dfdad09c 100644
--- a/bsps/riscv/riscv_generic/config/rv32im.cfg
+++ b/bsps/riscv/riscv_generic/config/rv32im.cfg
@@ -4,4 +4,6 @@ RTEMS_CPU = riscv
CPU_CFLAGS = -march=rv32im -mabi=ilp32
-CFLAGS_OPTIMIZE_V ?= -Os
+LDFLAGS = -Wl,--gc-sections
+
+CFLAGS_OPTIMIZE_V ?= -O2 -g -ffunction-sections -fdata-sections
diff --git a/bsps/riscv/riscv_generic/config/rv32imac.cfg b/bsps/riscv/riscv_generic/config/rv32imac.cfg
index 644cadb632..e19e431b53 100644
--- a/bsps/riscv/riscv_generic/config/rv32imac.cfg
+++ b/bsps/riscv/riscv_generic/config/rv32imac.cfg
@@ -4,4 +4,6 @@ RTEMS_CPU = riscv
CPU_CFLAGS = -march=rv32imac -mabi=ilp32
-CFLAGS_OPTIMIZE_V ?= -Os
+LDFLAGS = -Wl,--gc-sections
+
+CFLAGS_OPTIMIZE_V ?= -O2 -g -ffunction-sections -fdata-sections
diff --git a/bsps/riscv/riscv_generic/config/rv32imafc.cfg b/bsps/riscv/riscv_generic/config/rv32imafc.cfg
index 2e24a2cc69..bd4a0cacbe 100644
--- a/bsps/riscv/riscv_generic/config/rv32imafc.cfg
+++ b/bsps/riscv/riscv_generic/config/rv32imafc.cfg
@@ -4,4 +4,6 @@ RTEMS_CPU = riscv
CPU_CFLAGS = -march=rv32imafc -mabi=ilp32f
-CFLAGS_OPTIMIZE_V ?= -Os
+LDFLAGS = -Wl,--gc-sections
+
+CFLAGS_OPTIMIZE_V ?= -O2 -g -ffunction-sections -fdata-sections
diff --git a/bsps/riscv/riscv_generic/config/rv64imac.cfg b/bsps/riscv/riscv_generic/config/rv64imac.cfg
index e79bf2793b..e5df5995ac 100644
--- a/bsps/riscv/riscv_generic/config/rv64imac.cfg
+++ b/bsps/riscv/riscv_generic/config/rv64imac.cfg
@@ -4,4 +4,6 @@ RTEMS_CPU = riscv
CPU_CFLAGS = -march=rv64imac -mabi=lp64
-CFLAGS_OPTIMIZE_V ?= -O0 -g
+LDFLAGS = -Wl,--gc-sections
+
+CFLAGS_OPTIMIZE_V ?= -O2 -g -ffunction-sections -fdata-sections
diff --git a/bsps/riscv/riscv_generic/config/rv64imafdc.cfg b/bsps/riscv/riscv_generic/config/rv64imafdc.cfg
index b1676670e7..09caf7adbf 100644
--- a/bsps/riscv/riscv_generic/config/rv64imafdc.cfg
+++ b/bsps/riscv/riscv_generic/config/rv64imafdc.cfg
@@ -4,4 +4,6 @@ RTEMS_CPU = riscv
CPU_CFLAGS = -march=rv64imafdc -mabi=lp64d
-CFLAGS_OPTIMIZE_V ?= -O0 -g
+LDFLAGS = -Wl,--gc-sections
+
+CFLAGS_OPTIMIZE_V ?= -O2 -g -ffunction-sections -fdata-sections
--
2.13.7
More information about the devel
mailing list