[rtems commit] bsp/riscv_generic: Use standard optimization flags

Sebastian Huber sebh at rtems.org
Fri Jun 29 09:54:39 UTC 2018


Module:    rtems
Branch:    master
Commit:    41e22955caf028cf50ffd9fd22814aed3d0c624e
Changeset: http://git.rtems.org/rtems/commit/?id=41e22955caf028cf50ffd9fd22814aed3d0c624e

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Fri Jun 22 07:04:12 2018 +0200

bsp/riscv_generic: Use standard optimization flags

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 44a7416..a394590 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 c321aef..369f2c4 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 c4171ba..46dfdad 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 644cadb..e19e431 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 2e24a2c..bd4a0ca 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 e79bf27..e5df599 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 b167667..09caf7a 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




More information about the vc mailing list