From 759a657304432be17c97d0ea2e86487523b569f6 Mon Sep 17 00:00:00 2001 From: Un1q32 Date: Sun, 22 Feb 2026 17:39:25 -0500 Subject: [PATCH 01/24] ppc macos --- platforms/ios/build.sh | 6 ++--- platforms/macos/build.sh | 50 ++++++++++++++++++++++++++++++++++++---- 2 files changed, 49 insertions(+), 7 deletions(-) diff --git a/platforms/ios/build.sh b/platforms/ios/build.sh index 948d76ada..f16c1343e 100755 --- a/platforms/ios/build.sh +++ b/platforms/ios/build.sh @@ -124,10 +124,10 @@ if [ -n "$outdated_toolchain" ]; then mv ld64/src/ld/ld ../../toolchain/bin/ld64.ld64 make -C libmacho -j"$ncpus" make -C libstuff -j"$ncpus" - make -C misc strip lipo + make -C misc strip lipo -j"$ncpus" strip misc/strip misc/lipo - cp misc/strip ../../toolchain/bin/cctools-strip - cp misc/lipo ../../toolchain/bin/lipo + mv misc/strip ../../toolchain/bin/cctools-strip + mv misc/lipo ../../toolchain/bin/lipo cd ../.. rm -rf "cctools-port-$cctools_commit" diff --git a/platforms/macos/build.sh b/platforms/macos/build.sh index 383cd67ab..836672181 100755 --- a/platforms/macos/build.sh +++ b/platforms/macos/build.sh @@ -149,7 +149,7 @@ if [ -n "$outdated_toolchain" ]; then cctools_commit=12e2486bc81c3b2be975d3e117a9d3ab6ec3970c rm -rf cctools-port-* - wget -O- "https://github.com/Un1q32/cctools-port/archive/$cctools_commit.tar.gz" | tar -xz + wget -O- "https://github.com/tpoechtrager/cctools-port/archive/$cctools_commit.tar.gz" | tar -xz cd "cctools-port-$cctools_commit/cctools" ./configure \ @@ -163,10 +163,10 @@ if [ -n "$outdated_toolchain" ]; then mv ld64/src/ld/ld ../../toolchain/bin/ld64.ld64 make -C libmacho -j"$ncpus" make -C libstuff -j"$ncpus" - make -C misc strip lipo + make -C misc strip lipo -j"$ncpus" strip misc/strip misc/lipo - cp misc/strip ../../toolchain/bin/cctools-strip - cp misc/lipo ../../toolchain/bin/lipo + mv misc/strip ../../toolchain/bin/cctools-strip + mv misc/lipo ../../toolchain/bin/lipo cd ../.. rm -rf "cctools-port-$cctools_commit" @@ -188,6 +188,48 @@ if [ -n "$outdated_toolchain" ]; then printf '%s' "$toolchainver" > toolchain/toolchainver fi +# Increase this if we ever make a change to the toolchain, for example +# using a newer GCC version, and we need to invalidate the cache. +ppctoolchainver=1 +if [ "$(cat toolchain-ppc/toolchainver 2>/dev/null)" != "$ppctoolchainver" ]; then + rm -rf toolchain-ppc + mkdir -p toolchain-ppc/bin + + cctools_commit=3fc7881e3e7fd2bc073d4f3121ce99e5e5ae36b1 + rm -rf cctools-port-* + wget -O- "https://github.com/Un1q32/cctools-port/archive/$cctools_commit.tar.gz" | tar -xz + + cd "cctools-port-$cctools_commit/cctools" + ./autogen.sh + ./configure \ + --enable-silent-rules \ + CC=remcpe-clang \ + CXX=remcpe-clang++ + make -C ld64 -j"$ncpus" + strip ld64/src/ld/ld + mv ld64/src/ld/ld ../../toolchain-ppc/bin/ld64.ppc + cd ../.. + rm -rf "cctools-port-$cctools_commit" + + gcc_version='15.2.0' + rm -rf gcc-* + wget -O- "https://ftp.gnu.org/gnu/gcc/gcc-$gcc_version/gcc-$gcc_version.tar.xz" | tar -xz + + cd "gcc-$gcc_version" + mkdir build + cd build + ../configure \ + --prefix="$workdir/toolchain-ppc" \ + --target=powerpc-apple-darwin8 \ + --enable-languages=c,c++ + make -j"$ncpus" + make -j"$ncpus" install + cd ../.. + rm -rf "gcc-$gcc_version" + + printf '%s' "$ppctoolchainver" > toolchain-ppc/toolchainver +fi + # checks if the linker we build successfully linked with LLVM and supports LTO, # and enables LTO in the cmake build if it does. if [ -z "$DEBUG" ]; then From 4f3cffde1e891d14fb4d54af825434d18ce4d218 Mon Sep 17 00:00:00 2001 From: Un1q32 Date: Sun, 22 Feb 2026 17:43:12 -0500 Subject: [PATCH 02/24] fix --- platforms/macos/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platforms/macos/build.sh b/platforms/macos/build.sh index 836672181..df4c09c1e 100755 --- a/platforms/macos/build.sh +++ b/platforms/macos/build.sh @@ -213,7 +213,7 @@ if [ "$(cat toolchain-ppc/toolchainver 2>/dev/null)" != "$ppctoolchainver" ]; th gcc_version='15.2.0' rm -rf gcc-* - wget -O- "https://ftp.gnu.org/gnu/gcc/gcc-$gcc_version/gcc-$gcc_version.tar.xz" | tar -xz + wget -O- "https://ftp.gnu.org/gnu/gcc/gcc-$gcc_version/gcc-$gcc_version.tar.xz" | tar -xJ cd "gcc-$gcc_version" mkdir build From e028fedc522f68ade1b426b3ecffda891c9ac8bc Mon Sep 17 00:00:00 2001 From: Un1q32 Date: Sun, 22 Feb 2026 19:47:22 -0500 Subject: [PATCH 03/24] working gcc --- platforms/macos/build.sh | 75 +++++++++++++++++++++++----------------- 1 file changed, 44 insertions(+), 31 deletions(-) diff --git a/platforms/macos/build.sh b/platforms/macos/build.sh index df4c09c1e..98a07d011 100755 --- a/platforms/macos/build.sh +++ b/platforms/macos/build.sh @@ -66,24 +66,6 @@ else ncpus="$(sysctl -n hw.ncpu)" fi -if [ "$(uname -s)" = "Darwin" ]; then - ar="${AR:-ar}" - ranlib="${RANLIB:-ranlib}" - strip='strip' -else - ar="${AR:-"llvm-ar"}" - ranlib="${RANLIB:-"llvm-ranlib"}" - strip='cctools-strip' -fi - -for var in ar ranlib; do - dep="$(eval "echo \$$var")" - if ! command -v "$dep" >/dev/null; then - printf '%s not found!\n' "$dep" - exit 1 - fi -done - for dep in "${CLANG:-clang}" make cmake; do if ! command -v "$dep" >/dev/null; then printf '%s not found!\n' "$dep" @@ -101,7 +83,7 @@ fi # Increase this if we ever make a change to the toolchain, for example # using a newer cctools-port version, and we need to invalidate the cache. -toolchainver=1 +toolchainver=2 if [ "$(cat toolchain/toolchainver 2>/dev/null)" != "$toolchainver" ]; then rm -rf toolchain outdated_toolchain=1 @@ -116,7 +98,7 @@ fi mkdir -p toolchain/bin mv toolchainsettings toolchain/lasttoolchainsettings -export PATH="$PWD/toolchain/bin:$PATH" +export PATH="$PWD/toolchain/bin:$PWD/toolchain-ppc/bin:$PATH" if [ -n "$CLANG" ]; then ln -sf "$(command -v "$CLANG")" toolchain/bin/clang && ln -sf clang toolchain/bin/clang++ @@ -163,10 +145,12 @@ if [ -n "$outdated_toolchain" ]; then mv ld64/src/ld/ld ../../toolchain/bin/ld64.ld64 make -C libmacho -j"$ncpus" make -C libstuff -j"$ncpus" - make -C misc strip lipo -j"$ncpus" - strip misc/strip misc/lipo + make -C misc strip lipo ranlib -j"$ncpus" + strip misc/strip misc/lipo misc/ranlib mv misc/strip ../../toolchain/bin/cctools-strip mv misc/lipo ../../toolchain/bin/lipo + mv misc/ranlib ../../toolchain/bin/cctools-ranlib + cd ../.. rm -rf "cctools-port-$cctools_commit" @@ -188,13 +172,24 @@ if [ -n "$outdated_toolchain" ]; then printf '%s' "$toolchainver" > toolchain/toolchainver fi +# The PPC toolchain is separate from the regular toolchain because +# it doesn't use llvm for LTO, so it doesn't get invalidated when llvm-config's +# version changes + # Increase this if we ever make a change to the toolchain, for example # using a newer GCC version, and we need to invalidate the cache. ppctoolchainver=1 +ppc_triple='powerpc-apple-darwin8' if [ "$(cat toolchain-ppc/toolchainver 2>/dev/null)" != "$ppctoolchainver" ]; then rm -rf toolchain-ppc mkdir -p toolchain-ppc/bin + ln -s ../../toolchain/bin/cctools-ranlib "toolchain-ppc/bin/$ppc_triple-ranlib" + ln -s ../../toolchain/bin/lipo "toolchain-ppc/bin/$ppc_triple-lipo" + # building the real dsymutil would require a partial LLVM build, we don't need debug info that bad + printf '#!/bin/sh\nexit 0\n' > "toolchain-ppc/bin/$ppc_triple-dsymutil" + chmod +x "toolchain-ppc/bin/$ppc_triple-dsymutil" + cctools_commit=3fc7881e3e7fd2bc073d4f3121ce99e5e5ae36b1 rm -rf cctools-port-* wget -O- "https://github.com/Un1q32/cctools-port/archive/$cctools_commit.tar.gz" | tar -xz @@ -202,12 +197,26 @@ if [ "$(cat toolchain-ppc/toolchainver 2>/dev/null)" != "$ppctoolchainver" ]; th cd "cctools-port-$cctools_commit/cctools" ./autogen.sh ./configure \ + --target="$ppc_triple" \ --enable-silent-rules \ + --with-llvm-config=false \ CC=remcpe-clang \ CXX=remcpe-clang++ make -C ld64 -j"$ncpus" strip ld64/src/ld/ld - mv ld64/src/ld/ld ../../toolchain-ppc/bin/ld64.ppc + mv ld64/src/ld/ld "../../toolchain-ppc/bin/$ppc_triple-ld" + make -C libstuff -j"$ncpus" + make -C misc nm -j"$ncpus" + strip misc/nm + mv misc/nm "../../toolchain-ppc/bin/$ppc_triple-nm" + make -C as/ppc -j"$ncpus" + strip as/ppc/ppc-as + mv as/ppc/ppc-as "../../toolchain-ppc/bin/$ppc_triple-as" + make -C ar -j"$ncpus" + strip ar/ar + mv ar/ar "../../toolchain-ppc/bin/$ppc_triple-ar" + ln -s "$ppc_triple-ar" ../../toolchain-ppc/bin/cctools-ar + cd ../.. rm -rf "cctools-port-$cctools_commit" @@ -220,8 +229,12 @@ if [ "$(cat toolchain-ppc/toolchainver 2>/dev/null)" != "$ppctoolchainver" ]; th cd build ../configure \ --prefix="$workdir/toolchain-ppc" \ - --target=powerpc-apple-darwin8 \ - --enable-languages=c,c++ + --target="$ppc_triple" \ + --disable-multilib \ + --enable-lto \ + --enable-languages=c,c++,objc,lto \ + --with-sysroot="$old_sdk" \ + --with-as="$(command -v "$ppc_triple-as")" make -j"$ncpus" make -j"$ncpus" install cd ../.. @@ -295,8 +308,8 @@ for target in $targets; do CFLAGS="$opt $cflags" \ CXXFLAGS="$opt $cflags" \ CPPFLAGS='-DNDEBUG' \ - AR="$ar" \ - RANLIB="$ranlib" + AR=cctools-ar \ + RANLIB=cctools-ranlib make -j"$ncpus" make install -j"$ncpus" cd .. @@ -332,8 +345,8 @@ for target in $targets; do -DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ONLY \ -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY \ -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY \ - -DCMAKE_AR="$(command -v "$ar")" \ - -DCMAKE_RANLIB="$(command -v "$ranlib")" \ + -DCMAKE_AR="$(command -v cctools-ar)" \ + -DCMAKE_RANLIB="$(command -v cctools-ranlib)" \ -DCMAKE_C_COMPILER="$platformdir/macos-cc" \ -DCMAKE_CXX_COMPILER="$platformdir/macos-c++" \ -DCMAKE_FIND_ROOT_PATH="$REMCPE_SDK/usr;$PWD/sdl" \ @@ -364,7 +377,7 @@ REMCPE_TARGET='unknown-apple-macos10.4' \ lipo -create arch-* -output arch mv arch ../ReMCPE/libexec/arch [ -z "$DEBUG" ] && [ -z "$NOSTRIP" ] && - "$strip" -no_code_signature_warning ../ReMCPE/libexec/arch + cctools-strip -no_code_signature_warning ../ReMCPE/libexec/arch cp -a "$platformdir/../../game/assets" ../ReMCPE cp "$platformdir/launchscript.sh" "../ReMCPE/$bin" @@ -372,7 +385,7 @@ cp "$platformdir/launchscript.sh" "../ReMCPE/$bin" for target in $targets; do cp "build-$target/$bin" "../ReMCPE/libexec/$bin-${target%%-*}" [ -z "$DEBUG" ] && [ -z "$NOSTRIP" ] && - "$strip" -no_code_signature_warning "../ReMCPE/libexec/$bin-${target%%-*}" + cctools-strip -no_code_signature_warning "../ReMCPE/libexec/$bin-${target%%-*}" done if command -v ldid >/dev/null; then ldid -S ../ReMCPE/libexec/arch "../ReMCPE/libexec/$bin-arm64"* From 9c992f2817b12b62b77e1aa36aa2b69a4a607141 Mon Sep 17 00:00:00 2001 From: Un1q32 Date: Sun, 22 Feb 2026 21:11:13 -0500 Subject: [PATCH 04/24] yea --- platforms/macos/arch.c | 6 +- platforms/macos/build.sh | 78 ++++++++++++++++------- source/world/entity/SynchedEntityData.cpp | 4 ++ 3 files changed, 63 insertions(+), 25 deletions(-) diff --git a/platforms/macos/arch.c b/platforms/macos/arch.c index aea8064dd..1c1cc84f5 100644 --- a/platforms/macos/arch.c +++ b/platforms/macos/arch.c @@ -9,10 +9,12 @@ int main(void) { puts("i386"); #elif defined(__aarch64__) puts("arm64"); -#elif defined(__powerpc64__) +#elif defined(__POWERPC__) +#ifdef __LP64__ puts("ppc64"); -#elif defined(__powerpc__) +#else puts("powerpc"); +#endif #else #error unknown mac architecture #endif diff --git a/platforms/macos/build.sh b/platforms/macos/build.sh index 98a07d011..7f8d96253 100755 --- a/platforms/macos/build.sh +++ b/platforms/macos/build.sh @@ -5,7 +5,7 @@ set -e [ "${0%/*}" = "$0" ] && scriptroot="." || scriptroot="${0%/*}" cd "$scriptroot" -# TODO: powerpc +# powerpc is handled further down targets='i386-apple-macos10.4 x86_64-apple-macos10.7 arm64-apple-macos11.0' # Must be kept in sync with the cmake executable name bin='reminecraftpe' @@ -131,13 +131,14 @@ if [ -n "$outdated_toolchain" ]; then cctools_commit=12e2486bc81c3b2be975d3e117a9d3ab6ec3970c rm -rf cctools-port-* - wget -O- "https://github.com/tpoechtrager/cctools-port/archive/$cctools_commit.tar.gz" | tar -xz + wget -O- "https://github.com/Un1q32/cctools-port/archive/$cctools_commit.tar.gz" | tar -xz cd "cctools-port-$cctools_commit/cctools" ./configure \ --enable-silent-rules \ --with-llvm-config="$LLVM_CONFIG" \ --with-libtapi="$workdir/toolchain" \ + --target=i386-apple-darwin \ CC=remcpe-clang \ CXX=remcpe-clang++ make -C ld64 -j"$ncpus" @@ -150,6 +151,10 @@ if [ -n "$outdated_toolchain" ]; then mv misc/strip ../../toolchain/bin/cctools-strip mv misc/lipo ../../toolchain/bin/lipo mv misc/ranlib ../../toolchain/bin/cctools-ranlib + ln -s cctools-ranlib ../../toolchain/bin/i386-apple-darwin-ranlib # so ar can find ranlib + make -C ar + strip ar/ar + mv ar/ar ../../toolchain/bin/cctools-ar cd ../.. rm -rf "cctools-port-$cctools_commit" @@ -180,10 +185,12 @@ fi # using a newer GCC version, and we need to invalidate the cache. ppctoolchainver=1 ppc_triple='powerpc-apple-darwin8' +targets="$targets $ppc_triple" if [ "$(cat toolchain-ppc/toolchainver 2>/dev/null)" != "$ppctoolchainver" ]; then rm -rf toolchain-ppc mkdir -p toolchain-ppc/bin + ln -s ../../toolchain/bin/cctools-ar "toolchain-ppc/bin/$ppc_triple-ar" ln -s ../../toolchain/bin/cctools-ranlib "toolchain-ppc/bin/$ppc_triple-ranlib" ln -s ../../toolchain/bin/lipo "toolchain-ppc/bin/$ppc_triple-lipo" # building the real dsymutil would require a partial LLVM build, we don't need debug info that bad @@ -192,7 +199,7 @@ if [ "$(cat toolchain-ppc/toolchainver 2>/dev/null)" != "$ppctoolchainver" ]; th cctools_commit=3fc7881e3e7fd2bc073d4f3121ce99e5e5ae36b1 rm -rf cctools-port-* - wget -O- "https://github.com/Un1q32/cctools-port/archive/$cctools_commit.tar.gz" | tar -xz + wget -O- "https://github.com/tpoechtrager/cctools-port/archive/$cctools_commit.tar.gz" | tar -xz cd "cctools-port-$cctools_commit/cctools" ./autogen.sh @@ -206,16 +213,13 @@ if [ "$(cat toolchain-ppc/toolchainver 2>/dev/null)" != "$ppctoolchainver" ]; th strip ld64/src/ld/ld mv ld64/src/ld/ld "../../toolchain-ppc/bin/$ppc_triple-ld" make -C libstuff -j"$ncpus" - make -C misc nm -j"$ncpus" - strip misc/nm + make -C misc nm strip -j"$ncpus" + strip misc/nm misc/strip mv misc/nm "../../toolchain-ppc/bin/$ppc_triple-nm" + mv misc/strip ../../toolchain/bin/ppc-strip make -C as/ppc -j"$ncpus" strip as/ppc/ppc-as mv as/ppc/ppc-as "../../toolchain-ppc/bin/$ppc_triple-as" - make -C ar -j"$ncpus" - strip ar/ar - mv ar/ar "../../toolchain-ppc/bin/$ppc_triple-ar" - ln -s "$ppc_triple-ar" ../../toolchain-ppc/bin/cctools-ar cd ../.. rm -rf "cctools-port-$cctools_commit" @@ -277,9 +281,17 @@ for target in $targets; do cd "build-$target" arch="${target%%-*}" + cc="$platformdir/macos-cc" + cxx="$platformdir/macos-c++" case $arch in - (i386) - target_cflags="$cflags -march=pentium-m" + (i386|powerpc*) + if [ "$arch" = 'i386' ]; then + target_cflags="$cflags -march=pentium-m" + else + target_cflags= + cc="$ppc_triple-gcc" + cxx="$ppc_triple-g++" + fi export REMCPE_SDK="$old_sdk" set -- -DCMAKE_EXE_LINKER_FLAGS='-framework IOKit -framework Carbon -framework AudioUnit -undefined dynamic_lookup' platform='sdl1' @@ -296,18 +308,27 @@ for target in $targets; do if [ -n "$DEBUG" ]; then opt='-O0' else - opt='-O2' + if [ "$arch" = 'i386' ]; then + opt='-O2' + else + opt='-O2 -flto' + fi + fi + if [ "$arch" != 'i386' ]; then + sed -e 's/-fpascal-strings//g' configure > configure.patched + mv configure.patched configure + chmod +x configure fi ./configure \ --host="$arch-apple-darwin" \ --prefix="${PWD%/*}/sdl" \ --disable-shared \ --disable-video-x11 \ - CC="$platformdir/macos-cc" \ - CXX="$platformdir/macos-c++" \ - CFLAGS="$opt $cflags" \ - CXXFLAGS="$opt $cflags" \ - CPPFLAGS='-DNDEBUG' \ + CC="$cc" \ + CXX="$cxx" \ + CFLAGS="$opt $target_cflags" \ + CXXFLAGS="$opt $target_cflags" \ + CPPFLAGS='-DNDEBUG -D__DARWIN_UNIX03=1' \ AR=cctools-ar \ RANLIB=cctools-ranlib make -j"$ncpus" @@ -347,8 +368,8 @@ for target in $targets; do -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY \ -DCMAKE_AR="$(command -v cctools-ar)" \ -DCMAKE_RANLIB="$(command -v cctools-ranlib)" \ - -DCMAKE_C_COMPILER="$platformdir/macos-cc" \ - -DCMAKE_CXX_COMPILER="$platformdir/macos-c++" \ + -DCMAKE_C_COMPILER="$cc" \ + -DCMAKE_CXX_COMPILER="$cxx" \ -DCMAKE_FIND_ROOT_PATH="$REMCPE_SDK/usr;$PWD/sdl" \ -DCMAKE_SYSROOT="$REMCPE_SDK" \ -DCMAKE_C_FLAGS="$target_cflags" \ @@ -374,18 +395,29 @@ REMCPE_TARGET='unknown-apple-macos10.4' \ -arch x86_64 -arch i386 \ "$platformdir/arch.c" -Os -o arch-x86 +rm -f arch-ppc lipo -create arch-* -output arch -mv arch ../ReMCPE/libexec/arch [ -z "$DEBUG" ] && [ -z "$NOSTRIP" ] && - cctools-strip -no_code_signature_warning ../ReMCPE/libexec/arch + cctools-strip -no_code_signature_warning arch + +"$ppc_triple-gcc" "$platformdir/arch.c" -Os -o arch-ppc +[ -z "$DEBUG" ] && [ -z "$NOSTRIP" ] && + ppc-strip arch-ppc + +lipo -create arch arch-ppc -output ../ReMCPE/libexec/arch cp -a "$platformdir/../../game/assets" ../ReMCPE cp "$platformdir/launchscript.sh" "../ReMCPE/$bin" for target in $targets; do - cp "build-$target/$bin" "../ReMCPE/libexec/$bin-${target%%-*}" + arch="${target%%-*}" + cp "build-$target/$bin" "../ReMCPE/libexec/$bin-$arch" + case $arch in + (powerpc*|ppc*) strip='ppc-strip' ;; + (*) strip='cctools-strip -no_code_signature_warning' ;; + esac [ -z "$DEBUG" ] && [ -z "$NOSTRIP" ] && - cctools-strip -no_code_signature_warning "../ReMCPE/libexec/$bin-${target%%-*}" + $strip "../ReMCPE/libexec/$bin-${target%%-*}" done if command -v ldid >/dev/null; then ldid -S ../ReMCPE/libexec/arch "../ReMCPE/libexec/$bin-arm64"* diff --git a/source/world/entity/SynchedEntityData.cpp b/source/world/entity/SynchedEntityData.cpp index 9f82b6d5b..54ec19f94 100644 --- a/source/world/entity/SynchedEntityData.cpp +++ b/source/world/entity/SynchedEntityData.cpp @@ -1,4 +1,8 @@ #include +// stupid ppc gcc bullshit idk how to fix +#ifndef UINT16_MAX +#define UINT16_MAX 65535 +#endif #include "SynchedEntityData.hpp" From bc164322afde98466244045f3ac0793d00505326 Mon Sep 17 00:00:00 2001 From: Un1q32 Date: Sun, 22 Feb 2026 21:32:33 -0500 Subject: [PATCH 05/24] fix --- platforms/macos/build.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/platforms/macos/build.sh b/platforms/macos/build.sh index 7f8d96253..63b0534f6 100755 --- a/platforms/macos/build.sh +++ b/platforms/macos/build.sh @@ -216,7 +216,7 @@ if [ "$(cat toolchain-ppc/toolchainver 2>/dev/null)" != "$ppctoolchainver" ]; th make -C misc nm strip -j"$ncpus" strip misc/nm misc/strip mv misc/nm "../../toolchain-ppc/bin/$ppc_triple-nm" - mv misc/strip ../../toolchain/bin/ppc-strip + mv misc/strip ../../toolchain-ppc/bin/ppc-strip make -C as/ppc -j"$ncpus" strip as/ppc/ppc-as mv as/ppc/ppc-as "../../toolchain-ppc/bin/$ppc_triple-as" @@ -287,13 +287,14 @@ for target in $targets; do (i386|powerpc*) if [ "$arch" = 'i386' ]; then target_cflags="$cflags -march=pentium-m" + set -- -DCMAKE_EXE_LINKER_FLAGS='-framework IOKit -framework Carbon -framework AudioUnit -undefined dynamic_lookup' else target_cflags= cc="$ppc_triple-gcc" cxx="$ppc_triple-g++" + set -- -DCMAKE_EXE_LINKER_FLAGS='-framework IOKit -framework Carbon -framework AudioUnit -static-libgcc' fi export REMCPE_SDK="$old_sdk" - set -- -DCMAKE_EXE_LINKER_FLAGS='-framework IOKit -framework Carbon -framework AudioUnit -undefined dynamic_lookup' platform='sdl1' sdl1ver=1 if ! [ -f sdl/lib/libSDL.a ] || [ "$(cat sdl/sdl1ver 2>/dev/null)" != "$sdl1ver" ]; then From e0ce98e9ba85c4d1749f4c20fba9a2d1866e25eb Mon Sep 17 00:00:00 2001 From: Un1q32 Date: Sun, 22 Feb 2026 21:38:33 -0500 Subject: [PATCH 06/24] bleh --- platforms/macos/build.sh | 11 ++--------- platforms/macos/launchscript.sh | 8 ++++++-- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/platforms/macos/build.sh b/platforms/macos/build.sh index 63b0534f6..05ddcbaf5 100755 --- a/platforms/macos/build.sh +++ b/platforms/macos/build.sh @@ -396,16 +396,9 @@ REMCPE_TARGET='unknown-apple-macos10.4' \ -arch x86_64 -arch i386 \ "$platformdir/arch.c" -Os -o arch-x86 -rm -f arch-ppc -lipo -create arch-* -output arch +lipo -create arch-* -output ../ReMCPE/libexec/arch [ -z "$DEBUG" ] && [ -z "$NOSTRIP" ] && - cctools-strip -no_code_signature_warning arch - -"$ppc_triple-gcc" "$platformdir/arch.c" -Os -o arch-ppc -[ -z "$DEBUG" ] && [ -z "$NOSTRIP" ] && - ppc-strip arch-ppc - -lipo -create arch arch-ppc -output ../ReMCPE/libexec/arch + cctools-strip -no_code_signature_warning ../ReMCPE/libexec/arch cp -a "$platformdir/../../game/assets" ../ReMCPE cp "$platformdir/launchscript.sh" "../ReMCPE/$bin" diff --git a/platforms/macos/launchscript.sh b/platforms/macos/launchscript.sh index d506632ba..4ff900e34 100755 --- a/platforms/macos/launchscript.sh +++ b/platforms/macos/launchscript.sh @@ -8,16 +8,20 @@ # from this script. execdir="${0%/*}" + +[ "$(arch)" = "ppc" ] && + exec "$execdir/libexec/reminecraftpe-powerpc" "$@" + arch="$("$execdir/libexec/arch")" if [ "$arch" = "x86_64" ]; then case $(uname -r) in (8.*|9.*|10.*) # Tiger, Leopard, or Snow Leopard - exec "$execdir/libexec/reminecraftpe-i386" + exec "$execdir/libexec/reminecraftpe-i386" "$@" ;; (*) - exec "$execdir/libexec/reminecraftpe-x86_64" + exec "$execdir/libexec/reminecraftpe-x86_64" "$@" ;; esac fi From e439ddcbad660701ced231ed3ac166958b1ba744 Mon Sep 17 00:00:00 2001 From: Un1q32 Date: Sun, 22 Feb 2026 21:40:42 -0500 Subject: [PATCH 07/24] yea --- .github/workflows/artifacts.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/artifacts.yml b/.github/workflows/artifacts.yml index 6f7da733b..dac1c72e3 100644 --- a/.github/workflows/artifacts.yml +++ b/.github/workflows/artifacts.yml @@ -154,7 +154,7 @@ jobs: run: | [ -f workspacecache.tar ] && tar xf workspacecache.tar || true LLVM_CONFIG="$(brew --prefix)/opt/llvm@21/bin/llvm-config" ./platforms/macos/build.sh - tar cf workspacecache.tar platforms/macos/build/work/toolchain + tar cf workspacecache.tar platforms/macos/build/work/toolchain platforms/macos/build/work/toolchain-ppc mv workspacecache.tar ~ env: NOSTRIP: 1 From f8ab5432bcad532c1fdbd94890d503449097b34d Mon Sep 17 00:00:00 2001 From: Un1q32 Date: Sun, 22 Feb 2026 21:43:00 -0500 Subject: [PATCH 08/24] add log --- platforms/macos/build.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/platforms/macos/build.sh b/platforms/macos/build.sh index 05ddcbaf5..48bd30996 100755 --- a/platforms/macos/build.sh +++ b/platforms/macos/build.sh @@ -187,6 +187,8 @@ ppctoolchainver=1 ppc_triple='powerpc-apple-darwin8' targets="$targets $ppc_triple" if [ "$(cat toolchain-ppc/toolchainver 2>/dev/null)" != "$ppctoolchainver" ]; then + printf '\nBuilding powerpc toolchain...\n\n' + rm -rf toolchain-ppc mkdir -p toolchain-ppc/bin From d7eec16c61c282569f1c6c59390aa9c3fcea9a42 Mon Sep 17 00:00:00 2001 From: Un1q32 Date: Sun, 22 Feb 2026 21:52:39 -0500 Subject: [PATCH 09/24] fix --- .github/workflows/artifacts.yml | 2 +- platforms/macos/build.sh | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/artifacts.yml b/.github/workflows/artifacts.yml index dac1c72e3..ac8f773a3 100644 --- a/.github/workflows/artifacts.yml +++ b/.github/workflows/artifacts.yml @@ -149,7 +149,7 @@ jobs: [ -f ccache.tar.xz ] && tar xf ccache.tar.xz || true [ -f workspacecache.tar ] && mv workspacecache.tar ${{ github.workspace }} || true - name: Install Dependencies - run: brew install llvm@21 ccache + run: brew install llvm@21 ccache gmp mpfr mpc - name: Build run: | [ -f workspacecache.tar ] && tar xf workspacecache.tar || true diff --git a/platforms/macos/build.sh b/platforms/macos/build.sh index 48bd30996..ba886df7f 100755 --- a/platforms/macos/build.sh +++ b/platforms/macos/build.sh @@ -238,6 +238,7 @@ if [ "$(cat toolchain-ppc/toolchainver 2>/dev/null)" != "$ppctoolchainver" ]; th --target="$ppc_triple" \ --disable-multilib \ --enable-lto \ + --with-system-zlib \ --enable-languages=c,c++,objc,lto \ --with-sysroot="$old_sdk" \ --with-as="$(command -v "$ppc_triple-as")" From 1f4e64b8b3959dd150f561940d1cf43ec5f83dfd Mon Sep 17 00:00:00 2001 From: Un1q32 Date: Sun, 22 Feb 2026 21:57:08 -0500 Subject: [PATCH 10/24] allow user to specify libs for gcc --- platforms/macos/build.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/platforms/macos/build.sh b/platforms/macos/build.sh index ba886df7f..e8961f450 100755 --- a/platforms/macos/build.sh +++ b/platforms/macos/build.sh @@ -233,6 +233,10 @@ if [ "$(cat toolchain-ppc/toolchainver 2>/dev/null)" != "$ppctoolchainver" ]; th cd "gcc-$gcc_version" mkdir build cd build + set -- + [ -n "$GMP" ] && set -- --with-gmp="$GMP" + [ -n "$MPFR" ] && set -- "$@" --with-mpfr="$MPFR" + [ -n "$MPC" ] && set -- "$@" --with-mpc="$MPC" ../configure \ --prefix="$workdir/toolchain-ppc" \ --target="$ppc_triple" \ @@ -241,7 +245,8 @@ if [ "$(cat toolchain-ppc/toolchainver 2>/dev/null)" != "$ppctoolchainver" ]; th --with-system-zlib \ --enable-languages=c,c++,objc,lto \ --with-sysroot="$old_sdk" \ - --with-as="$(command -v "$ppc_triple-as")" + --with-as="$(command -v "$ppc_triple-as")" \ + "$@" make -j"$ncpus" make -j"$ncpus" install cd ../.. From 95274212a8051714853aab3e57ad853b3c1c2753 Mon Sep 17 00:00:00 2001 From: Un1q32 Date: Sun, 22 Feb 2026 22:15:06 -0500 Subject: [PATCH 11/24] better --- platforms/macos/build.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/platforms/macos/build.sh b/platforms/macos/build.sh index e8961f450..daf9447db 100755 --- a/platforms/macos/build.sh +++ b/platforms/macos/build.sh @@ -192,9 +192,6 @@ if [ "$(cat toolchain-ppc/toolchainver 2>/dev/null)" != "$ppctoolchainver" ]; th rm -rf toolchain-ppc mkdir -p toolchain-ppc/bin - ln -s ../../toolchain/bin/cctools-ar "toolchain-ppc/bin/$ppc_triple-ar" - ln -s ../../toolchain/bin/cctools-ranlib "toolchain-ppc/bin/$ppc_triple-ranlib" - ln -s ../../toolchain/bin/lipo "toolchain-ppc/bin/$ppc_triple-lipo" # building the real dsymutil would require a partial LLVM build, we don't need debug info that bad printf '#!/bin/sh\nexit 0\n' > "toolchain-ppc/bin/$ppc_triple-dsymutil" chmod +x "toolchain-ppc/bin/$ppc_triple-dsymutil" @@ -246,6 +243,9 @@ if [ "$(cat toolchain-ppc/toolchainver 2>/dev/null)" != "$ppctoolchainver" ]; th --enable-languages=c,c++,objc,lto \ --with-sysroot="$old_sdk" \ --with-as="$(command -v "$ppc_triple-as")" \ + AR_FOR_TARGET="$(command -v cctools-ar)" \ + RANLIB_FOR_TARGET="$(command -v cctools-ranlib)" \ + LIPO_FOR_TARGET="$(command -v lipo)" \ "$@" make -j"$ncpus" make -j"$ncpus" install From f1b9364de301d890cbd6dd1e8b9cf39fc3ae3eb6 Mon Sep 17 00:00:00 2001 From: Un1q32 Date: Sun, 22 Feb 2026 22:19:22 -0500 Subject: [PATCH 12/24] nm --- platforms/macos/build.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/platforms/macos/build.sh b/platforms/macos/build.sh index daf9447db..2c3f1cbd0 100755 --- a/platforms/macos/build.sh +++ b/platforms/macos/build.sh @@ -214,7 +214,7 @@ if [ "$(cat toolchain-ppc/toolchainver 2>/dev/null)" != "$ppctoolchainver" ]; th make -C libstuff -j"$ncpus" make -C misc nm strip -j"$ncpus" strip misc/nm misc/strip - mv misc/nm "../../toolchain-ppc/bin/$ppc_triple-nm" + mv misc/nm ../../toolchain-ppc/bin/ppc-nm mv misc/strip ../../toolchain-ppc/bin/ppc-strip make -C as/ppc -j"$ncpus" strip as/ppc/ppc-as @@ -245,6 +245,7 @@ if [ "$(cat toolchain-ppc/toolchainver 2>/dev/null)" != "$ppctoolchainver" ]; th --with-as="$(command -v "$ppc_triple-as")" \ AR_FOR_TARGET="$(command -v cctools-ar)" \ RANLIB_FOR_TARGET="$(command -v cctools-ranlib)" \ + NM_FOR_TARGET="$(command -v cctools-nm)" \ LIPO_FOR_TARGET="$(command -v lipo)" \ "$@" make -j"$ncpus" From 1e020936307fbbb55698e5b3ea1849c62483a76e Mon Sep 17 00:00:00 2001 From: Un1q32 Date: Sun, 22 Feb 2026 22:25:42 -0500 Subject: [PATCH 13/24] fix --- platforms/macos/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platforms/macos/build.sh b/platforms/macos/build.sh index 2c3f1cbd0..f5d1d1845 100755 --- a/platforms/macos/build.sh +++ b/platforms/macos/build.sh @@ -245,7 +245,7 @@ if [ "$(cat toolchain-ppc/toolchainver 2>/dev/null)" != "$ppctoolchainver" ]; th --with-as="$(command -v "$ppc_triple-as")" \ AR_FOR_TARGET="$(command -v cctools-ar)" \ RANLIB_FOR_TARGET="$(command -v cctools-ranlib)" \ - NM_FOR_TARGET="$(command -v cctools-nm)" \ + NM_FOR_TARGET="$(command -v ppc-nm)" \ LIPO_FOR_TARGET="$(command -v lipo)" \ "$@" make -j"$ncpus" From 41a9e5e4babf98f8ad16f728f4f0454e530d1a3a Mon Sep 17 00:00:00 2001 From: Un1q32 Date: Sun, 22 Feb 2026 22:34:25 -0500 Subject: [PATCH 14/24] ld64 --- platforms/macos/build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platforms/macos/build.sh b/platforms/macos/build.sh index f5d1d1845..a19d93a2b 100755 --- a/platforms/macos/build.sh +++ b/platforms/macos/build.sh @@ -196,9 +196,9 @@ if [ "$(cat toolchain-ppc/toolchainver 2>/dev/null)" != "$ppctoolchainver" ]; th printf '#!/bin/sh\nexit 0\n' > "toolchain-ppc/bin/$ppc_triple-dsymutil" chmod +x "toolchain-ppc/bin/$ppc_triple-dsymutil" - cctools_commit=3fc7881e3e7fd2bc073d4f3121ce99e5e5ae36b1 + cctools_commit=a35aa0162cb2614e68db577a28fdd903fae47f20 rm -rf cctools-port-* - wget -O- "https://github.com/tpoechtrager/cctools-port/archive/$cctools_commit.tar.gz" | tar -xz + wget -O- "https://github.com/Un1q32/cctools-port/archive/$cctools_commit.tar.gz" | tar -xz cd "cctools-port-$cctools_commit/cctools" ./autogen.sh From 3febce3bbcccc42988b45c03a327d7a5ead0b5bc Mon Sep 17 00:00:00 2001 From: Un1q32 Date: Sun, 22 Feb 2026 22:34:43 -0500 Subject: [PATCH 15/24] not needed anymore --- platforms/macos/build.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/platforms/macos/build.sh b/platforms/macos/build.sh index a19d93a2b..8153088bf 100755 --- a/platforms/macos/build.sh +++ b/platforms/macos/build.sh @@ -201,7 +201,6 @@ if [ "$(cat toolchain-ppc/toolchainver 2>/dev/null)" != "$ppctoolchainver" ]; th wget -O- "https://github.com/Un1q32/cctools-port/archive/$cctools_commit.tar.gz" | tar -xz cd "cctools-port-$cctools_commit/cctools" - ./autogen.sh ./configure \ --target="$ppc_triple" \ --enable-silent-rules \ From db5f03b80ddc1e054c358ef40113c94c7f1c34f9 Mon Sep 17 00:00:00 2001 From: Un1q32 Date: Sun, 22 Feb 2026 22:45:06 -0500 Subject: [PATCH 16/24] generic names --- platforms/macos/build.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/platforms/macos/build.sh b/platforms/macos/build.sh index 8153088bf..4ef1b117a 100755 --- a/platforms/macos/build.sh +++ b/platforms/macos/build.sh @@ -217,7 +217,7 @@ if [ "$(cat toolchain-ppc/toolchainver 2>/dev/null)" != "$ppctoolchainver" ]; th mv misc/strip ../../toolchain-ppc/bin/ppc-strip make -C as/ppc -j"$ncpus" strip as/ppc/ppc-as - mv as/ppc/ppc-as "../../toolchain-ppc/bin/$ppc_triple-as" + mv as/ppc/ppc-as ../../toolchain-ppc/bin/ppc-as cd ../.. rm -rf "cctools-port-$cctools_commit" @@ -241,7 +241,7 @@ if [ "$(cat toolchain-ppc/toolchainver 2>/dev/null)" != "$ppctoolchainver" ]; th --with-system-zlib \ --enable-languages=c,c++,objc,lto \ --with-sysroot="$old_sdk" \ - --with-as="$(command -v "$ppc_triple-as")" \ + --with-as="$(command -v ppc-as)" \ AR_FOR_TARGET="$(command -v cctools-ar)" \ RANLIB_FOR_TARGET="$(command -v cctools-ranlib)" \ NM_FOR_TARGET="$(command -v ppc-nm)" \ @@ -298,8 +298,8 @@ for target in $targets; do set -- -DCMAKE_EXE_LINKER_FLAGS='-framework IOKit -framework Carbon -framework AudioUnit -undefined dynamic_lookup' else target_cflags= - cc="$ppc_triple-gcc" - cxx="$ppc_triple-g++" + cc="$target-gcc" + cxx="$target-g++" set -- -DCMAKE_EXE_LINKER_FLAGS='-framework IOKit -framework Carbon -framework AudioUnit -static-libgcc' fi export REMCPE_SDK="$old_sdk" From fbd5db3efdf4f957f222f47c3f807d5c7e58bc15 Mon Sep 17 00:00:00 2001 From: Un1q32 Date: Sun, 22 Feb 2026 22:58:51 -0500 Subject: [PATCH 17/24] generic names for generic tools --- platforms/macos/build.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/platforms/macos/build.sh b/platforms/macos/build.sh index 4ef1b117a..20147ea21 100755 --- a/platforms/macos/build.sh +++ b/platforms/macos/build.sh @@ -209,7 +209,7 @@ if [ "$(cat toolchain-ppc/toolchainver 2>/dev/null)" != "$ppctoolchainver" ]; th CXX=remcpe-clang++ make -C ld64 -j"$ncpus" strip ld64/src/ld/ld - mv ld64/src/ld/ld "../../toolchain-ppc/bin/$ppc_triple-ld" + mv ld64/src/ld/ld ../../toolchain-ppc/bin/ppc-ld make -C libstuff -j"$ncpus" make -C misc nm strip -j"$ncpus" strip misc/nm misc/strip @@ -242,6 +242,7 @@ if [ "$(cat toolchain-ppc/toolchainver 2>/dev/null)" != "$ppctoolchainver" ]; th --enable-languages=c,c++,objc,lto \ --with-sysroot="$old_sdk" \ --with-as="$(command -v ppc-as)" \ + --with-ld="$(command -v ppc-ld)" \ AR_FOR_TARGET="$(command -v cctools-ar)" \ RANLIB_FOR_TARGET="$(command -v cctools-ranlib)" \ NM_FOR_TARGET="$(command -v ppc-nm)" \ From ed3a5f064287a4404e54a042a907cf1dba405d58 Mon Sep 17 00:00:00 2001 From: Un1q32 Date: Sun, 22 Feb 2026 23:11:09 -0500 Subject: [PATCH 18/24] fix --- .github/workflows/artifacts.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/artifacts.yml b/.github/workflows/artifacts.yml index ac8f773a3..71de8afba 100644 --- a/.github/workflows/artifacts.yml +++ b/.github/workflows/artifacts.yml @@ -158,6 +158,9 @@ jobs: mv workspacecache.tar ~ env: NOSTRIP: 1 + GMP: /opt/homebrew + MPFR: /opt/homebrew + MPC: /opt/homebrew - uses: actions/upload-artifact@v6 with: name: macOS From 0c6f10dba7e0b17d74871ca2d9de36e0bb07da07 Mon Sep 17 00:00:00 2001 From: Un1q32 Date: Sun, 22 Feb 2026 23:13:05 -0500 Subject: [PATCH 19/24] envs --- .github/workflows/publish.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 3d8de6b08..627270b89 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -110,9 +110,13 @@ jobs: with: submodules: true - name: Install Dependencies - run: brew install llvm@21 + run: brew install llvm@21 gmp mpfr mpc - name: Build run: LLVM_CONFIG="$(brew --prefix)/opt/llvm@21/bin/llvm-config" ./platforms/macos/build.sh + env: + GMP: /opt/homebrew + MPFR: /opt/homebrew + MPC: /opt/homebrew - name: Pack release run: | mv platforms/macos/build/ReMCPE . From 73e6ec2367340eea9d2f093e5d6f4a91c5d71a28 Mon Sep 17 00:00:00 2001 From: Un1q32 Date: Sun, 22 Feb 2026 23:48:59 -0500 Subject: [PATCH 20/24] download cmake from official source to avoid segfault --- .github/workflows/artifacts.yml | 9 +++++++-- .github/workflows/publish.yml | 10 ++++++++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/.github/workflows/artifacts.yml b/.github/workflows/artifacts.yml index 71de8afba..952be1d7e 100644 --- a/.github/workflows/artifacts.yml +++ b/.github/workflows/artifacts.yml @@ -149,11 +149,16 @@ jobs: [ -f ccache.tar.xz ] && tar xf ccache.tar.xz || true [ -f workspacecache.tar ] && mv workspacecache.tar ${{ github.workspace }} || true - name: Install Dependencies - run: brew install llvm@21 ccache gmp mpfr mpc + run: | + brew install llvm@21 ccache gmp mpfr mpc + # current homebrew cmake segfaults when building the ppc binary + wget -O- https://github.com/Kitware/CMake/releases/download/v4.2.3/cmake-4.2.3-macos-universal.tar.gz | tar -xz - name: Build run: | [ -f workspacecache.tar ] && tar xf workspacecache.tar || true - LLVM_CONFIG="$(brew --prefix)/opt/llvm@21/bin/llvm-config" ./platforms/macos/build.sh + LLVM_CONFIG="$(brew --prefix)/opt/llvm@21/bin/llvm-config" \ + PATH="$PWD/cmake-4.2.3-macos-universal/CMake.app/Contents/bin:$PATH" \ + ./platforms/macos/build.sh tar cf workspacecache.tar platforms/macos/build/work/toolchain platforms/macos/build/work/toolchain-ppc mv workspacecache.tar ~ env: diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 627270b89..2d78d596d 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -110,9 +110,15 @@ jobs: with: submodules: true - name: Install Dependencies - run: brew install llvm@21 gmp mpfr mpc + run: | + brew install llvm@21 gmp mpfr mpc + # current homebrew cmake segfaults when building the ppc binary + wget -O- https://github.com/Kitware/CMake/releases/download/v4.2.3/cmake-4.2.3-macos-universal.tar.gz | tar -xz - name: Build - run: LLVM_CONFIG="$(brew --prefix)/opt/llvm@21/bin/llvm-config" ./platforms/macos/build.sh + run: | + LLVM_CONFIG="$(brew --prefix)/opt/llvm@21/bin/llvm-config" \ + PATH="$PWD/cmake-4.2.3-macos-universal/CMake.app/Contents/bin:$PATH" \ + ./platforms/macos/build.sh env: GMP: /opt/homebrew MPFR: /opt/homebrew From 054bf61d4a3ad9a77c916b2fb7943a6e677eac6e Mon Sep 17 00:00:00 2001 From: Un1q32 Date: Sun, 22 Feb 2026 23:51:48 -0500 Subject: [PATCH 21/24] let it run on intel macos maybe --- .github/workflows/artifacts.yml | 6 +++--- .github/workflows/publish.yml | 7 +++---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/artifacts.yml b/.github/workflows/artifacts.yml index 952be1d7e..eb0be0c03 100644 --- a/.github/workflows/artifacts.yml +++ b/.github/workflows/artifacts.yml @@ -157,15 +157,15 @@ jobs: run: | [ -f workspacecache.tar ] && tar xf workspacecache.tar || true LLVM_CONFIG="$(brew --prefix)/opt/llvm@21/bin/llvm-config" \ + GMP="$(brew --prefix)" \ + MPFR="$(brew --prefix)" \ + MPC="$(brew --prefix)" \ PATH="$PWD/cmake-4.2.3-macos-universal/CMake.app/Contents/bin:$PATH" \ ./platforms/macos/build.sh tar cf workspacecache.tar platforms/macos/build/work/toolchain platforms/macos/build/work/toolchain-ppc mv workspacecache.tar ~ env: NOSTRIP: 1 - GMP: /opt/homebrew - MPFR: /opt/homebrew - MPC: /opt/homebrew - uses: actions/upload-artifact@v6 with: name: macOS diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 2d78d596d..7890bf824 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -117,12 +117,11 @@ jobs: - name: Build run: | LLVM_CONFIG="$(brew --prefix)/opt/llvm@21/bin/llvm-config" \ + GMP="$(brew --prefix)" \ + MPFR="$(brew --prefix)" \ + MPC="$(brew --prefix)" \ PATH="$PWD/cmake-4.2.3-macos-universal/CMake.app/Contents/bin:$PATH" \ ./platforms/macos/build.sh - env: - GMP: /opt/homebrew - MPFR: /opt/homebrew - MPC: /opt/homebrew - name: Pack release run: | mv platforms/macos/build/ReMCPE . From e006c650cebf6e745719445d0fee6aec210f7fca Mon Sep 17 00:00:00 2001 From: Un1q32 Date: Mon, 23 Feb 2026 00:38:31 -0500 Subject: [PATCH 22/24] no unix03 --- platforms/macos/build.sh | 4 ++-- platforms/macos/leopard-sdk-fix.patch | 11 +++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/platforms/macos/build.sh b/platforms/macos/build.sh index 20147ea21..5dbe09b7e 100755 --- a/platforms/macos/build.sh +++ b/platforms/macos/build.sh @@ -21,7 +21,7 @@ cd "$workdir" # Increase this if we ever make a change to the SDK, for example # using a newer SDK version, and we need to invalidate the cache. -sdkver=2 +sdkver=3 if ! [ -d "$x86_64_sdk" ] || ! [ -d "$arm64_sdk" ] || ! [ -d "$old_sdk" ] || [ "$(cat sdks/sdkver 2>/dev/null)" != "$sdkver" ]; then printf '\nDownloading macOS SDKs...\n\n' ( @@ -338,7 +338,7 @@ for target in $targets; do CXX="$cxx" \ CFLAGS="$opt $target_cflags" \ CXXFLAGS="$opt $target_cflags" \ - CPPFLAGS='-DNDEBUG -D__DARWIN_UNIX03=1' \ + CPPFLAGS='-DNDEBUG' \ AR=cctools-ar \ RANLIB=cctools-ranlib make -j"$ncpus" diff --git a/platforms/macos/leopard-sdk-fix.patch b/platforms/macos/leopard-sdk-fix.patch index 46713c1ec..e64c4a85f 100644 --- a/platforms/macos/leopard-sdk-fix.patch +++ b/platforms/macos/leopard-sdk-fix.patch @@ -13,3 +13,14 @@ #ifndef __SCSI__ #include #endif +--- a/usr/include/sys/signal.h ++++ b/usr/include/sys/signal.h +@@ -121,7 +121,7 @@ + #define SIGUSR1 30 /* user defined signal 1 */ + #define SIGUSR2 31 /* user defined signal 2 */ + +-#if defined(_ANSI_SOURCE) || __DARWIN_UNIX03 || defined(__cplusplus) ++#if 1 + /* + * Language spec sez we must list exactly one parameter, even though we + * actually supply three. Ugh! From 73379166410850b22076331f0fbcd55e68eab175 Mon Sep 17 00:00:00 2001 From: Un1q32 Date: Mon, 23 Feb 2026 01:15:25 -0500 Subject: [PATCH 23/24] better --- platforms/ios/build.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/platforms/ios/build.sh b/platforms/ios/build.sh index f16c1343e..5b5e8e7c0 100755 --- a/platforms/ios/build.sh +++ b/platforms/ios/build.sh @@ -45,11 +45,9 @@ fi if [ "$(uname -s)" = "Darwin" ]; then ar="${AR:-ar}" ranlib="${RANLIB:-ranlib}" - strip='strip' else ar="${AR:-"llvm-ar"}" ranlib="${RANLIB:-"llvm-ranlib"}" - strip='cctools-strip' fi for var in ar ranlib; do @@ -199,7 +197,7 @@ for target in $targets; do done lipo -create build-*/"$bin" -output "$bin" -[ -z "$DEBUG" ] && [ -z "$NOSTRIP" ] && "$strip" -no_code_signature_warning "$bin" +[ -z "$DEBUG" ] && [ -z "$NOSTRIP" ] && cctools-strip -no_code_signature_warning "$bin" if command -v ldid >/dev/null; then ldid -S"$entitlements" "$bin" else From ac7cafc409c796f9c110145f6976ff992c02284a Mon Sep 17 00:00:00 2001 From: Un1q32 Date: Mon, 23 Feb 2026 01:17:23 -0500 Subject: [PATCH 24/24] rename --- .github/workflows/publish.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 7890bf824..a7d948726 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -153,7 +153,9 @@ jobs: libssl-dev - name: Build - run: ./platforms/ios/build.sh + run: | + ./platforms/ios/build.sh + mv platforms/ios/build/ReMCPE.ipa ReMCPE-iOS.ipa env: CLANG: clang-21 AR: llvm-ar-21 @@ -163,7 +165,7 @@ jobs: env: GITHUB_TOKEN: ${{ github.token }} with: - asset_paths: '["platforms/ios/build/ReMCPE.ipa"]' + asset_paths: '["ReMCPE-iOS.ipa"]' android: strategy: @@ -201,7 +203,7 @@ jobs: env: BUILD_TOOLS_VERSION: 36.1.0 - name: Rename APK - run: mv ${{ steps.sign_apk.outputs.signedReleaseFile }} ReMCPE.apk + run: mv ${{ steps.sign_apk.outputs.signedReleaseFile }} ReMCPE-Android.apk - uses: alexellis/upload-assets@0.4.1 env: GITHUB_TOKEN: ${{ github.token }}