Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 20 additions & 23 deletions .github/workflows/ci_egcs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,15 @@
name: Build EGCS libultra

# Build on every branch push, tag push, and pull request change:
on: [push, pull_request_target]
on:
push:
pull_request:

jobs:
build_repo:
# This is a *private* build container.
container: ghcr.io/decompals/ultralib-build:main

name: Build repo
runs-on: ubuntu-latest

Expand All @@ -18,25 +23,17 @@ jobs:
suffix: [_rom] # [~, _d, _rom]

steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Install package requirements
run: sudo apt-get install -y build-essential python3

- name: Get extra dependencies
uses: actions/checkout@v3
with:
repository: ${{ secrets.SECRETREPO }}
token: ${{ secrets.SECRETTOKEN }}
path: deps_repo
- name: Get the dependency
run: cp deps_repo/libultra/${{ matrix.version }}/* .

- name: Setup
run: make setup -j $(nproc) TARGET=libultra${{ matrix.suffix }} VERSION=${{ matrix.version }}

- name: Build libultra${{ matrix.suffix }} ${{ matrix.version }}
run: make -j $(nproc) TARGET=libultra${{ matrix.suffix }} VERSION=${{ matrix.version }}
- name: Checkout repository
uses: actions/checkout@v6

- name: Install package requirements
run: apt-get install -y build-essential python3

- name: Get the dependency
run: cp /orig/${{ matrix.version }}/* base/${{ matrix.version }}

- name: Setup
run: make setup -j $(nproc) TARGET=libultra${{ matrix.suffix }} VERSION=${{ matrix.version }}

- name: Build libultra${{ matrix.suffix }} ${{ matrix.version }}
run: make -j $(nproc) TARGET=libultra${{ matrix.suffix }} VERSION=${{ matrix.version }}
43 changes: 20 additions & 23 deletions .github/workflows/ci_gcc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,15 @@
name: Build GCC libgultra

# Build on every branch push, tag push, and pull request change:
on: [push, pull_request_target]
on:
push:
pull_request:

jobs:
build_repo:
# This is a *private* build container.
container: ghcr.io/decompals/ultralib-build:main

name: Build repo
runs-on: ubuntu-latest

Expand All @@ -17,25 +22,17 @@ jobs:
suffix: [~, _d, _rom]

steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Install package requirements
run: sudo apt-get install -y binutils-mips-linux-gnu build-essential python3

- name: Get extra dependencies
uses: actions/checkout@v3
with:
repository: ${{ secrets.SECRETREPO }}
token: ${{ secrets.SECRETTOKEN }}
path: deps_repo
- name: Get the dependency
run: cp deps_repo/libultra/${{ matrix.version }}/* base/${{ matrix.version }}

- name: Setup
run: make setup -j $(nproc) TARGET=libgultra${{ matrix.suffix }} VERSION=${{ matrix.version }}

- name: Build libgultra${{ matrix.suffix }} ${{ matrix.version }}
run: make -j $(nproc) TARGET=libgultra${{ matrix.suffix }} VERSION=${{ matrix.version }}
- name: Checkout repository
uses: actions/checkout@v6

- name: Install package requirements
run: apt-get install -y binutils-mips-linux-gnu build-essential python3

- name: Get the dependency
run: cp /orig/${{ matrix.version }}/* base/${{ matrix.version }}

- name: Setup
run: make setup -j $(nproc) TARGET=libgultra${{ matrix.suffix }} VERSION=${{ matrix.version }}

- name: Build libgultra${{ matrix.suffix }} ${{ matrix.version }}
run: make -j $(nproc) TARGET=libgultra${{ matrix.suffix }} VERSION=${{ matrix.version }}
43 changes: 20 additions & 23 deletions .github/workflows/ci_ido.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,15 @@
name: Build IDO libultra

# Build on every branch push, tag push, and pull request change:
on: [push, pull_request_target]
on:
push:
pull_request:

jobs:
build_repo:
# This is a *private* build container.
container: ghcr.io/decompals/ultralib-build:main

name: Build repo
runs-on: ubuntu-latest

Expand All @@ -17,25 +22,17 @@ jobs:
suffix: [~, _rom] # [~, _d, _rom]

steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Install package requirements
run: sudo apt-get install -y build-essential python3 binutils-mips-linux-gnu

- name: Get extra dependencies
uses: actions/checkout@v3
with:
repository: ${{ secrets.SECRETREPO }}
token: ${{ secrets.SECRETTOKEN }}
path: deps_repo
- name: Get the dependency
run: cp deps_repo/libultra/${{ matrix.version }}/* base/${{ matrix.version }}

- name: Setup
run: make setup -j $(nproc) TARGET=libultra${{ matrix.suffix }} VERSION=${{ matrix.version }}

- name: Build libultra${{ matrix.suffix }} ${{ matrix.version }}
run: make -j $(nproc) TARGET=libultra${{ matrix.suffix }} VERSION=${{ matrix.version }}
- name: Checkout repository
uses: actions/checkout@v6

- name: Install package requirements
run: apt-get install -y build-essential python3 binutils-mips-linux-gnu

- name: Get the dependency
run: cp /orig/${{ matrix.version }}/* base/${{ matrix.version }}

- name: Setup
run: make setup -j $(nproc) TARGET=libultra${{ matrix.suffix }} VERSION=${{ matrix.version }}

- name: Build libultra${{ matrix.suffix }} ${{ matrix.version }}
run: make -j $(nproc) TARGET=libultra${{ matrix.suffix }} VERSION=${{ matrix.version }}
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,13 @@ The build process requires the following packages:
- build-essential
- python3
- binutils-mips-linux-gnu (libultra* only)
- wget

Under Debian / Ubunutu you can install them with the following commands:
Under Debian / Ubuntu you can install them with the following commands:

```bash
sudo apt update
sudo apt install build-essential python3
sudo apt install build-essential python3 wget
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't use wget do we? i thought that was just to download the versions of gcc for matching

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can also remove it, I just want the commit for the sake of not being behind or splitting off

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aren't we by definition splitting off? It's not like there's non matching functions to worry about

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess, but I'd rather stay up to date with upstream in general if it's not too much of a pain to do so. Otherwise it can make us look 'outdated'.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess for now we can just grab the commits and then immediately undo them with a revert commit or otherwise (which also probably means this PR would need its own branch)

```

If building any libultra you can install binutils-mips-linux-gnu with:
Expand All @@ -49,7 +50,7 @@ sudo apt install binutils-mips-linux-gnu
## Building

Run make setup with the proper flags set followed by make with optional jobs.
For example, if building the 2.0L PC archive you'd do the following:
For example, if building the 2.0L PC archive you'd do the following:

- `make VERSION=L TARGET=libgultra_rom setup`
- `make VERSION=L TARGET=libgultra_rom`
Expand Down
4 changes: 4 additions & 0 deletions src/error/kmcprintf.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
#include "ultraerror.h"
#include "../libc/xstdio.h"

#ifndef _FINALROM

extern u32 __kmc_pt_mode;

static void* proutSyncPrintf(void* str, const char* buf, size_t n) {
Expand Down Expand Up @@ -244,3 +246,5 @@ static void kmcErrorHandler(s16 code, s16 numArgs, ...) {

va_end(ap);
}

#endif
27 changes: 18 additions & 9 deletions tools/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@

.PHONY: all clean distclean

UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Darwin)
GNU_SUFFIX := mac
IDO_SUFFIX := macos
else
GNU_SUFFIX := linux
IDO_SUFFIX := linux
endif

# GCC
GCC_DIR := gcc
AR := $(GCC_DIR)/ar
Expand All @@ -14,14 +23,14 @@ IDO-5.3 := $(IDO_DIR)/cc
all: $(AR) $(GCC-2.7.2) $(STRIP-2.7) $(IDO-5.3)

$(AR): | $(GCC_DIR)
wget https://github.com/decompals/mips-binutils-2.6/releases/download/main/binutils-2.6-linux.tar.gz
tar xf binutils-2.6-linux.tar.gz -C $(GCC_DIR)
$(RM) binutils-2.6-linux.tar.gz
wget https://github.com/decompals/mips-binutils-2.6/releases/download/main/binutils-2.6-$(GNU_SUFFIX).tar.gz
tar xf binutils-2.6-$(GNU_SUFFIX).tar.gz -C $(GCC_DIR)
$(RM) binutils-2.6-$(GNU_SUFFIX).tar.gz

$(GCC-2.7.2): | $(GCC_DIR)
wget https://github.com/decompals/mips-gcc-2.7.2/releases/download/main/gcc-2.7.2-linux.tar.gz
tar xf gcc-2.7.2-linux.tar.gz -C $(GCC_DIR)
$(RM) gcc-2.7.2-linux.tar.gz
wget https://github.com/decompals/mips-gcc-2.7.2/releases/download/main/gcc-2.7.2-$(GNU_SUFFIX).tar.gz
tar xf gcc-2.7.2-$(GNU_SUFFIX).tar.gz -C $(GCC_DIR)
$(RM) gcc-2.7.2-$(GNU_SUFFIX).tar.gz

$(STRIP-2.7): | $(GCC_DIR)
wget https://github.com/decompals/mips-binutils-2.7/releases/download/release/binutils-2.7.tar.gz
Expand All @@ -32,9 +41,9 @@ $(GCC_DIR):
mkdir -p $@

$(IDO-5.3): | $(IDO_DIR)
wget https://github.com/decompals/ido-static-recomp/releases/latest/download/ido-5.3-recomp-linux.tar.gz
tar xf ido-5.3-recomp-linux.tar.gz -C $(IDO_DIR)
$(RM) ido-5.3-recomp-linux.tar.gz
wget https://github.com/decompals/ido-static-recomp/releases/latest/download/ido-5.3-recomp-$(IDO_SUFFIX).tar.gz
tar xf ido-5.3-recomp-$(IDO_SUFFIX).tar.gz -C $(IDO_DIR)
$(RM) ido-5.3-recomp-$(IDO_SUFFIX).tar.gz

$(IDO_DIR):
mkdir -p $@
Expand Down
Loading