Using LLVM as a cross compiler without fully retargeting gcc?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Using LLVM as a cross compiler without fully retargeting gcc?

Pertti Kellomäki
We are using LLVM to target a customizable processor
architecture. One of the activities to be supported is
architecture exploration, where one explores the processor
design space (e.g. connectivity, number of FUs) and tries
to find a good match for the application at hand.

The exploration needs to be relatively rapid, so targeting
and compiling gcc for each of the processor variants is
not feasible.

My understanding at this point is that in order to make
things work correctly, gcc needs to know about the sizes
of primitive values like ints, and it probably needs to
known the endianess of the target. But I am guessing it would
also require me to provide a description of the target
architecture, even if I am only going to use gcc for emitting
LLVM byte code.

Is this correct? If so, can I just grab any one of the targets
supported by gcc, and modify the data sizes etc. to my liking?
Any technical reasons to avoid or prefer any one of the targets?
--
Pertti
_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: Using LLVM as a cross compiler without fully retargeting gcc?

Pertti Kellomäki
Chris Lattner wrote:
> Yep, that should work.  If you just use -emit-llvm all the time, you
> should be able to use any target GCC supports.

Great. Thanks!
--
Pertti
_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev