Trying to add an ARCH to FreeBSD Targets

Trying to enable the MIPS64 target for FreeBSD systems, and the method
that I used to use seems to not work anymore.

I'm having trouble finding the check itself as the error message is off
in a support file:

    error: unable to create target: 'No available targets are compatible
    with this triple.'

I used to modify clang's lib/Driver/ToolChains.cpp to enable this
target, but now there seems to be a bit more required:

Index: lib/Driver/ToolChains.cpp

Hi Sean,

Neither of those hunks should be involved in whether the triple is accepted. The first one controls whether the integrated assembler is enabled by default and the second selects the correct CRT object filename.

As you've found, clang has all it's diagnostics defined in a tablegen file. You can grep for the record name ('err_fe_unable_to_create_target') to find the places the diagnostic is emitted. In this case it's emitted because TargetRegistry::lookupTarget() failed. Is the Mips target compiled in to your LLVM? I remember needing a patch to one of FreeBSD's Makefiles to enable it.