summaryrefslogtreecommitdiffstats
path: root/bsps
diff options
context:
space:
mode:
authorDaniel Hellstrom <daniel@gaisler.com>2018-08-31 08:21:05 +0200
committerDaniel Hellstrom <daniel@gaisler.com>2018-10-09 12:36:41 +0200
commitdc32b6aa0807fb70f9b26bc0bc6e164ddb49bd3a (patch)
tree3582cb53f6103618b58291ab3bf7180abc8f9215 /bsps
parentleon, spwtdp: Initial driver commit (diff)
downloadrtems-dc32b6aa0807fb70f9b26bc0bc6e164ddb49bd3a.tar.bz2
leon: do not use -mfix-{device} with Clang
Clang do not support -mfix-gr712rc, -mfix-ut700 and -mfix-ut699. Therefore we adjust the CPU_CFLAGS to remove these when compiling with Clang. Instead use GR712RC: -mcpu=gr712rc GR740: -mcpu=gr740 UT699/UT700: Not currently supported by clang, use LEON3 BSP.
Diffstat (limited to 'bsps')
-rw-r--r--bsps/sparc/leon3/config/gr712rc.cfg7
-rw-r--r--bsps/sparc/leon3/config/gr740.cfg23
2 files changed, 28 insertions, 2 deletions
diff --git a/bsps/sparc/leon3/config/gr712rc.cfg b/bsps/sparc/leon3/config/gr712rc.cfg
index 897dd0142f..385293275c 100644
--- a/bsps/sparc/leon3/config/gr712rc.cfg
+++ b/bsps/sparc/leon3/config/gr712rc.cfg
@@ -8,7 +8,12 @@ RTEMS_CPU=sparc
# This contains the compiler options necessary to select the CPU model
# and (hopefully) optimize for it.
-CPU_CFLAGS = -mcpu=leon3 -mfix-gr712rc
+# GCC and clang use different switches to select target:
+ifneq (,$(findstring clang,$(CC)))
+ CPU_CFLAGS = -mcpu=gr712rc
+else
+ CPU_CFLAGS = -mcpu=leon3 -mfix-gr712rc
+endif
# optimize flag: typically -O2
CFLAGS_OPTIMIZE_V = -O2 -g
diff --git a/bsps/sparc/leon3/config/gr740.cfg b/bsps/sparc/leon3/config/gr740.cfg
index 86da029c42..640a4fdd72 100644
--- a/bsps/sparc/leon3/config/gr740.cfg
+++ b/bsps/sparc/leon3/config/gr740.cfg
@@ -1 +1,22 @@
-include $(RTEMS_ROOT)/make/custom/leon3.cfg
+#
+# Config file for the LEON3 SPARC processor.
+#
+
+include $(RTEMS_ROOT)/make/custom/default.cfg
+
+RTEMS_CPU=sparc
+
+# This contains the compiler options necessary to select the CPU model
+# and (hopefully) optimize for it.
+# GCC and clang use different switches to select target:
+ifneq (,$(findstring clang,$(CC)))
+ CPU_CFLAGS = -mcpu=gr740
+else
+ CPU_CFLAGS = -mcpu=leon3
+endif
+
+# optimize flag: typically -O2
+CFLAGS_OPTIMIZE_V = -O2 -g
+CFLAGS_OPTIMIZE_V += -ffunction-sections -fdata-sections
+
+LDFLAGS = -Wl,--gc-sections