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 |
Changes in FreeBSD
Review |
Commit |
Description |
|
Fix recursion for some builtins with n32 |
|
|
Fix compile of FP exception handlers with clang |
|
|
Fix compile of top with clang |
|
|
Fix missing division builtins used by clang |
|
|
Fix build of dtrace header with clang on o32 |
|
Pass -mabi=XX to compiler driver instead of depending on default |
||
Pass linker emulation to linker instead of depending on default |
||
Export an __ffssi2() symbol |
||
Use LDFLAGS instead of _LDFLAGS for beri boot binaries |
||
Fix rtld to handle GOT[1] for modern toolchains |
||
Fix GCC ports to use default MIPS arch of MIPSIII for O32 |
Changes in LLVM
Review |
Commit |
Merged to FreeBSD |
Description |
|
Look for 32-bit libraries in /usr/lib32 for MIPS O32 on FreeBSD. |
||
|
[mips] Fix spill slot for mips3, n64 abi |
||
|
Enable IAS by default for N64 |
||
|
Use more conservative default CPUs (mips2 and mips3) |
||
|
Pass the linker emulation (-m foo) explicitly to ld |
||
|
|
|
Clang always uses dynamic TLS |
|
[ASAN] Use the correct shadow offset for ASAN on FreeBSD/mips64. |