Skip to content

Commit 3696efa

Browse files
Merge branch '96flashbacks:main' into main
2 parents 6b21d75 + 4004c29 commit 3696efa

265 files changed

Lines changed: 5083 additions & 20537 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Makefile

Lines changed: 33 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -284,10 +284,39 @@ else
284284
ACPP := $(QEMU_IRIX) -silent -L $(IRIX_ROOT) $(IRIX_ROOT)/usr/lib/acpp
285285
COPT := $(QEMU_IRIX) -silent -L $(IRIX_ROOT) $(IRIX_ROOT)/usr/lib/copt
286286
else
287-
IDO_ROOT := $(TOOLS_DIR)/ido-static-recomp/build/out
288-
CC := $(IDO_ROOT)/cc
289-
ACPP := $(IDO_ROOT)/acpp
290-
COPT := $(IDO_ROOT)/copt
287+
# Detect host platform for IDO recomp binaries (allow override via IDO_PLATFORM)
288+
ifndef IDO_PLATFORM
289+
DETECTED_OS := $(shell uname -s)
290+
ifeq ($(DETECTED_OS),Linux)
291+
DETECTED_ARCH := $(shell uname -m)
292+
ifeq ($(DETECTED_ARCH),aarch64)
293+
IDO_PLATFORM := linux-arm
294+
else
295+
IDO_PLATFORM := linux
296+
endif
297+
else ifeq ($(DETECTED_OS),Darwin)
298+
IDO_PLATFORM := macos
299+
else ifneq (,$(findstring MINGW,$(DETECTED_OS)))
300+
IDO_PLATFORM := windows
301+
else ifneq (,$(findstring MSYS,$(DETECTED_OS)))
302+
IDO_PLATFORM := windows
303+
else ifneq (,$(findstring CYGWIN,$(DETECTED_OS)))
304+
IDO_PLATFORM := windows
305+
else
306+
$(error Unsupported platform: $(DETECTED_OS))
307+
endif
308+
endif
309+
310+
# Windows binaries carry the .exe suffix
311+
IDO_EXE_SUFFIX :=
312+
ifeq ($(IDO_PLATFORM),windows)
313+
IDO_EXE_SUFFIX := .exe
314+
endif
315+
316+
IDO_ROOT := $(TOOLS_DIR)/ido-5.3-recomp-$(IDO_PLATFORM)
317+
CC := $(IDO_ROOT)/cc$(IDO_EXE_SUFFIX)
318+
ACPP := $(IDO_ROOT)/acpp$(IDO_EXE_SUFFIX)
319+
COPT := $(IDO_ROOT)/copt$(IDO_EXE_SUFFIX)
291320
endif
292321
endif
293322
LD := $(CROSS)ld
@@ -358,12 +387,6 @@ VADPCM_ENC := $(TOOLS_DIR)/vadpcm_enc
358387
EXTRACT_DATA_FOR_MIO := $(TOOLS_DIR)/extract_data_for_mio
359388
SKYCONV := $(TOOLS_DIR)/skyconv
360389
FLIPS := $(TOOLS_DIR)/flips
361-
# Use the system installed armips if available. Otherwise use the one provided with this repository.
362-
ifneq (,$(call find-command,armips))
363-
RSPASM := armips
364-
else
365-
RSPASM := $(TOOLS_DIR)/armips
366-
endif
367390
ENDIAN_BITWIDTH := $(BUILD_DIR)/endian-and-bitwidth
368391
EMULATOR = mupen64plus
369392
EMU_FLAGS = --noosd

