Skip to content

Commit f399456

Browse files
galaknashif
authored andcommitted
Support soft-fp on i586 toolchain build
Forward port patches from meta-zephyr-sdk to enable soft-fp on i586. Fixes #37 Signed-off-by: Kumar Gala <[email protected]>
1 parent 37f9fac commit f399456

File tree

2 files changed

+109
-0
lines changed

2 files changed

+109
-0
lines changed

configs/i586.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ CT_LOCAL_PATCH_DIR="${CT_TOP_DIR}/../../patches"
77
# CT_LOG_PROGRESS_BAR is not set
88
CT_ARCH_X86=y
99
CT_ARCH_TUNE="pentium"
10+
CT_MULTILIB=y
1011
CT_TARGET_CFLAGS="-m32"
1112
CT_TARGET_VENDOR="zephyr"
1213
CT_LIBC_NEWLIB_TARGET_CFLAGS="-DMISSING_SYSCALL_NAMES"
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
From 4d6487c3c267f62c6d03fe05d6111587f60b24c9 Mon Sep 17 00:00:00 2001
2+
From: Kumar Gala <[email protected]>
3+
Date: Mon, 18 Feb 2019 10:53:49 -0600
4+
Subject: [PATCH] Enable soft-fp on i586
5+
6+
This is a porting of the patches in meta-zephyr-sdk to gcc-8.2.0
7+
8+
We merge:
9+
recipes-devtools/gcc/files/libgcc-t-zephyr.patch
10+
recipes-devtools/gcc/files/config-x86-multi-gcc.patch
11+
recipes-devtools/gcc/files/x86-multilib.patch
12+
recipes-devtools/gcc/files/config-libgcc-softfp.patch
13+
14+
Into one patch. There are some changes to libgcc/config.host in
15+
gcc-8.2.0 that required updating the patch to that file. There's some
16+
common code to handle soft-fp on x86. In gcc-8.2.0 that common code
17+
would by default get applied to a zephyr build. However the common
18+
code doesn't handle soft-fp the way we need so we add
19+
i[34567]86-zephyr-elf as a special case similar to
20+
i[34567]86-*-elfiamcu.
21+
22+
Signed-off-by: Kumar Gala <[email protected]>
23+
---
24+
gcc/config.gcc | 4 ++++
25+
gcc/config/i386/t-zephyr | 23 +++++++++++++++++++++++
26+
libgcc/config.host | 5 ++++-
27+
libgcc/config/i386/32/t-zephyr | 1 +
28+
4 files changed, 32 insertions(+), 1 deletion(-)
29+
create mode 100644 gcc/config/i386/t-zephyr
30+
create mode 100644 libgcc/config/i386/32/t-zephyr
31+
32+
diff --git a/gcc/config.gcc b/gcc/config.gcc
33+
index 912116ac164..a9e11b467f6 100644
34+
--- a/gcc/config.gcc
35+
+++ b/gcc/config.gcc
36+
@@ -1490,6 +1490,10 @@ x86_64-*-darwin*)
37+
i[34567]86-*-elfiamcu)
38+
tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h newlib-stdint.h i386/iamcu.h"
39+
;;
40+
+i586-zephyr-elf)
41+
+ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h newlib-stdint.h i386/i386elf.h"
42+
+ tmake_file="${tmake_file} i386/t-zephyr"
43+
+ ;;
44+
i[34567]86-*-elf*)
45+
tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h newlib-stdint.h i386/i386elf.h"
46+
;;
47+
diff --git a/gcc/config/i386/t-zephyr b/gcc/config/i386/t-zephyr
48+
new file mode 100644
49+
index 00000000000..52312345b68
50+
--- /dev/null
51+
+++ b/gcc/config/i386/t-zephyr
52+
@@ -0,0 +1,23 @@
53+
+# Copyright (C) 2016 Intel Corporation.
54+
+#
55+
+# This file is part of GCC.
56+
+#
57+
+# GCC is free software; you can redistribute it and/or modify
58+
+# it under the terms of the GNU General Public License as published by
59+
+# the Free Software Foundation; either version 3, or (at your option)
60+
+# any later version.
61+
+#
62+
+# GCC is distributed in the hope that it will be useful,
63+
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
64+
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
65+
+# GNU General Public License for more details.
66+
+#
67+
+# You should have received a copy of the GNU General Public License
68+
+# along with GCC; see the file COPYING3. If not see
69+
+# <http://www.gnu.org/licenses/>.
70+
+#
71+
+
72+
+MULTILIB_OPTIONS += msoft-float
73+
+MULTILIB_DIRNAMES += soft-float
74+
+MULTILIB_MATCHES = msoft-float=mno-80387
75+
+MULTILIB_EXCEPTIONS =
76+
diff --git a/libgcc/config.host b/libgcc/config.host
77+
index 11b4acaff55..fbc79366dca 100644
78+
--- a/libgcc/config.host
79+
+++ b/libgcc/config.host
80+
@@ -606,6 +606,9 @@ x86_64-*-darwin*)
81+
i[34567]86-*-elfiamcu)
82+
tmake_file="$tmake_file i386/t-crtstuff t-softfp-sfdftf i386/32/t-softfp i386/32/t-iamcu i386/t-softfp t-softfp t-dfprules"
83+
;;
84+
+i586-zephyr-elf)
85+
+ tmake_file="$tmake_file i386/t-crtstuff t-softfp-sfdf i386/32/t-zephyr i386/t-softfp t-softfp t-dfprules"
86+
+ ;;
87+
i[34567]86-*-elf*)
88+
tmake_file="$tmake_file i386/t-crtstuff t-crtstuff-pic t-libgcc-pic"
89+
;;
90+
@@ -1390,7 +1393,7 @@ i[34567]86-*-linux* | x86_64-*-linux* | \
91+
esac
92+
93+
case ${host} in
94+
-i[34567]86-*-elfiamcu | i[34567]86-*-rtems*)
95+
+i[34567]86-*-elfiamcu | i[34567]86-zephyr-elf | i[34567]86-*-rtems*)
96+
# These use soft-fp for SFmode and DFmode, not just TFmode.
97+
;;
98+
i[34567]86-*-* | x86_64-*-*)
99+
diff --git a/libgcc/config/i386/32/t-zephyr b/libgcc/config/i386/32/t-zephyr
100+
new file mode 100644
101+
index 00000000000..7595cdeed84
102+
--- /dev/null
103+
+++ b/libgcc/config/i386/32/t-zephyr
104+
@@ -0,0 +1 @@
105+
+HOST_LIBGCC2_CFLAGS += -mlong-double-80
106+
--
107+
2.20.1
108+

0 commit comments

Comments
 (0)