Initial commit: cross-platform powerpc-xenon-pe binutils builds

Xbox 360 (Xenon) big-endian PowerPC COFF support patched onto
binutils 2.45.1, with cross-platform CI mirroring gc-wii-binutils.
This commit is contained in:
Luke Street
2026-02-08 19:07:26 -07:00
commit 6af42f9bf7
8 changed files with 1742 additions and 0 deletions
+1
View File
@@ -0,0 +1 @@
*.patch text eol=lf
+104
View File
@@ -0,0 +1,104 @@
name: Build
on:
push:
paths-ignore:
- '*.md'
- 'LICENSE*'
pull_request:
jobs:
build-linux:
name: Build Linux
strategy:
matrix:
include:
- name: x86_64
gnu: x86_64-linux-musl
zig: x86_64-linux-musl
- name: i686
gnu: i686-linux-musl
zig: x86-linux-musl
- name: armv7l
gnu: arm-linux-musleabihf
zig: arm-linux-musleabihf
- name: aarch64
gnu: aarch64-linux-musl
zig: aarch64-linux-musl
fail-fast: false
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build
run: >
docker build --target export --output build .
--build-arg GNU_TRIPLE=${{ matrix.gnu }}
--build-arg ZIG_TRIPLE=${{ matrix.zig }}
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: linux-${{ matrix.name }}
path: build/bin
build-macos:
name: Build macOS
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build
run: ./build-macos.sh
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: macos-universal
path: build/bin
build-windows:
name: Build Windows
strategy:
matrix:
include:
- name: x86_64
sys: clang64
# - name: arm64
# sys: clangarm64
fail-fast: false
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.sys }}
install: make texinfo patch
pacboy: clang:p
- name: Build
shell: msys2 {0}
run: ./build-windows.sh
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: windows-${{ matrix.name }}
path: build/bin
release:
name: Release
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
needs: [ build-linux, build-macos, build-windows ]
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: List artifacts
run: ls -R artifacts
- name: Create archives
working-directory: artifacts
run: for f in *; do zip -jr $f.zip $f; done
- name: Release
uses: softprops/action-gh-release@4634c16e79c963813287e889244c50009e7f0981
with:
files: artifacts/*.zip
+3
View File
@@ -0,0 +1,3 @@
binutils-*
build
source
File diff suppressed because it is too large Load Diff
+45
View File
@@ -0,0 +1,45 @@
# Build stage
ARG ALPINE_VERSION=3.19.1
FROM alpine:${ALPINE_VERSION} AS build
# Install dependencies
RUN apk add --no-cache binutils file gcc make musl-dev patch
# Install zig
ARG ZIG_VERSION=0.11.0
RUN mkdir /zig && \
wget -qO- "https://ziglang.org/download/${ZIG_VERSION}/zig-linux-`uname -m`-${ZIG_VERSION}.tar.xz" | \
tar -xJ -C /zig --strip-components=1
ENV PATH="/zig:$PATH"
# Download binutils
ARG BINUTILS_VERSION=2.45.1
RUN wget -q https://ftp.gnu.org/gnu/binutils/binutils-${BINUTILS_VERSION}.tar.xz
# Copy patches (needed for both host and target builds)
COPY *.patch /
# Build host binutils
ARG GNU_TRIPLE
RUN mkdir /binutils-host && \
tar -xf /binutils-${BINUTILS_VERSION}.tar.xz -C /binutils-host --strip-components=1 && \
cd /binutils-host && for patch in ../*.patch; do patch -N -p1 -i $patch; done && \
./configure --target=powerpc-xenon-pe --prefix=/usr/local \
--disable-nls --disable-shared --disable-gprofng --disable-ld --disable-gold && \
make -j$(nproc) && \
make install-strip
# Build target binutils
ARG ZIG_TRIPLE
RUN mkdir /binutils && \
tar -xf /binutils-${BINUTILS_VERSION}.tar.xz -C /binutils --strip-components=1 && \
cd /binutils && for patch in ../*.patch; do patch -N -p1 -i $patch; done && \
CC="zig cc -target ${ZIG_TRIPLE}" \
./configure --host=${GNU_TRIPLE} --target=powerpc-xenon-pe --prefix=/target \
--disable-nls --disable-shared --disable-gprof --without-zstd && \
make -j$(nproc) && \
make install-strip
# Export binary (usage: docker build --target export --output build .)
FROM scratch AS export
COPY --from=build /target .
+1
View File
@@ -0,0 +1 @@
Cross-platform builds of `powerpc-xenon-pe` binutils (Xbox 360 / Xenon).
Executable
+13
View File
@@ -0,0 +1,13 @@
#!/bin/bash -ex
PREFIX="$(pwd)/build"
mkdir source
wget -qO- https://ftp.gnu.org/gnu/binutils/binutils-2.45.1.tar.xz | tar -xJ -C source --strip-components=1
cd source
for patch in ../*.patch; do
patch -N -p1 -i "$patch"
done
export CFLAGS="-arch arm64 -arch x86_64 -mmacosx-version-min=10.11"
./configure --target=powerpc-xenon-pe --prefix="$PREFIX" --disable-nls --disable-shared --disable-gprof --without-zstd
make -j$(nproc) configure-host
make -j$(nproc)
make install-strip
+12
View File
@@ -0,0 +1,12 @@
#!/bin/bash -ex
PREFIX="$(pwd)/build"
mkdir source
wget -qO- https://ftp.gnu.org/gnu/binutils/binutils-2.45.1.tar.xz | tar -xJ -C source --strip-components=1
cd source
for patch in ../*.patch; do
patch -N -p1 -i "$patch"
done
./configure --target=powerpc-xenon-pe --prefix="$PREFIX" --disable-nls --disable-shared --disable-gprof --without-zstd
make -j$(nproc) configure-host
make -j$(nproc)
make install-strip