Skip to content

Restore AmigaOS build and runtime support - #8660

Merged
StephenCWills merged 3 commits into
diasurgical:masterfrom
JennaScvl:amiga-fixes
Aug 6, 2026
Merged

Restore AmigaOS build and runtime support#8660
StephenCWills merged 3 commits into
diasurgical:masterfrom
JennaScvl:amiga-fixes

Conversation

@JennaScvl

Copy link
Copy Markdown
Contributor

AmigaOS support has been broken since 1.5.3; this fixes it back up to current master. Four independent issues, in the order they'd otherwise be hit:

  • m68k-amigaos GCC miscompiles the rendering code at -O2 and above. Pin the platform (and the render sources specifically, since their COMPILE_OPTIONS are appended after the global flags and would otherwise re-enable -O2) to -O1.

  • std::random_device has no working entropy source on this toolchain and aborts on construction. It's called during static initialization of the global RNG, so the process dies before main() ever runs. Extend the existing old-Windows guard to also skip it on AmigaOS.

  • --gc-sections discards static constexpr data that's still referenced. magic_enum's per-enum name tables are the visible casualty: enum_name() returns a string_view with the correct length pointing at storage the linker collected, so every enum name reads back as garbage. Exclude AMIGA from -ffunction-sections/ -fdata-sections/--gc-sections, the same way PS4 already is.

  • std::filesystem can't create or resolve AmigaOS volume/assign paths such as PROGDIR: or Work:games (it treats the colon as an ordinary character). Add AmigaOS to DVL_NO_FILESYSTEM so the existing non-filesystem fallbacks handle these paths instead.

Also required to build at all under a modern (15.2) m68k-amigaos GCC: a FindSDL wrapper that strips the thread-library flag CMake's bundled module picks (m68k-amigaos-g++ accepts neither -pthread nor the -lpthreads fallback), the existing threads-stub wired in for Amiga the same way it already is for the 3DS, and a small compat shim for __xpg_strerror_r, which this GCC's libstdc++ references but libnix doesn't provide.

AmigaOS support has been broken since 1.5.3; this fixes it back up to
current master. Four independent issues, in the order they'd otherwise
be hit:

- m68k-amigaos GCC miscompiles the rendering code at -O2 and above.
  Pin the platform (and the render sources specifically, since their
  COMPILE_OPTIONS are appended after the global flags and would
  otherwise re-enable -O2) to -O1.

- std::random_device has no working entropy source on this toolchain
  and aborts on construction. It's called during static initialization
  of the global RNG, so the process dies before main() ever runs.
  Extend the existing old-Windows guard to also skip it on AmigaOS.

- `--gc-sections` discards static constexpr data that's still
  referenced. magic_enum's per-enum name tables are the visible
  casualty: enum_name() returns a string_view with the correct length
  pointing at storage the linker collected, so every enum name reads
  back as garbage. Exclude AMIGA from -ffunction-sections/
  -fdata-sections/--gc-sections, the same way PS4 already is.

- std::filesystem can't create or resolve AmigaOS volume/assign paths
  such as PROGDIR: or Work:games (it treats the colon as an ordinary
  character). Add AmigaOS to DVL_NO_FILESYSTEM so the existing
  non-filesystem fallbacks handle these paths instead.

Also required to build at all under a modern (15.2) m68k-amigaos GCC:
a FindSDL wrapper that strips the thread-library flag CMake's bundled
module picks (m68k-amigaos-g++ accepts neither -pthread nor the
-lpthreads fallback), the existing threads-stub wired in for Amiga the
same way it already is for the 3DS, and a small compat shim for
__xpg_strerror_r, which this GCC's libstdc++ references but libnix
doesn't provide.
Comment thread Source/platform/amiga/strerror_r.c
Comment thread CMakeLists.txt Outdated
@StephenCWills
StephenCWills enabled auto-merge (squash) August 6, 2026 01:19
@StephenCWills
StephenCWills merged commit aff9a4a into diasurgical:master Aug 6, 2026
25 checks passed
StephenCWills pushed a commit to JennaScvl/DevilutionX that referenced this pull request Aug 9, 2026
Move the pinned m68k-amigaos-gcc10 digest from GCC 13.2 to the current
GCC 15.2 build, keeping a fixed digest rather than floating on the tag
(the whole reason it was pinned in the first place). Also patches
prep.sh so AmigaPorts' libSDL12 still builds: GCC 14+ promotes several
legacy-C conformance warnings to hard errors by default, which this
1990s-vintage codebase trips on every one of. The fix is gated on the
actual compiler's major version, so it's a no-op under GCC 13.2 and
only applies under 14+ -- verified both ways with a clean build.
Requires diasurgical#8660 (Restore AmigaOS build and runtime support) to actually
build successfully; without those fixes this compiler alone still hits
the same failures documented there.
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