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

Joel Sherrill joel.sherrill at OARcorp.com
Thu Jun 30 14:07:09 PDT 2011


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.

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. :)

And we can get some assistance to get over the hurdles
we might encounter trying to get a working clang built
RTEMS.

Thanks in advance.

-- 
Joel Sherrill, Ph.D.             Director of Research&  Development
joel.sherrill at OARcorp.com        On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
    Support Available             (256) 722-9985


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: clang-rtems-20110629.diff
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20110630/677967a8/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: llvm-rtems-20110629.diff
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20110630/677967a8/attachment-0001.ksh>


More information about the cfe-dev mailing list