johnbaldwin:mips

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 Description
r322915 Fix recursion for some builtins with n32
r322772 Fix compile of FP exception handlers with clang
r322767 Fix compile of top with clang
r322766 Fix missing division builtins used by clang
r322765 Fix build of dtrace header with clang on o32
D10085 r316620 r316621 r316622 Pass -mabi=XX to compiler driver instead of depending on default
D10085 r316512 r316513 r316514 r316537 Pass linker emulation to linker instead of depending on default
D10086 r316511 Export an __ffssi2() symbol
D9707 r314114 Use LDFLAGS instead of _LDFLAGS for beri boot binaries
D9708 r314115 Fix rtld to handle GOT[1] for modern toolchains
D15543 r472011 Fix GCC ports to use default MIPS arch of MIPSIII for O32
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.
  • johnbaldwin/mips.txt
  • Last modified: 2018/08/01 22:52
  • by JohnBaldwin