[LLVMdev] Using LLVM with Ada

Enrico Mezzetti emezzett at math.unipd.it
Tue Aug 31 08:58:35 PDT 2010


Dear Duncan,

thank you for the prompt reaction!


Quoting Duncan Sands <baldrick at free.fr>:
> Hi Enrico, did you follow the instructions here
>    http://llvm.org/docs/GCCFEBuildInstrs.html#ada
> to build llvm-gcc with Ada support?

Yes. I succesfully followed the instructions to build the LLVM Ada f-e.

> If by 2.5 you mean LLVM-2.5 I suggest you use something more recent, for
> example LLVM-2.7.

I was probably misled by the instructrions themselves which state:
"Compilers known to work with the LLVM 2.5 release are gcc-4.2 and the 2005,
2006 and 2007 versions of the GNAT GPL Edition. GNAT GPL 2008, gcc-4.3 and
later will not work."

> Please show how you tried to compile it and what the undefined references
> were.
> You are supposed to be able to use llvm-gcc in the same way as gcc.

Actually I was able to compile my program by invoking "gnatmake" provided by
the llvm-gcc f-e and I obtained an optimized version of my
excutable.

However, I would be interested in calling different llvm tools in a
non-transparent way. For example I would like to call llvm-gcc to obtain
the LLVM intermediate representation of a compilation module
(e.g., llvm-gcc -c hello.adb) and then invoke different llvm tools.
The problem is that I do not know how to include the information
from the .ali files generated by gnat. In the lack of such information
llvmc (for example) is not able to find a proper main for my program and
raises an undefined reference error.
I was wandering if it is actually possible to exploit the LLVM framework in
such a sequential manner as it is for C programs.

By the way, I'll try LLVM 2.7 and the respective version of LLVM-GCC.


Thanks again and best regards,

 Enrico



-----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.

Dipartimento di Matematica Pura ed Applicata
Universita' degli Studi di Padova
www.math.unipd.it



More information about the llvm-dev mailing list