[LLVMdev] LLVM-gcc for Ada
Roger Mc Murtrie
rogermc at iinet.net.au
Thu Mar 4 21:21:47 PST 2010
I am trying to build llvm-gcc-4.2 but cannot figure out how to get past the problem described below.
Any help will be much appreciated.
Regards
Roger
gnatbind -C -I- -I. -Iada -I../../llvm-gcc-4.2/gcc/ada -o ada/b_gnat1.c -n ada/gnat1drv.ali
error: "s-imenne.adb" must be compiled
error: ("/opt/gnat-gpl-2009/lib/gcc/i386-apple-darwin10.2.0/4.3.4/adalib/s-imenne.ali" is obsolete and read-only)
error: "s-imenne.adb" and "gnat1drv.adb" compiled with different exception handling mechanisms
make[2]: *** [ada/b_gnat1.c] Error 5
make[1]: *** [all-gcc] Error 2
make: *** [all] Error 2
Also occurs for /opt/gnat-gpl-2009/bin/gnatbind
System:
Model Name: Mac mini
Model Identifier: Macmini1,1
Processor Name: Intel Core Duo
Processor Speed: 1.66 GHz
Number Of Processors: 1
Total Number Of Cores: 2
Mac OS X 10.6.2
XCode 3.2.1
Following is what have had to do to get up to the binding stage:
Based on http://llvm.org/docs/GCCFEBuildInstrs.html#ada
and llvm-gcc-4.2/README.LLVM
Top level directory: llvm
Sub-directories:
llvm (svn)
llvm-gcc-4.2 (svn)
mkdir llvm-objects
mkdir llvm-gcc-4.2-objects
mkdir install
mkdir install/lib
Built and installed llvm without problems.
In install/lib:
ln -sf /usr/lib/libstdc++.6.dylib .
ln -sf /usr/lib/libstdc++.6.dylib libstdc++.dylib
export CC=/opt/gnat-gpl-2009/bin/gcc
export CXX=/usr/bin/g++
EXTRALANGS=,ada,fortran,objc,obj-c++
export TRIPLE=i686-apple-darwin10
In llvm-gcc-4.2/gcc/Makefile.in
change all occurrences of -mdynamic-no-pic
to -dynamic-no-pic
In config/mh-x86-darwin
change BOOT_CFLAGS=-g -O2 -mdynamic-no-pic
to BOOT_CFLAGS=-g -O2 -dynamic-no-pic
in gcc/ada/ali.adb at line 1692
change Add_Char_To_Name_Buffer (nul);
to Add_Char_To_Name_Buffer (NUL);
in gcc/ada/errout.adb at line 1782
change if Name_Buffer (J) = ASCII.Nul then
to if Name_Buffer (J) = ASCII.NUL then
and many other similar "STYLE" problems.
How to stop warnings being treated as errors? --disable-werror seems to work for some things but not these Ada compiles.
../llvm-gcc-4.2/configure --prefix=/usr --enable-languages=ada,c,fortran,objc,obj-c++ --enable-checking --enable-llvm=$PWD/../llvm-objects --disable-bootstrap --disable-multilib --disable-werror --with-gxx-include-dir=/usr/include/c++/4.2.1 --build=$TRIPLE --host=$TRIPLE --target=$TRIPLE --with-gmp=/usr/local --with-mpfr=/usr/local --with-libiconv-prefix=/usr/local
Had to do this to get the right gnatmake:
In llvm-gcc-4.2-objects/gcc/ada/Make-lang.in
declare:
gnatmake = /opt/gnat-gpl-2009/bin/gnatmake
For all targets ada/treeprs.ads through ada/nmake.ads
Change gnatmake -q
to $(gnatmake)
More information about the llvm-dev
mailing list