Preliminary GCC 13 support for KOS

If you have any questions on programming, this is the place to ask them, whether you're a newbie or an experienced programmer. Discussion on programming in general is also welcome. We will help you with programming homework, but we will not do your work for you! Any porting requests must be made in Developmental Ideas.
Post Reply
|darc|
DCEmu Webmaster
DCEmu Webmaster
Posts: 16373
https://www.artistsworkshop.eu/meble-kuchenne-na-wymiar-warszawa-gdzie-zamowic/
Joined: Wed Mar 14, 2001 6:00 pm
Location: New Orleans, LA
Has thanked: 103 times
Been thanked: 90 times
Contact:

Preliminary GCC 13 support for KOS

Post by |darc| »

Instead of being years behind in GCC version support, we're now ahead of the game. Thanks to a number of commits to KOS over the past few weeks (KOS dev has been really popping this month), we have preliminary KOS support for compiling against the GCC master branch ahead of the GCC 13 initial release. This is in addition to the latest testing config already supporting the latest stable binutils, newlib, and gdb.

And wonderfully, a lot of issues presenting themselves while working on GCC 12 support earlier this year and GCC 13 now turned out to be related to bugs already plaguing older dev environments like KOS+GCC9. Some issues around C++ threading and mutexes were fixed during this process, for example.

If you want to experiment with any of those sweet new C23 and C++23 features, or maybe test out GCC 13's (very experimental) Rust support, for example, here's how. I'm sure Falco will want to follow up soon showing off some new C++23 stuff. ;)
Screenshot_20230312_160059.png

Code: Select all

❯ sh-elf-gcc -v
Using built-in specs.
COLLECT_GCC=sh-elf-gcc
COLLECT_LTO_WRAPPER=/opt/toolchains/dc/13.0.1-bleeding/sh-elf/libexec/gcc/sh-elf/13.0.1/lto-wrapper
Target: sh-elf
Configured with: ../gcc-13/configure --target=sh-elf --prefix=/opt/toolchains/dc/13.0.1-bleeding/sh-elf --with-newlib --disable-libssp --disable-tls --enable-threads=kos --enable-languages=c,c++,objc,obj-c++,rust --enable-checking=release --with-multilib-list=m4-single-only --with-endian=little --with-cpu=m4-single-only CC=cc CXX=c++
Thread model: kos
Supported LTO compression algorithms: zlib zstd
gcc version 13.0.1 20230312 (experimental) (GCC) 

These instructions assume you're familiar with the typical instructions for building a toolchain with dc-chain.
Clone the gcc13 branch of KOS:

Code: Select all

git clone -b gcc13 https://github.com/KallistiOS/KallistiOS.git kos-gcc13
when setting up the toolchain config, choose the new config.mk.bleeding.sample file as your configuration template:

Code: Select all

mv config.mk.bleeding.sample config.mk
Edit the config.mk file if you want to set up installation into a separate, unique directory than normal.
After running ./download.sh and ./unpack.sh, open config.mk once again and comment out this line like so:

Code: Select all

#sh_gcc_ver=12.2.0
and uncomment this line like so:

Code: Select all

sh_gcc_ver=13
and finally, clone the master GCC repo into the gcc-13 directory:

Code: Select all

git clone https://github.com/gcc-mirror/gcc.git gcc-13
then run make to build your toolchain from the master repo.
These users thanked the author |darc| for the post (total 2):
GyroVorbisIan Robinson
It's thinking...
Post Reply