LLVM-gcc for Ada

Duncan Sands wrote:

Hi Andre,

I'm trying to build LLVM-gcc to compile Ada.

excellent!

But I'm having a few problems.

Oops :frowning:

Now when I ran make I get an error that for me it seams very weird.

../../gcc/c-format.c: In function 'set_Wformat':
../../gcc/c-format.c:48: error: 'warn_format_security' undeclared (first
use in this function)
../../gcc/c-format.c:48: error: (Each undeclared identifier is reported
only once
../../gcc/c-format.c:48: error: for each function it appears in.)
../../gcc/c-format.c: In function 'check_format_info':
../../gcc/c-format.c:1304: error: 'warn_format_security' undeclared
(first use in this function)
make[2]: *** [c-format.o] Error 1
make[2]: Leaving directory `/home/andrelct/apps/llvm-gcc/build/gcc'
make[1]: *** [all-gcc] Error 2
make[1]: Leaving directory `/home/andrelct/apps/llvm-gcc/build'
make: *** [all] Error 2

Looks like you forgot to specify --enable-llvm when configuring
llvm-gcc.

Ciao,

Duncan.
_______________________________________________
LLVM Developers mailing list
LLVMdev@cs.uiuc.edu http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

Hello Duncan,

I put enable-llvm this time, but got another error.

In file included from ../../gcc/llvm-backend.cpp:23:
../../gcc/llvm-internal.h:31: fatal error: vector: No such file or directory
compilation terminated.
make[2]: *** [llvm-backend.o] Error 1
make[2]: Leaving directory `/home/andrelct/apps/llvm-gcc/build/gcc'
make[1]: *** [all-gcc] Error 2
make[1]: Leaving directory `/home/andrelct/apps/llvm-gcc/build'
make: *** [all] Error 2

Do you have an idea of what it is?

My new config is
../configure --enable-languages=c,c++,fortran,ada --disable-bootstrap
--disable-nls --disable-multilib --enable-checking
--program-prefix=llvm- --prefix=/home/andrelct/apps/llvm-gcc/build/
--bindir=/home/andrelct/apps/gnat-2007/build/bin
--enable-llvm=/home/andrelct/apps/llvm

Thanks

Hi Andre,

In file included from ../../gcc/llvm-backend.cpp:23:
../../gcc/llvm-internal.h:31: fatal error: vector: No such file or directory
compilation terminated.

line 31 of llvm-internal.h is:

#include <vector>

so if that's failing then your C++ compiler is somehow borked.
How did you arrange to use the right gcc for the build? Maybe
that's getting in the way of g++ somehow.

Do you have an idea of what it is?

I suggest you do like this: make sure the system C++ compiler is working
and in your path. To use the Ada enabled gcc for building do:
   export PATH=/home/andrelct/apps/gnat-2007/bin:$PATH
before configuring, building etc. (Assuming this is where the GNAT
GPL 2007 gcc is).

My new config is
../configure --enable-languages=c,c++,fortran,ada --disable-bootstrap
--disable-nls --disable-multilib --enable-checking
--program-prefix=llvm- --prefix=/home/andrelct/apps/llvm-gcc/build/
--bindir=/home/andrelct/apps/gnat-2007/build/bin

Not sure why you are using --bindir here?

--enable-llvm=/home/andrelct/apps/llvm

Ciao,

Duncan.

Duncan Sands wrote:

Hi Andre,

In file included from ../../gcc/llvm-backend.cpp:23:
../../gcc/llvm-internal.h:31: fatal error: vector: No such file or directory
compilation terminated.
    
line 31 of llvm-internal.h is:

#include <vector>

so if that's failing then your C++ compiler is somehow borked.
How did you arrange to use the right gcc for the build? Maybe
that's getting in the way of g++ somehow.

Do you have an idea of what it is?
    
I suggest you do like this: make sure the system C++ compiler is working
and in your path. To use the Ada enabled gcc for building do:
   export PATH=/home/andrelct/apps/gnat-2007/bin:$PATH
before configuring, building etc. (Assuming this is where the GNAT
GPL 2007 gcc is).

My new config is
../configure --enable-languages=c,c++,fortran,ada --disable-bootstrap
--disable-nls --disable-multilib --enable-checking
--program-prefix=llvm- --prefix=/home/andrelct/apps/llvm-gcc/build/
--bindir=/home/andrelct/apps/gnat-2007/build/bin
    
Not sure why you are using --bindir here?

--enable-llvm=/home/andrelct/apps/llvm
    
Ciao,

Duncan.
_______________________________________________
LLVM Developers mailing list
LLVMdev@cs.uiuc.edu http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

Hey Duncan,

my g++ is broken, but I used g++-4.3 and it worked. Unfortunately there is another problem. If I compile with llvm-gcc the ali file resulting says V "GNAT Lib v4.2" on the first line. So it compiled version 4.2 and so gnatbind and gnatlink does not work because they are version 4.1.3.

If I compile the same program using gcc of the gnat2007, the ali file says that the version is 4.1.3, the right one.

Somehow the lib version that llvm-gcc is being compiled is 4.2. Do you know how to get the 4.1.3 version?

Thanks

Hi Andre,

my g++ is broken, but I used g++-4.3 and it worked. Unfortunately there is another problem. If I compile with llvm-gcc the ali file resulting says V "GNAT Lib v4.2" on the first line.

yes, that's because llvm-gcc is based on gcc 4.2.

So it compiled version 4.2 and

so gnatbind and gnatlink does not work because they are version 4.1.3.

When you built llvm-gcc, you also built appropriate versions of gnatbind
and gnatmake. Don't mix versions: use
   export PATH=path_to_wherever_llvm_gcc_lives:$PATH
before doing stuff. Since the gnatbind and gnatmake you built should be
there too, you will use consistent versions and all will be fine.

If I compile the same program using gcc of the gnat2007, the ali file says that the version is 4.1.3, the right one.

Somehow the lib version that llvm-gcc is being compiled is 4.2. Do you know how to get the 4.1.3 version?

Version 4.1.3 is the wrong one: it is the version of GPL 2007. You
want 4.2 because that's what llvm-gcc is.

What are you trying to compile by the way?

Also, does "cd llvm_gcc_build_directory/gcc && make -k check-acats"
work? Do you get any test failures?

Ciao,

Duncan.