[cfe-dev] Initial *-rtems* Target Support

Douglas Gregor dgregor at apple.com
Fri Jul 1 15:41:29 PDT 2011

On Jun 30, 2011, at 2:07 PM, Joel Sherrill wrote:

> Hi,
> Some of us over in the RTEMS community
> (http://www.rtems.org) are curious about the
> possibility of using clang to compile RTEMS.
> For those who don't know RTEMS is an embedded
> real-time operating system which targets about
> 15 architectures and many more CPU models.
> So this is the beginnings of investigating using
> clang on RTEMS.

Very cool.

> As background, the RTEMS targets in gcc are usually
> very close cousins to the bare metal targets like
> CPU-*-elf* or CPU-*-eabi*.  We use newlib and build
> newlib at the same time as gcc.
> clang does not support most of the architectures
> supported by RTEMS.  The intersection is x86,
> mips, powerpc, sparc, sparcv9, arm, thumb, and blackfin.
> Iin some cases, it does not cover the architectural
> variants we care most about.  For example, the
> space community uses hardened SPARC V7 CPUs a lot
> with RTEMS and only V8 is supported by clang right now.
> The first goal is to get RTEMS itself to compile
> with clang targeting i386 w/FPU.
> I have managed to get newlib built and installed using
> clang to target i386-rtems4.11.  Building RTEMS is next
> on the list and I will need assistance from others to
> get through this hurdle.  In the interest of being open
> and hopefully getting help, I am submitting patches
> which should be OK to merge.  I don't think they are
> too radical. :)
> The attached patches add initial *-*-rtems* target
> support.  I modelled it after the FreeBSD support
> which supports multiple architectures.
> I don't know what format you want commit logs in but
> this is the information:
>    Add initial *-*-rtems* target.
> The only tricky part to the patch is that RTEMS tools
> are never self-hosted so we do NOT want /usr/include
> ever added to an include search path.  That's in
> lib/Frontend/InitHeaderSearch.cpp around line 590.
> Hopefully this isn't too bad to get merged. :)

Looks fine to me. I've committee the patches to LLVM (r134282) and Clang (r134283).

	- Doug

More information about the cfe-dev mailing list