tools/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,7 @@
1313
!/ido5.3_compiler/usr/lib/*.so
1414
!/ido5.3_compiler/usr/lib/*.so.1
1515
!/ido5.3_compiler/**/*.o
16+
!/ido-5.3-recomp-linux/*
17+
!/ido-5.3-recomp-linux-arm/*
18+
!/ido-5.3-recomp-macos/*
19+
!/ido-5.3-recomp-windows/*
Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -48,19 +48,6 @@ Add `RELEASE=1` to build release builds with optimizations and stripped binaries
4848
By default, make build script create native binaries on macOS. This was done to minimize the time to build the recompiled suite.
4949
In order to create "fat," universal ARM and x86_64, pass `TARGET=universal` to `gmake`.
5050

51-
### Manual Building
51+
## Binaries
5252

53-
Example for compiling `as1` in a Linux environment:
54-
55-
```bash
56-
make -C tools/rabbitizer
57-
g++ -Itools/rabbitizer/include -Itools/rabbitizer/cplusplus/include recomp.cpp -o recomp.elf -g -Ltools/rabbitizer/build -lrabbitizerpp
58-
./recomp.elf ido/7.1/usr/lib/as1 > as1_c.c
59-
gcc libc_impl.c as1_c.c -o as1 -g -fno-strict-aliasing -lm -DIDO71
60-
```
61-
62-
Use the same approach for `cc`, `cfe`, `uopt`, `ugen`, `as1` (and `copt` if you need that).
63-
64-
Use `-DIDO53` instead of `-DIDO71` if the program you are trying to recompile was compiled with IDO 5.3 rather than IDO 7.1.
65-
66-
To compile `ugen` for IDO 5.3, add `--conservative` when invoking `./recomp.elf`. This mimics UB present in `ugen53`. That program reads uninitialized stack memory and its result depends on that stack memory.
53+
The binaries in this folder originate from [these releases](https://github.com/klorfmorf/ido-static-recomp/releases/tag/v1.0.0) and have not been altered in any way, shape or form.

tools/Makefile

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,10 @@ CC := gcc
77
CXX := g++
88
CFLAGS := -I . -I sm64tools -Wall -Wextra -Wno-unused-parameter -pedantic -O2 -s
99
LDFLAGS := -lm
10-
ALL_PROGRAMS := armips textconv patch_elf_32bit aifc_decode aiff_extract_codebook vadpcm_enc tabledesign extract_data_for_mio skyconv slienc
10+
ALL_PROGRAMS := textconv patch_elf_32bit aifc_decode aiff_extract_codebook vadpcm_enc tabledesign extract_data_for_mio skyconv slienc
1111
LIBAUDIOFILE := audiofile/libaudiofile.a
1212

13-
# Only build armips from tools if it is not found on the system
14-
ifeq ($(call find-command,armips),)
15-
BUILD_PROGRAMS := $(ALL_PROGRAMS)
16-
else
17-
BUILD_PROGRAMS := $(filter-out armips,$(ALL_PROGRAMS))
18-
endif
13+
BUILD_PROGRAMS := $(ALL_PROGRAMS)
1914

2015
default: all
2116

@@ -39,14 +34,6 @@ extract_data_for_mio_SOURCES := extract_data_for_mio.c
3934

4035
skyconv_SOURCES := skyconv.c sm64tools/n64graphics.c sm64tools/utils.c
4136

42-
armips: CC := $(CXX)
43-
armips_SOURCES := armips.cpp
44-
armips_CFLAGS := -std=gnu++11 -fno-exceptions -fno-rtti -pipe
45-
armips_LDFLAGS := -pthread
46-
ifeq ($(HOST_ENV),MinGW)
47-
armips_LDFLAGS += -municode
48-
endif
49-
5037
ifeq ($(shell uname -s),Linux)
5138
BUILD_PROGRAMS += flips
5239
endif
@@ -65,25 +52,20 @@ slienc_CFLAGS :=
6552

6653
all-except-recomp: $(LIBAUDIOFILE) $(BUILD_PROGRAMS)
6754

68-
all: all-except-recomp ido-static-recomp
55+
all: all-except-recomp
6956

7057
clean:
7158
$(RM) $(ALL_PROGRAMS)
7259
$(MAKE) -C audiofile clean
73-
$(MAKE) -C ido-static-recomp clean
7460

7561
define COMPILE
7662
$(1): $($1_SOURCES)
7763
$$(CC) $(CFLAGS) $($1_CFLAGS) $$^ -o $$@ $($1_LDFLAGS) $(LDFLAGS)
7864
endef
7965

80-
ido-static-recomp:
81-
@$(MAKE) -C ido-static-recomp setup
82-
@$(MAKE) -C ido-static-recomp
83-
8466
$(foreach p,$(BUILD_PROGRAMS),$(eval $(call COMPILE,$(p))))
8567

8668
$(LIBAUDIOFILE):
8769
@$(MAKE) -C audiofile
8870

89-
.PHONY: all all-except-recomp clean default ido-static-recomp
71+
.PHONY: all all-except-recomp clean default
130 KB
Binary file not shown.

tools/ido-5.3-recomp-linux-arm/as0

170 KB
Binary file not shown.

tools/ido-5.3-recomp-linux-arm/as1

798 KB
Binary file not shown.
77.9 KB
Binary file not shown.

tools/ido-5.3-recomp-linux-arm/cc

234 KB
Binary file not shown.

tools/ido-5.3-recomp-linux-arm/cfe

734 KB
Binary file not shown.

0 commit comments

Comments
 (0)