1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-05-10 02:54:24 +00:00

Add macOS instructions for installing mips-linux-gnu-gcc

This commit is contained in:
cadmic 2025-04-21 17:00:24 -07:00
parent 655ec77138
commit 66db4d3971

View file

@ -60,7 +60,7 @@ Configure the build
Make and install binutils Make and install binutils
```bash ```bash
make -j make -j$(nproc)
sudo make install sudo make install
``` ```
@ -82,3 +82,44 @@ If this worked, you can now delete the temporary directory `~/binutils-tmp`.
Apple's version of `make` is very out-of-date, so you should use the brew-installed `gmake` in place of `make` in this repo from now on. Apple's version of `make` is very out-of-date, so you should use the brew-installed `gmake` in place of `make` in this repo from now on.
You should now be able to continue from [step 2](../README.md#2-clone-the-repository) of the Linux instructions. You should now be able to continue from [step 2](../README.md#2-clone-the-repository) of the Linux instructions.
## 4. Building GCC (optional)
If you'd like to compile with GCC instead of IDO (e.g. for modding), you can build it from source similarly to how we built binutils:
Install dependences
```bash
brew install gcc@14 gmp isl libmpc mpfr
```
Create and enter local working dir
```bash
mkdir ~/gcc-tmp
cd ~/gcc-tmp
```
Get and extract gcc source
```bash
curl -O https://ftp.gnu.org/gnu/gcc/gcc-14.2.0/gcc-14.2.0.tar.xz
tar xvf gcc-14.2.0.tar.xz
```
Create and enter a build directory
```bash
mkdir build-gcc
cd build-gcc
```
Configure the build
```bash
CC=gcc-14 CXX=g++-14 ../gcc-14.2.0/configure --target=mips-linux-gnu --prefix=/opt/cross --disable-nls --enable-languages=c --with-gmp=$(brew --prefix)/opt/gmp --with-mpfr=$(brew --prefix)/opt/mpfr --with-mpc=$(brew --prefix)/opt/libmpc --with-isl=$(brew --prefix)/opt/isl
```
Make and install gcc
```bash
CC=gcc-14 CXX=g++-14 make all-gcc -j$(nproc)
sudo make install-gcc
```
If this worked, you can now delete the temporary directory `~/gcc-tmp`.