Sean Bruno via llvm-dev
2017-Jan-13 15:30 UTC
[llvm-dev] 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 ==================================================================--- 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>
Daniel Sanders via llvm-dev
2017-Jan-19 09:52 UTC
[llvm-dev] Trying to add an ARCH to FreeBSD Targets
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.> On 13 Jan 2017, at 15:30, Sean Bruno via llvm-dev <llvm-dev at lists.llvm.org> wrote: > > 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"); > > > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev