Skip to content

v0.0.162

Choose a tag to compare

@github-actions github-actions released this 24 Aug 18:00
· 113 commits to main since this release

rePIU v0.0.162

이전 릴리스 v0.0.161 이후의 변경입니다. Linux 이식의 첫 단계로, 플랫폼 공용 코어와 그
probe가 Linux에서 i386으로 빌드되고 통과합니다. Windows 동작에는 변화가 없고, Linux에서
게임이 실행되지는 않습니다.

측정이 계획을 결정했습니다

이식 범위를 추정하지 않고 먼저 쟀습니다. 전체 192개 소스 중 공용 코어가 53개,
src/platform/win32가 76개인데, 공용 코어는 Win32 헤더를 하나도 include하지 않고, MSVC
전용 구문이 없으며, 32비트 포인터를 가정하지 않고, GCC 13 + C++20에서 오류 없이
컴파일됩니다.
한 줄도 고치지 않고 Linux로 넘어갔습니다.

반대쪽은 규모가 다릅니다 — CONTEXT 270곳, VirtualProtect 47곳, fs:[...] 어셈블리
28곳. 실행 엔진 이식(Stage 3)의 크기입니다.

빌드 구조

  • src/platform/win32 76개와 Windows 전용 실행 파일이 if(WIN32) 안으로 들어갔습니다.
    새 라이브러리 타깃을 만들지 않았으므로 Windows 결과물과 링크 구성은 그대로입니다.
  • repiu_core_probe 신설. 플랫폼에 의존하지 않는 probe 9개를 담고 양쪽 OS에서 모두
    빌드됩니다. 두 실행의 출력 46줄이 완전히 동일합니다 — "통과했다"가 아니라 "같은
    코드가 두 환경에서 같은 결과를 낸다"를 확인할 수 있습니다.
  • scripts/build_linux_i386.sh 추가. 32비트 툴체인을 먼저 확인하고 없으면 설치 명령을
    안내합니다.

Linux 빌드

sudo apt update && sudo apt install -y gcc-multilib g++-multilib libc6-dev-i386
scripts/build_linux_i386.sh --config Debug --target repiu_exe --target repiu_core_probe
build/linux_i386/repiu_core_probe

아키텍처는 i386입니다. 게스트의 32비트 코드를 같은 프로세스에서 네이티브 실행하므로
호스트도 32비트여야 하고, 이는 현재 Win32 호스트와 같은 이유입니다.

고친 것

nvram_path_probe가 MSVC 전용 _putenv를 쓰고 있었습니다. POSIX는 setenv/unsetenv이고
변수를 지우는 방식도 다릅니다. 조건부로 나눴습니다. 공용 코어 53개에서는 이런 결함이
하나도 나오지 않았습니다.

알려진 제한

  • 실행 엔진·로더·런처는 Windows 전용입니다. Linux에서 게임은 실행되지 않습니다.
  • SDL3가 X11/Wayland 개발 패키지를 요구해, 이 단계에서는 창을 열지 않으므로 SDL이
    문서화한 헤드리스 옵션을 씁니다. 런처를 올리는 다음 단계에서는 실제 데스크톱 패키지가
    필요합니다.
  • repiu_chd_cd_probe와 repiu_glide_issue_probe는 Win32 참조가 없어 가드하지 않았지만
    Linux 빌드는 아직 확인하지 않았습니다.

rePIU v0.0.162

Changes since v0.0.161. This is the first stage of the Linux port: the platform-neutral core
and its probes build as i386 on Linux and pass there. Windows behavior is unchanged, and no game
runs on Linux yet.

Measurement decided the plan

Of 192 sources, 53 are the platform-neutral core and 76 are the Win32 layer. The core includes no
Win32 header, uses no MSVC-specific construct, assumes no 32-bit pointer, and compiles under GCC 13
with C++20 without a single error — it moved to Linux unmodified. The Win32 layer is a different
size of problem: 270 CONTEXT uses, 47 VirtualProtect calls, and 28 fs:[...] assembly sites,
which is the scale of the execution-engine port still ahead.

Build structure

The Win32 sources and Windows-only executables moved behind if(WIN32) inside the existing
targets, so Windows output and linkage are untouched. A new repiu_core_probe gathers the nine
platform-independent probes and builds on both systems; the two runs produce byte-identical
46-line output, which is the point — not that it passed, but that the same code behaves the same
in both environments. scripts/build_linux_i386.sh checks the 32-bit toolchain before configuring
and names the packages to install when it is missing. The architecture is i386 because the guest's
32-bit code runs natively in the host process, the same reason the Win32 host is a 32-bit process.

Fixed

nvram_path_probe used MSVC's _putenv; POSIX spells this setenv and unsetenv and removes a
variable differently. Nothing of the kind appeared in the 53 core sources.

Known limitations

The execution engine, loader, and launcher remain Windows-only, so no game runs on Linux. SDL3
refuses to configure without X11 or Wayland development packages, so this stage — which opens no
window — takes SDL's documented headless option; the stage that brings the launcher over will need
the real desktop packages. repiu_chd_cd_probe and repiu_glide_issue_probe were left unguarded
because they reference no Win32 symbol, but their Linux builds have not been checked.