• R/O
  • HTTP
  • SSH
  • HTTPS

コミット

タグ
未設定

よく使われているワード(クリックで追加)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GCC with patches for Dreamcast


コミットメタ情報

リビジョンfdc37389fbf72c218b82b16505a8e9de3815fbc1 (tree)
日時2021-09-30 14:15:03
作者alaskanemily <emily@alas...>
コミッターalaskanemily

ログメッセージ

Add Dreamcast target

変更サマリ

差分

--- a/config.sub
+++ b/config.sub
@@ -1415,7 +1415,7 @@ case $os in
14151415 | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
14161416 | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
14171417 | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
1418- | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \
1418+ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -dc* \
14191419 | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox* | -bme*)
14201420 # Remember, each alternative MUST END IN *, to match a version number.
14211421 ;;
--- a/fixincludes/mkfixinc.sh
+++ b/fixincludes/mkfixinc.sh
@@ -19,7 +19,8 @@ case $machine in
1919 powerpc-*-rtems* | \
2020 powerpcle-*-eabisim* | \
2121 powerpcle-*-eabi* | \
22- *-musl* )
22+ *-musl* |
23+ *-dc)
2324 # IF there is no include fixing,
2425 # THEN create a no-op fixer and exit
2526 (echo "#! /bin/sh" ; echo "exit 0" ) > ${target}
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -676,6 +676,11 @@ case ${target} in
676676 "" | yes | posix) thread_file='posix' ;;
677677 esac
678678 ;;
679+*-*-dc*)
680+ gas=yes
681+ gnu_ld=yes
682+ use_gcc_stdint=provide
683+ ;;
679684 *-*-dragonfly*)
680685 gas=yes
681686 gnu_ld=yes
@@ -2744,6 +2749,14 @@ s390x-ibm-tpf*)
27442749 extra_options="${extra_options} s390/tpf.opt"
27452750 tmake_file="${tmake_file} s390/t-s390"
27462751 ;;
2752+sh*-*-dc*)
2753+ with_endian=little
2754+ TM_ENDIAN_CONFIG=ml
2755+ tm_file="sh/little.h dbxelf.h elfos.h sh/elf.h sh/embed-elf.h ${tm_file} dc.h"
2756+ sh_cpu_default=sh4-single-only
2757+ sh_cpu_target=sh4-single-only
2758+ tm_defines="$tm_defines SUPPORT_SH1=1 SUPPORT_SH2E=1 SUPPORT_SH4=1 SUPPORT_SH4_SINGLE=1"
2759+ ;;
27472760 sh-*-elf* | sh[12346l]*-*-elf* | \
27482761 sh-*-linux* | sh[2346lbe]*-*-linux* | \
27492762 sh-*-netbsdelf* | shl*-*-netbsdelf*)
--- /dev/null
+++ b/gcc/config/dc.h
@@ -0,0 +1,60 @@
1+/*
2+ * GCC config for Dreamcast.
3+ *
4+ * This software is provided 'as-is', without any express or implied
5+ * warranty. In no event will the authors be held liable for any damages
6+ * arising from the use of this software.
7+ *
8+ * Permission is granted to anyone to use this software for any purpose,
9+ * including commercial applications, and to alter it and redistribute it
10+ * freely, subject to the following restrictions:
11+ *
12+ * 1. The origin of this software must not be misrepresented; you must not
13+ * claim that you wrote the original software. If you use this software
14+ * in a product, an acknowledgment in the product documentation would be
15+ * appreciated but is not required.
16+ * 2. Altered source versions must be plainly marked as such, and must not be
17+ * misrepresented as being the original software.
18+ * 3. This notice may not be removed or altered from any source distribution.
19+ */
20+
21+#undef TARGET_DC
22+#define TARGET_DC 1
23+
24+#undef LINK_SPEC
25+#define LINK_SPEC "-N -O -EL --relax"
26+
27+#undef TARGET_OS_CPP_BUILTINS
28+#define TARGET_OS_CPP_BUILTINS() { \
29+ builtin_define("__dreamcast__"); \
30+ builtin_define("__dc__"); \
31+ builtin_assert("system=dc"); \
32+ \
33+ }
34+
35+/* Default to unsigned chars */
36+#undef DEFAULT_SIGNED_CHAR
37+#define DEFAULT_SIGNED_CHAR 0
38+
39+/* Used from ASM */
40+#undef TARGET_CXX_CDTOR_RETURN_THIS
41+#define TARGET_CXX_CDTOR_RETURN_THIS() true
42+
43+/* BYOlibm */
44+#undef MATH_LIBRARY
45+#define MATH_LIBRARY ""
46+
47+#undef LIBGCC_SPEC
48+#define LIBGCC_SPEC "%{!shared: \
49+ %{m4-100*:-lic_invalidate_array_4-100} \
50+ %{m4-200*:-lic_invalidate_array_4-200} \
51+ %{Os: -lgcc-Os-4-200} \
52+ -lgcc \
53+ %{!Os: -lgcc-Os-4-200}"
54+
55+#undef CC1_SPEC
56+#define CC1_SPEC " -mhitachi "
57+
58+#undef CC1PLUS_SPEC
59+#define CC1PLUS_SPEC " -fno-rtti -fno-exceptions "
60+
--- a/gcc/tsystem.h
+++ b/gcc/tsystem.h
@@ -26,6 +26,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
2626 #ifndef GCC_TSYSTEM_H
2727 #define GCC_TSYSTEM_H
2828
29+#define inhibit_libc 1
30+
2931 /* System headers (e.g. stdio.h, stdlib.h, unistd.h) sometimes
3032 indirectly include getopt.h. Our -I flags will cause gcc's gnu
3133 getopt.h to be included, not the platform's copy. In the default
--- a/libgcc/config.host
+++ b/libgcc/config.host
@@ -1182,6 +1182,17 @@ s390x-ibm-tpf*)
11821182 extra_parts="crtbeginS.o crtendS.o"
11831183 md_unwind_header=s390/tpf-unwind.h
11841184 ;;
1185+sh*-*-dc*)
1186+ tmake_file="$tmake_file sh/t-sh"
1187+ # TODO: Some of these files are not useful on Dreamcast, but the shouldn't
1188+ # actually cause any problems.
1189+ # The Dreamcast also does have an MMU, but it's assumed this will either
1190+ # not be used at all, or will be entirely managed by the software.
1191+ extra_parts="$extra_parts crt1.o crti.o crtn.o crtbeginS.o crtendS.o \
1192+ libic_invalidate_array_4-100.a \
1193+ libic_invalidate_array_4-200.a \
1194+ libgcc-Os-4-200.a libgcc-4-300.a"
1195+ ;;
11851196 sh-*-elf* | sh[12346l]*-*-elf*)
11861197 tmake_file="$tmake_file sh/t-sh t-crtstuff-pic t-fdpbit"
11871198 extra_parts="$extra_parts crt1.o crti.o crtn.o crtbeginS.o crtendS.o \