These are some scratch notes of mine of different combinations of toolchains and MIPS ABIs.
All of these tests are done via the mips_xbuild branch at github/bsdjhb/freebsd.git. The current status below assumes a tree that contains all commits listed in the third table. Additional patches may also be required as noted in the comments.
| ABI | toolchain | build world | build kernel | run world | run kernel | notes |
| O32 | gcc 4.2 | ✔ | ✔ | ✔ | ✔ | |
| N32 | gcc 4.2 | ✔ | ✔ | ✔ | ✔ | |
| N64 | gcc 4.2 | ✔ | ✔ | ✔ | ✔ | |
| O32 | gcc 6.4 | ✔ | ✔ | ✔ | ✔ | |
| N32 | gcc 6.4 | ✔ | ✔ | ✔ | ✔ | |
| N64 | gcc 6.4 | ✔ | ✔ | ✔ | ✔ | |
| O32 | clang 6.0.0 | ✔ | ✔ | ✘ | ✔ | Requires unmerged changes in mips_clang branch. Use of thread-local-storage crashes (e.g. libxo in ps(1)) |
| N32 | clang 6.0.0 | ✘ | | | | clang doesn't pass through N32 ABI to assembler, see discussion here |
| N64 | clang 6.0.0 | ✔ | ✔ | ✔ | ✔ | Requires unmerged changes in mips_clang branch. Any use of NFS triggers kernel stack overflow. |
| toolchain | build args | notes |
| gcc 4.2 | make TARGET_ARCH=<abi> | |
| gcc 6.4 | make TARGET_ARCH=<abi> CROSS_TOOLCHAIN=mips-gcc | Requires mips-xtoolchain-gcc package |
| clang 6.0.0 | make TARGET_ARCH=<abi> WITH_CLANG=yes WITH_CLANG_IS_CC=yes WITH_CLANG_BOOTSTRAP=yes WITHOUT_GCC_BOOTSTRAP=yes WITHOUT_GCC=yes WITHOUT_GNUCXX=yes CROSS_BINUTILS_PREFIX=/usr/local/mips-freebsd/bin/ WITHOUT_SYSTEM_COMPILER=yes | Requires mips-binutils package |
| Review | Commit | Merged to FreeBSD | Description |
| D42972 | 324948 | | Look for 32-bit libraries in /usr/lib32 for MIPS O32 on FreeBSD. |
| D47938 | 334419 | | [mips] Fix spill slot for mips3, n64 abi |
| D31557 / D48515 | 335434 336004 | | Enable IAS by default for N64 |
| D48499 | 335653 | | Use more conservative default CPUs (mips2 and mips3) |
| D48507 | 335691 / 335702 | | Pass the linker emulation (-m foo) explicitly to ld |
| | | | Clang always uses dynamic TLS |
| D49939 | 338650 | | [ASAN] Use the correct shadow offset for ASAN on FreeBSD/mips64. |