Skip to content

Commit 17f4e99

Browse files
committed
Switch to GCC 15.2 and update KallistiOS.
Also added Makefile rule for rebuild kos-ports.
1 parent cae33df commit 17f4e99

File tree

4 files changed

+265
-8
lines changed

4 files changed

+265
-8
lines changed

Makefile

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ VER_MAJOR = 4
1515
VER_MINOR = 0
1616
VER_MICRO = 3
1717
# Build types: 0x0N - Alpha, 0x1N - Beta, 0x2N - RC, 0x3N - Release
18-
VER_BUILD = 0x11
18+
VER_BUILD = 0x12
1919

2020
BUILD_TYPE_BASE = $(if $(filter 0x3%,$(VER_BUILD)),Release,$(if $(filter 0x2%,$(VER_BUILD)),RC,$(if $(filter 0x1%,$(VER_BUILD)),Beta,$(if $(filter 0x0%,$(VER_BUILD)),Alpha,Release))))
2121
BUILD_NUM = $(lastword $(subst 0x2,,$(subst 0x1,,$(subst 0x0,,$(subst 0x3,,$(VER_BUILD))))))
@@ -245,11 +245,22 @@ update-build:
245245
@echo Building DreamShell...
246246
@make clean-all && make build
247247

248+
build-ports:
249+
@echo Fetching and rebuilding kos-ports from GitHub...
250+
@mv include include_
251+
@cd $(KOS_BASE)/../kos-ports && git fetch && git checkout origin/master
252+
@echo Uninstalling previous kos-ports...
253+
@$(KOS_BASE)/../kos-ports/utils/uninstall-all.sh
254+
@echo Building new kos-ports...
255+
@$(KOS_BASE)/../kos-ports/utils/build-all.sh
256+
@mv include_ include
257+
248258
toolchain:
249259
@cp $(DS_SDK)/toolchain/environ.sh $(KOS_BASE)/environ.sh
250260
@cp $(DS_SDK)/toolchain/patches/*.diff $(KOS_BASE)/utils/dc-chain/patches
261+
@cp $(DS_SDK)/toolchain/Makefile.cfg $(KOS_BASE)/utils/dc-chain/Makefile.cfg
251262
@source $(KOS_BASE)/environ.sh
252-
@cd $(KOS_BASE)/utils/dc-chain && cp Makefile.default.cfg Makefile.cfg && make
263+
@cd $(KOS_BASE)/utils/dc-chain && make
253264

254265
$(TARGET): libs $(TARGET_BIN) make-build
255266

README.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ git submodule update --init --recursive
4343
```console
4444
sudo mkdir -p /opt/toolchains/dc
4545
sudo chown -R $(id -u):$(id -g) /opt/toolchains/dc
46-
cd /usr/local/dc/kos/kos/utils/dc-chain
47-
cp Makefile.dreamcast.cfg Makefile.cfg
48-
make
46+
cd /usr/local/dc/kos/kos
47+
cp ./ds/sdk/toolchain/Makefile.cfg ./utils/dc-chain/Makefile.cfg
48+
cd utils/dc-chain && make
4949
```
5050
##### SDK
5151
```console
@@ -78,14 +78,18 @@ make clean-all
7878
```console
7979
make release
8080
```
81-
##### Update code from GitHub
81+
##### Update all code from GitHub
8282
```console
8383
make update
8484
```
85-
##### Update code from GitHub and re-build
85+
##### Update all code from GitHub and re-build
8686
```console
8787
make update-build
8888
```
89+
##### Update and re-build kos-ports
90+
```console
91+
make build-ports
92+
```
8993
##### Re-build toochain (if updated)
9094
```console
9195
make toolchain

sdk/doc/KallistiOS.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
011c420e0b5c843591fb8258c4784eab4459fdac
1+
7bd48056e76e750d1c90e0cc4aeb156f46da31f8

sdk/toolchain/Makefile.cfg

Lines changed: 242 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,242 @@
1+
# Sega Dreamcast Toolchains Maker (dc-chain)
2+
# This file is part of KallistiOS.
3+
4+
#########################
5+
### TOOLCHAIN PROFILE ###
6+
#########################
7+
8+
# One of the supported platforms:
9+
# - dreamcast: Build a toolchain for the SEGA Dreamcast
10+
# - aica: Build a toolchain for the Dreamcast's AICA co-processor
11+
# - gamecube: Build a toolchain for the Nintendo GameCube
12+
platform=dreamcast
13+
14+
# Choose a toolchain profile from the following available options:
15+
# Release toolchains:
16+
# - 9.5.0-winxp: Legacy: Most recent versions of tools which run on Windows XP.
17+
# - stable: Stable: Well-tested; based on GCC 13.2.0, released 2023-07-27.
18+
# - 13.4.0: Testing: Latest release in the GCC 13 series, released 2025-06-05.
19+
# - 14.3.0: Testing: Latest release in the GCC 14 series, released 2025-05-23.
20+
# - 15.2.0: Testing: Latest release in the GCC 15 series, released 2025-08-08.
21+
# Development toolchains:
22+
# - 13.4.1-dev Bleeding edge GCC 13 series from git.
23+
# - 14.3.1-dev Bleeding edge GCC 14 series from git.
24+
# - 15.0.0-lra GCC 15 branch containing experimental SuperH fixes for LRA.
25+
# - 15.2.1-dev Bleeding edge GCC 15 series from git.
26+
# - 16.0.0-dev Bleeding edge GCC 16 series from git.
27+
# If unsure, select stable. See README.md for more detailed descriptions.
28+
toolchain_profile=15.2.0
29+
30+
########################
31+
### DOWNLOAD OPTIONS ###
32+
########################
33+
34+
### Download protocol (http|https|ftp)
35+
# Specify the protocol you want to use for downloading package files.
36+
download_protocol=https
37+
38+
### Force downloader (curl|wget)
39+
# Specify here if you'd prefer to use 'wget' or 'curl'. If neither is specified,
40+
# a web downloader tool will be auto-detected in the following order: cURL, Wget
41+
# You must have either Wget or cURL installed to use dc-chain.
42+
#force_downloader=wget
43+
44+
### Specify GNU mirror override
45+
# The default mirror for GNU sources is 'ftpmirror.gnu.org'
46+
# This setting overrides the default mirror with a preferred mirror.
47+
#gnu_mirror=mirrors.kernel.org
48+
49+
#####################
50+
### BUILD OPTIONS ###
51+
#####################
52+
53+
### Toolchains install path
54+
# Specify the directory where the toolchain will be installed. This setting
55+
# must match the KOS_CC_BASE setting in your KOS "environ.sh" configuration.
56+
toolchain_path=/opt/toolchains/dc/sh-elf
57+
58+
### Make jobs (n|<empty>)
59+
# Set this value to the number of parallel jobs you want to run with make.
60+
# Leave it empty to use a number of parallel jobs that corresponds to the
61+
# number of CPU threads available.
62+
# Using multiple jobs may cause issues in certain environments and may be
63+
# automatically disabled. If you encounter errors building your toolchain,
64+
# reduce the number of jobs to 1 to avoid issues and ease troubleshooting.
65+
makejobs=
66+
67+
### Verbose (1|0)
68+
# Choose whether to actively display compilation messages on the screen.
69+
# Messages are saved to the build log files regardless of this setting.
70+
verbose=1
71+
72+
### Erase (1|0)
73+
# Erase build directories as toolchain components are installed to save space.
74+
erase=1
75+
76+
### Install toolchain debug symbols (1|0)
77+
# Choose whether to keep the debugging symbols for the toolchain.
78+
# This is only useful if you wish to debug the toolchain itself.
79+
#toolchain_debug=1
80+
81+
########################
82+
### LANGUAGE OPTIONS ###
83+
########################
84+
85+
### Enable C++
86+
# Builds C++ support, including the C++ compiler and its standard library. The
87+
# vast majority of language features are supported, with C++23 and early C++26
88+
# support included. KallistiOS provides several examples with C++ support, so it
89+
# is enabled by default. Adding C++ support requires extra disk space and
90+
# compilation time, so you may disable it here if you do not plan on using C++.
91+
enable_cpp=1
92+
93+
### Enable Objective-C
94+
# Builds Objective-C support. Currently, this builds the Obj-C compiler and
95+
# runtime, but does not build a standard library. The GNUStep Base Library is
96+
# currently in active development for future inclusion in the kos-ports library.
97+
# KallistiOS provides examples with Obj-C support, so it is enabled by default.
98+
enable_objc=1
99+
100+
### Enable Objective C++
101+
# Builds Objective C++ support. This hybrid language allows both C++ and Obj-C
102+
# methods to be called from both contexts. Enabled by default as both the C++
103+
# and Obj-C languages are already enabled by default.
104+
enable_objcpp=1
105+
106+
### Enable D
107+
# Builds D support. This will build the D compiler, but does not build the
108+
# Phobos Runtime Library. D support may only be enabled on POSIX platforms which
109+
# have its external dependencies provided through a host DMD, GDC, or LDC
110+
# compiler installation.
111+
#enable_d=1
112+
113+
### Enable Ada
114+
# Builds Ada support. This will build the GNAT Ada compiler and tools but does
115+
# not build the libada runtime library. In order for this build to succeed, the
116+
# host's GCC version must match the target Dreamcast version, plus the same
117+
# version of GNAT and its tools must be preinstalled (and in your path).
118+
#enable_ada=1
119+
120+
### Enable Rust
121+
# Builds the work-in-progress GCCRS Rust compiler frontend for GCC.
122+
# Requires a development version of GCC.
123+
#enable_rust=1
124+
125+
### Enable libgccjit
126+
# Enables the libgccjit just-in-time embeddable GCC library. This can also be
127+
# used to generate code ahead of time, e.g. with rustc_codegen_gcc project.
128+
#enable_libgccjit=1
129+
130+
###################
131+
### GCC OPTIONS ###
132+
###################
133+
134+
### Floating-point precision support (m4-single|m4-single-only|m4|m4-nofpu)
135+
# Build support for various SH4 floating-point operation ABIs. KallistiOS
136+
# supports both the single-precision-default ABI (m4-single) and the
137+
# single-precision-only ABI (m4-single-only). When using m4-single, the SH4 will
138+
# be in single-precision mode upon function entry but will switch to double-
139+
# precision mode if 64-bit doubles are used. When using m4-single-only, the SH4
140+
# will always be in single-precision mode and 64-bit doubles will be truncated to
141+
# 32-bit floats. In double-precision mode (m4), which is unsupported by
142+
# KallistiOS, the SH4 will be in double precision mode upon function entry.
143+
# Finally in no fpu mode (m4-nofpu), which is also unsupported by KallistiOS and
144+
# objc/++, there is no support for floating-point operations at all.
145+
# Historically, m4-single-only was used in both official and homebrew Dreamcast
146+
# software, but m4-single is the default as of KOS 2.2.0 to increase
147+
# compatibility with newer libraries which require 64-bit doubles.
148+
precision_modes=m4-single,m4-single-only
149+
150+
### Default floating-point mode (m4-single|m4-single-only|m4|m4-nofpu)
151+
# Choose the default floating-point precision ABI used when GCC is invoked. This
152+
# may be overridden by passing -m4-single, -m4-single-only, or -m4 to GCC.
153+
default_precision=m4-single
154+
155+
### GCC threading model (single|kos)
156+
# KallistiOS patches to GCC provide a 'kos' thread model, which should be used.
157+
# If you want to disable threading support for C++, Objective-C, and so forth,
158+
# you can set this option to 'single'.
159+
thread_model=kos
160+
161+
### Automatic patching for KallistiOS (1|0)
162+
# Uncomment this option if you want to disable applying KallistiOS patches to
163+
# toolchain source files before building. This will disable usage of the 'kos'
164+
# thread model. Only do this if you understand what you are doing.
165+
#use_kos_patches=0
166+
167+
### Disable GCC Native Language Support (1|0)
168+
# By default, NLS allows GCC to output diagnostics in non-English languages.
169+
# Uncomment this option to disable NLS and force GCC to output in English.
170+
#disable_nls=1
171+
172+
######################
173+
### NEWLIB OPTIONS ###
174+
######################
175+
176+
### Automatic patching for Newlib (1|0)
177+
# Uncomment this option if you want to disable the automatic patching of Newlib
178+
# needed by KallistiOS. This will keep the generated toolchain completely raw.
179+
# This will also disable the 'kos' thread model. Only do this if you understand
180+
# what you are doing.
181+
#auto_fixup_sh4_newlib=0
182+
183+
### C99 format specifier support (1|0)
184+
# Define this to build Newlib with additional support for the C99 format
185+
# specifiers, used by printf and friends. These include support for size_t,
186+
# ptrdiff_t, intmax_t, and sized integral types.
187+
newlib_c99_formats=1
188+
189+
### Multibyte character set support (1|0)
190+
# Define this to build Newlib with additional multibyte support. This enables
191+
# three special locales: "C-JIS", "C-SJIS", and "C-EUCJP". The multibyte
192+
# support extends to the mb and wc functions in stdlib as well as format
193+
# characters for the printf and scanf family of routines.
194+
#newlib_multibyte=1
195+
196+
### iconv() character encoding conversions support (encoding list)
197+
# Define a list here to enable support for the iconv() function and <iconv.h>
198+
# header file. The given comma separated list defines for which encoding types
199+
# to include bidirectional conversion support. For the full list of available
200+
# encodings, see the Newlib configuration documentation.
201+
#newlib_iconv_encodings=us_ascii,utf8,utf16,ucs_2_internal,ucs_4_internal
202+
203+
### Optimize Newlib for space (1|0)
204+
# Uncomment this option to optimize for space when building Newlib. This will
205+
# build Newlib with compiler flags which favor smaller code sizes over faster
206+
# performance.
207+
#newlib_opt_space=1
208+
209+
###################
210+
### C++ OPTIONS ###
211+
###################
212+
213+
### Timezone database support (1|0|path)
214+
# Uncomment this option to enable building support for C++'s std::chrono::tzdb
215+
# into your C++ standard library by using a combination of the system's local
216+
# timezone DB and one dynamically fetched from the "IANA Time Zone Database."
217+
# Without support enabled, only the "UTC" and "GMT" timezones will be defined.
218+
# You can optionally provide the path to a directory with a custom "tzdata.zi"
219+
# database file. NOTE: Enabling this will result in larger C++ binaries!
220+
#libstdcxx_tzdb=1
221+
222+
#######################
223+
### WINDOWS OPTIONS ###
224+
#######################
225+
226+
### MinGW/MSYS
227+
# Standalone binaries (1|0)
228+
# Uncomment this option if you want static binaries that are standalone and
229+
# require no dependencies. When this option is used, binaries can be run outside
230+
# the MinGW/MSYS environment. This is NOT recommended; only do this if you know
231+
# what you are doing.
232+
#standalone_binary=1
233+
234+
### Force installation of BFD for SH (1|0)
235+
# Uncomment this option if you want to force installation of 'libbfd' for the SH
236+
# toolchain. This is required for MinGW/MSYS and can't be disabled in this
237+
# scenario. This option is here mainly if you want to force the installation of
238+
# 'libbfd' under other environments, but this won't be necessary in most cases,
239+
# as 'libelf' is used almost everywhere. Please note, 'libbfd' is not portable
240+
# if you built it on another environment. Only use this flag if you understand
241+
# what you are doing.
242+
#sh_force_libbfd_installation=1

0 commit comments

Comments
 (0)