Skip to content

Commit 8d7d29e

Browse files
tbr-ttgalak
authored andcommitted
gcc: update multilibs for SPARC
Build libraries for the LEON CPU targets. A summary of the differences between -mcpu options are given below. Note that -mcpu=leon is equivalent to -mcpu=v8 except for instruction timing. Option mul/div casa -mcpu=v7 (or no -mcpu=) NO NO -mcpu=leon YES NO -mcpu=leon3 YES YES -mcpu=leon3v7 NO YES "mul/div" means that the compiler will generate multiplication and division instructions, which is a SPARC V8 feature. There are some cases where it is beneficial to compile without mul/div: - If the hardware is synthesized without mul/div instructions. - To reduce interrupt response time on systems with slow div. "casa" means that the compiler generates the atomic compare-and-swap instruction which is an extension to SPARC V8. The -mflat option enables the flag register window model. SAVE and RESTORE instructions will not be generated by the compiler. It is ABI compliant with the SPARC ABI. Signed-off-by: Martin Åberg <[email protected]>
1 parent 210a1dd commit 8d7d29e

File tree

1 file changed

+96
-0
lines changed

1 file changed

+96
-0
lines changed
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
From 4beadbc1abc6a2943b541124d391ceb26a1042c4 Mon Sep 17 00:00:00 2001
2+
From: Martin Aberg <[email protected]>
3+
Date: Wed, 18 Nov 2020 13:18:59 +0100
4+
Subject: [PATCH] Add LEON multilibs for sparc-zephyr-elf
5+
MIME-Version: 1.0
6+
Content-Type: text/plain; charset=UTF-8
7+
Content-Transfer-Encoding: 8bit
8+
9+
Adds the necessary bits for building libraries for the LEON -mcpu
10+
targets.
11+
12+
Signed-off-by: Martin Åberg <[email protected]>
13+
---
14+
gcc/config.gcc | 3 +++
15+
gcc/config/sparc/t-zephyr | 55 +++++++++++++++++++++++++++++++++++++++++++++++
16+
2 files changed, 58 insertions(+)
17+
create mode 100644 gcc/config/sparc/t-zephyr
18+
19+
diff --git a/gcc/config.gcc b/gcc/config.gcc
20+
index 6a349965c0af..96a17f7eacbd 100644
21+
--- a/gcc/config.gcc
22+
+++ b/gcc/config.gcc
23+
@@ -3273,6 +3273,9 @@ sh-wrs-vxworks)
24+
sparc-*-elf*)
25+
tm_file="${tm_file} dbxelf.h elfos.h newlib-stdint.h sparc/sysv4.h sparc/sp-elf.h"
26+
case ${target} in
27+
+ sparc-zephyr*)
28+
+ tmake_file="sparc/t-sparc sparc/t-zephyr"
29+
+ ;;
30+
*-leon-*)
31+
tmake_file="sparc/t-sparc sparc/t-leon"
32+
;;
33+
diff --git a/gcc/config/sparc/t-zephyr b/gcc/config/sparc/t-zephyr
34+
new file mode 100644
35+
index 000000000000..baaff2f0b77d
36+
--- /dev/null
37+
+++ b/gcc/config/sparc/t-zephyr
38+
@@ -0,0 +1,55 @@
39+
+# Copyright (C) 2012-2014 Free Software Foundation, Inc.
40+
+#
41+
+# This file is part of GCC.
42+
+#
43+
+# GCC is free software; you can redistribute it and/or modify
44+
+# it under the terms of the GNU General Public License as published by
45+
+# the Free Software Foundation; either version 3, or (at your option)
46+
+# any later version.
47+
+#
48+
+# GCC is distributed in the hope that it will be useful,
49+
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
50+
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
51+
+# GNU General Public License for more details.
52+
+#
53+
+# You should have received a copy of the GNU General Public License
54+
+# along with GCC; see the file COPYING3. If not see
55+
+# <http://www.gnu.org/licenses/>.
56+
+
57+
+# Multilibs for Zephyr
58+
+MULTILIB_OPTIONS =
59+
+MULTILIB_DIRNAMES =
60+
+
61+
+MULTILIB_OPTIONS += mcpu=leon/mcpu=leon3/mcpu=leon3v7
62+
+MULTILIB_DIRNAMES += leon leon3 leon3v7
63+
+
64+
+MULTILIB_OPTIONS += msoft-float
65+
+MULTILIB_DIRNAMES += soft
66+
+
67+
+MULTILIB_OPTIONS += mflat
68+
+MULTILIB_DIRNAMES += flat
69+
+
70+
+MULTILIB_MATCHES = msoft-float=mno-fpu
71+
+
72+
+
73+
+# This is the complete list of multilibs to build
74+
+MULTILIB_REQUIRED =
75+
+
76+
+
77+
+MULTILIB_REQUIRED += msoft-float
78+
+
79+
+MULTILIB_REQUIRED += mcpu=leon
80+
+MULTILIB_REQUIRED += mcpu=leon/msoft-float
81+
+MULTILIB_REQUIRED += mcpu=leon/mflat
82+
+MULTILIB_REQUIRED += mcpu=leon/msoft-float/mflat
83+
+
84+
+
85+
+MULTILIB_REQUIRED += mcpu=leon3
86+
+MULTILIB_REQUIRED += mcpu=leon3/msoft-float
87+
+MULTILIB_REQUIRED += mcpu=leon3/mflat
88+
+MULTILIB_REQUIRED += mcpu=leon3/msoft-float/mflat
89+
+
90+
+MULTILIB_REQUIRED += mcpu=leon3v7
91+
+MULTILIB_REQUIRED += mcpu=leon3v7/msoft-float
92+
+MULTILIB_REQUIRED += mcpu=leon3v7/mflat
93+
+MULTILIB_REQUIRED += mcpu=leon3v7/msoft-float/mflat
94+
--
95+
2.11.0
96+

0 commit comments

Comments
 (0)