[cfe-commits] [Patch] Initial FreeBSD ARM support

Andrew Turner andrew at fubar.geek.nz
Wed Dec 5 01:58:58 PST 2012


On Wed, 28 Nov 2012 00:02:25 +0200
Dmitri Gribenko <gribozavr at gmail.com> wrote:

> On Mon, Nov 26, 2012 at 11:15 AM, Andrew Turner
> <andrew at fubar.geek.nz> wrote:
> > On Sat, 24 Nov 2012 22:23:40 +0200
> > Dmitri Gribenko <gribozavr at gmail.com> wrote:
> >
> >> On Sat, Nov 24, 2012 at 10:47 AM, Andrew Turner
> >> <andrew at fubar.geek.nz> wrote:
> >> > Hello,
> >> >
> >> > The attached patch adds initial support to clang for FreeBSD on
> >> > ARM. I've tested this on FreeBSD's integrated clang 3.1 and
> >> > forward ported the changes to clang's trunk.
> >>
> >> Hi Andrew,
> >>
> >> I am not an expert on this part of Clang, but this definitely needs
> >> tests.
> >>
> > Are you able to point me in the direction of the sort of tests you
> > would expect for the patch? I'm not familiar with clang's testing
> > framework.
> 
> Rafael has already given an advice.  Here's more:
> 
> +      Builder.defineMacro("__FreeBSD_ARCH_armv6__");
> 
> You might want to add a test to test/Preprocessor/init.c for this.
> 
> +  } else if (getToolChain().getArch() == llvm::Triple::arm ||
> +             getToolChain().getArch() == llvm::Triple::thumb) {
> +    CmdArgs.push_back("-mfpu=softvfp");
> +    switch(getToolChain().getTriple().getEnvironment()) {
> +    case llvm::Triple::GNUEABI:
> +    case llvm::Triple::EABI:
> +      break;
> +
> +    default:
> +      CmdArgs.push_back("-matpcs");
> +    }
> 
> As far as I understand, this could be tested with something like
> test/Driver/freebsd-mips-as.c.
> 
> Dmitri
> 

How does the attached patch look? It adds tests as requested.

Andrew
-------------- next part --------------
A non-text attachment was scrubbed...
Name: clang_arm_2.diff
Type: text/x-patch
Size: 5995 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20121205/3cf72358/attachment.bin>


More information about the cfe-commits mailing list