Skip to content

gcc 10.5.0 → 16.1.0#245

Open
Ashahell wants to merge 2 commits into
deadwood2:masterfrom
Ashahell:gcc-16.1.0
Open

gcc 10.5.0 → 16.1.0#245
Ashahell wants to merge 2 commits into
deadwood2:masterfrom
Ashahell:gcc-16.1.0

Conversation

@Ashahell

Copy link
Copy Markdown

Upgrade cross-compiler toolchain from GCC 10.5.0 to 16.1.0.

Ashahell and others added 2 commits June 19, 2026 09:52
- config/gcc_def: 10.5.0 -> 15.2.0
- config/gcc_exp: 15.1.0 -> 15.2.0
- gcc-15.2.0-aros.diff: transplant aros.h LIB_SPEC + STARTFILE_SPEC +
  CPP_SPEC + WCHAR_TYPE + LIBSTDCXX_STATIC from the 10.5.0 patch (matches
  deadwood2 C runtime layout); fix ctype_base.h _ctype_* -> _IS* macros
- gcc-16.1.0-aros.diff: new file (same fixes, for future GCC port)
@Ashahell

Copy link
Copy Markdown
Author

The GCC 16.1.0 AROS patch (gcc/config/i386/aros64.h) is missing the FIXED_REGISTERS override that 10.5.0 and earlier patches carried. On x86_64 AROS, r12 is reserved for the library base pointer: the proto-inline LVO call sequence loads the system library base into r12 before each call. Without r12 marked fixed, GCC 16 treats it as an ordinary callee-saved register and, under -mcmodel=large, mis-schedules its save/restore — restoring r12 from the stack before the call — so the LVO executes with the wrong base, causing a wild jump / Privilege violation (or illegal instruction in kickstart .text).

Symptom: code built with the new toolchain crashes the moment a library calls a system LVO (e.g. OpenWindowTags, WritePixelArray), while pure-dispatch code (no syslib LVO) runs fine.

Fix: re-add the FIXED_REGISTERS override to i386/aros64.h, reserving r12. The array uses GCC 16's register layout, which adds Intel APX r16–r31 (32 entries beyond GCC 10) — so the old array cannot be copied verbatim; it is rebuilt from gcc-16.1.0's i386.h default with only the r12 slot changed to 1.

Verified: patch --dry-run applies cleanly against pristine gcc-16.1.0; the codegen restore-before-call sites disappear; a self-contained ROMTag library that calls OpenWindowTags runs correctly (it crashed before).

@deadwood2

Copy link
Copy Markdown
Owner

Hi,

Thanks for your PR! Updating the default compiler version is a process with a number of testing stages for both x86_64 and m68k architectures. It also involves updating the native x86_64 compiler to the same version and preferably doing so for m68k. I have no capacity right now to do these tests and updates.

If you are interested in doing the full process let me know. I will provide guidance, testing suite and configure testing build for you which you can share with the community to get more testing and feedback. If you however also don't have capacity right now for the full process, I'll happily accept the compiler patches, but without updating the default versions used in build process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants