[llvm-dev] Trying to add an ARCH to FreeBSD Targets

Sean Bruno via llvm-dev llvm-dev at lists.llvm.org
Fri Jan 13 07:30:29 PST 2017

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
--- lib/Driver/ToolChains.cpp   (revision 291783)
+++ lib/Driver/ToolChains.cpp   (working copy)
@@ -2921,8 +2921,8 @@
   case llvm::Triple::systemz:
   case llvm::Triple::mips:
   case llvm::Triple::mipsel:
+  case llvm::Triple::mips64:
     return true;
-  case llvm::Triple::mips64:
   case llvm::Triple::mips64el:
     // Enabled for Debian mips64/mips64el only. Other targets are unable to
     // distinguish N32 from N64.
@@ -3669,6 +3669,7 @@
   // When targeting 32-bit platforms, look for '/usr/lib32/crt1.o' and fall
   // back to '/usr/lib' if it doesn't exist.
   if ((Triple.getArch() == llvm::Triple::x86 ||
+       Triple.getArch() == llvm::Triple::mips ||
        Triple.getArch() == llvm::Triple::ppc) &&
       D.getVFS().exists(getDriver().SysRoot + "/usr/lib32/crt1.o"))
     getFilePaths().push_back(getDriver().SysRoot + "/usr/lib32");

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 618 bytes
Desc: OpenPGP digital signature
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170113/7676c8ed/attachment.sig>

More information about the llvm-dev mailing list