GCC with patches for Dreamcast
リビジョン | fdc37389fbf72c218b82b16505a8e9de3815fbc1 (tree) |
---|---|
日時 | 2021-09-30 14:15:03 |
作者 | alaskanemily <emily@alas...> |
コミッター | alaskanemily |
Add Dreamcast target
@@ -1415,7 +1415,7 @@ case $os in | ||
1415 | 1415 | | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ |
1416 | 1416 | | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ |
1417 | 1417 | | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ |
1418 | - | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ | |
1418 | + | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -dc* \ | |
1419 | 1419 | | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox* | -bme*) |
1420 | 1420 | # Remember, each alternative MUST END IN *, to match a version number. |
1421 | 1421 | ;; |
@@ -19,7 +19,8 @@ case $machine in | ||
19 | 19 | powerpc-*-rtems* | \ |
20 | 20 | powerpcle-*-eabisim* | \ |
21 | 21 | powerpcle-*-eabi* | \ |
22 | - *-musl* ) | |
22 | + *-musl* | | |
23 | + *-dc) | |
23 | 24 | # IF there is no include fixing, |
24 | 25 | # THEN create a no-op fixer and exit |
25 | 26 | (echo "#! /bin/sh" ; echo "exit 0" ) > ${target} |
@@ -676,6 +676,11 @@ case ${target} in | ||
676 | 676 | "" | yes | posix) thread_file='posix' ;; |
677 | 677 | esac |
678 | 678 | ;; |
679 | +*-*-dc*) | |
680 | + gas=yes | |
681 | + gnu_ld=yes | |
682 | + use_gcc_stdint=provide | |
683 | + ;; | |
679 | 684 | *-*-dragonfly*) |
680 | 685 | gas=yes |
681 | 686 | gnu_ld=yes |
@@ -2744,6 +2749,14 @@ s390x-ibm-tpf*) | ||
2744 | 2749 | extra_options="${extra_options} s390/tpf.opt" |
2745 | 2750 | tmake_file="${tmake_file} s390/t-s390" |
2746 | 2751 | ;; |
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 | + ;; | |
2747 | 2760 | sh-*-elf* | sh[12346l]*-*-elf* | \ |
2748 | 2761 | sh-*-linux* | sh[2346lbe]*-*-linux* | \ |
2749 | 2762 | sh-*-netbsdelf* | shl*-*-netbsdelf*) |
@@ -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 | + |
@@ -26,6 +26,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see | ||
26 | 26 | #ifndef GCC_TSYSTEM_H |
27 | 27 | #define GCC_TSYSTEM_H |
28 | 28 | |
29 | +#define inhibit_libc 1 | |
30 | + | |
29 | 31 | /* System headers (e.g. stdio.h, stdlib.h, unistd.h) sometimes |
30 | 32 | indirectly include getopt.h. Our -I flags will cause gcc's gnu |
31 | 33 | getopt.h to be included, not the platform's copy. In the default |
@@ -1182,6 +1182,17 @@ s390x-ibm-tpf*) | ||
1182 | 1182 | extra_parts="crtbeginS.o crtendS.o" |
1183 | 1183 | md_unwind_header=s390/tpf-unwind.h |
1184 | 1184 | ;; |
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 | + ;; | |
1185 | 1196 | sh-*-elf* | sh[12346l]*-*-elf*) |
1186 | 1197 | tmake_file="$tmake_file sh/t-sh t-crtstuff-pic t-fdpbit" |
1187 | 1198 | extra_parts="$extra_parts crt1.o crti.o crtn.o crtbeginS.o crtendS.o \ |