Renders on PSP

This commit is contained in:
2026-06-19 21:47:50 -05:00
parent 1f67e817ae
commit 9ad481d8f3
18 changed files with 290 additions and 351 deletions
+26 -54
View File
@@ -18,7 +18,6 @@ ENV PATH="${YAUL_INSTALL_ROOT}/bin:${PATH}"
# Toolchain source versions
ARG BINUTILS_VER=2.40
ARG GCC_VER=12.3.0
ARG NEWLIB_VER=4.3.0.20230120
# ---------------------------------------------------------------------------
# 1. Host build tools
@@ -51,11 +50,9 @@ RUN mkdir -p "${YAUL_INSTALL_ROOT}"
RUN cd /tmp && \
wget -q "https://ftp.gnu.org/gnu/binutils/binutils-${BINUTILS_VER}.tar.xz" && \
wget -q "https://ftp.gnu.org/gnu/gcc/gcc-${GCC_VER}/gcc-${GCC_VER}.tar.xz" && \
wget -q "ftp://sourceware.org/pub/newlib/newlib-${NEWLIB_VER}.tar.gz" && \
tar xf "binutils-${BINUTILS_VER}.tar.xz" && \
tar xf "gcc-${GCC_VER}.tar.xz" && \
tar xf "newlib-${NEWLIB_VER}.tar.gz" && \
rm "binutils-${BINUTILS_VER}.tar.xz" "gcc-${GCC_VER}.tar.xz" "newlib-${NEWLIB_VER}.tar.gz"
rm "binutils-${BINUTILS_VER}.tar.xz" "gcc-${GCC_VER}.tar.xz"
# Download GCC prerequisites (gmp, mpfr, mpc if not packaged)
RUN cd /tmp/gcc-${GCC_VER} && contrib/download_prerequisites
@@ -98,35 +95,10 @@ RUN mkdir -p /tmp/build-sh-gcc1 && cd /tmp/build-sh-gcc1 && \
&& make install-gcc install-target-libgcc && \
rm -rf /tmp/build-sh-gcc1
# ---------------------------------------------------------------------------
# 5. newlib for sh2eb-elf (C runtime for embedded SH-2)
# ---------------------------------------------------------------------------
RUN mkdir -p /tmp/build-sh-newlib && cd /tmp/build-sh-newlib && \
/tmp/newlib-${NEWLIB_VER}/configure \
--target=sh2eb-elf \
--prefix="${YAUL_INSTALL_ROOT}" \
--disable-newlib-supplied-syscalls \
--enable-newlib-reent-small \
&& make -j"$(nproc)" && make install && \
rm -rf /tmp/build-sh-newlib
# ---------------------------------------------------------------------------
# 6. sh2eb-elf GCC stage 2 (full build with newlib)
# ---------------------------------------------------------------------------
RUN mkdir -p /tmp/build-sh-gcc2 && cd /tmp/build-sh-gcc2 && \
/tmp/gcc-${GCC_VER}/configure \
--target=sh2eb-elf \
--prefix="${YAUL_INSTALL_ROOT}" \
--enable-languages=c,c++ \
--with-newlib \
--disable-nls \
--disable-shared \
--disable-multilib \
--disable-libssp \
--disable-libgomp \
--disable-libquadmath \
&& make -j"$(nproc)" && make install && \
rm -rf /tmp/build-sh-gcc2
# Newlib does not recognise the sh2eb CPU name, and Yaul ships its own C
# runtime in libyaul/libc/ anyway. Stage 1 (compiler + libgcc) is all
# we need; Yaul's specs file overrides *startfile:/*endfile:/*lib: to empty
# so nothing from a host C library is linked in.
# ---------------------------------------------------------------------------
# 7. m68k-elf binutils (Saturn 68EC000 sound CPU)
@@ -159,7 +131,7 @@ RUN mkdir -p /tmp/build-m68k-gcc && cd /tmp/build-m68k-gcc && \
rm -rf /tmp/build-m68k-gcc
# Clean up source tarballs/trees
RUN rm -rf /tmp/binutils-${BINUTILS_VER} /tmp/gcc-${GCC_VER} /tmp/newlib-${NEWLIB_VER}
RUN rm -rf /tmp/binutils-${BINUTILS_VER} /tmp/gcc-${GCC_VER}
# ---------------------------------------------------------------------------
# 9. Create m68keb-elf symlinks
@@ -189,25 +161,11 @@ RUN git clone --depth 1 --recurse-submodules \
rm -rf /tmp/yaul /tmp/yaul-build
# ---------------------------------------------------------------------------
# 11. Cross-compile zlib for sh2eb-elf
# Install into ${YAUL_INSTALL_ROOT}/sh2eb-elf/ to match the Yaul sysroot
# layout: headers at .../sh2eb-elf/include, libs at .../sh2eb-elf/lib.
# ---------------------------------------------------------------------------
RUN wget -q https://zlib.net/zlib-1.3.1.tar.gz -O /tmp/zlib.tar.gz && \
tar xf /tmp/zlib.tar.gz -C /tmp && \
cd /tmp/zlib-1.3.1 && \
CC="${YAUL_INSTALL_ROOT}/bin/sh2eb-elf-gcc" \
AR="${YAUL_INSTALL_ROOT}/bin/sh2eb-elf-ar" \
RANLIB="${YAUL_INSTALL_ROOT}/bin/sh2eb-elf-ranlib" \
CFLAGS="-m2 -mb -fno-builtin -O2" \
./configure \
--prefix="${YAUL_INSTALL_ROOT}/sh2eb-elf" \
--static \
&& make -j"$(nproc)" && make install && \
rm -rf /tmp/zlib-1.3.1 /tmp/zlib.tar.gz
# ---------------------------------------------------------------------------
# 12. Cross-compile libzip for sh2eb-elf
# 11. Cross-compile zlib for sh2eb-elf via CMake
# Using CMake (not ./configure) so we can set
# CMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY and skip link tests that
# the bare-metal cross-compiler can't satisfy.
# Install into ${YAUL_INSTALL_ROOT}/sh2eb-elf/ (Yaul sysroot layout).
# ---------------------------------------------------------------------------
RUN printf '%s\n' \
'set(CMAKE_SYSTEM_NAME Generic)' \
@@ -221,6 +179,20 @@ RUN printf '%s\n' \
'set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)' \
> /tmp/sat-xc.cmake
RUN wget -q https://zlib.net/zlib-1.3.1.tar.gz -O /tmp/zlib.tar.gz && \
tar xf /tmp/zlib.tar.gz -C /tmp && \
cmake -S /tmp/zlib-1.3.1 -B /tmp/zlib-build \
-DCMAKE_TOOLCHAIN_FILE=/tmp/sat-xc.cmake \
-DCMAKE_INSTALL_PREFIX="${YAUL_INSTALL_ROOT}/sh2eb-elf" \
-DCMAKE_C_FLAGS="-m2 -mb -fno-builtin -O2" \
-DBUILD_SHARED_LIBS=OFF \
&& cmake --build /tmp/zlib-build -- -j"$(nproc)" \
&& cmake --install /tmp/zlib-build \
&& rm -rf /tmp/zlib-1.3.1 /tmp/zlib.tar.gz /tmp/zlib-build
# ---------------------------------------------------------------------------
# 12. Cross-compile libzip for sh2eb-elf (reuses /tmp/sat-xc.cmake above)
# ---------------------------------------------------------------------------
RUN wget -q https://libzip.org/download/libzip-1.10.1.tar.gz -O /tmp/libzip.tar.gz && \
tar xf /tmp/libzip.tar.gz -C /tmp && \
cmake -S /tmp/libzip-1.10.1 -B /tmp/libzip-build \
@@ -242,7 +214,7 @@ RUN wget -q https://libzip.org/download/libzip-1.10.1.tar.gz -O /tmp/libzip.tar.
-DBUILD_TOOLS=OFF \
&& cmake --build /tmp/libzip-build -- -j"$(nproc)" \
&& cmake --install /tmp/libzip-build \
&& rm -rf /tmp/libzip-1.10.1 /tmp/libzip.tar.gz /tmp/libzip-build /tmp/sat-xc.cmake
&& rm -rf /tmp/libzip-1.10.1 /tmp/libzip.tar.gz /tmp/libzip-build /tmp/sat-xc.cmake /tmp/zlib.tar.gz 2>/dev/null || true
WORKDIR /workdir
VOLUME ["/workdir"]