Mombu the Programming Forum

Go Back   Mombu the Programming Forum > Programming > Please help... troubleshooting Gnat AVR build
User Name
Password
REGISTER NOW! Mark Forums Read




Reply Bookmark and Share
1 7th August 20:11
steve d
External User
 
Posts: 1
Default Please help... troubleshooting Gnat AVR build



I'm trying to build Gnat for AVR following the instructions on the AVR-Ada
site using the build scrpt described at:
http://avr-ada.wiki.sourceforge.net/BuildScript

I'm using XP on a Virtual Box VM so I have tight control over the
environment (without messing up my main system). It also allows me to start
clean so that when I'm done I should be able to make correct instructions
for the next guy.

I installed GnatGPL 2009 to do the build.

There were a number of errors in the Gnat source code that were identified
by the 2009 compiler, and I put togther a patch file that fixes the sources,
so the compiler builds.

If I understand correctly I am successfully creating a compiler but getting
a failure when building the AVR-Ada libs.

Looking at the log file for step 13 I have a bunch of lines like:

avr-gcc -c -g -Os -gnatn -gnatpg -mmcu=at90can128 -I- -Iadainclude
adainclude/s-bitops.adb
cp s-bitops.o adalib
avr-gcc -c -g -Os -gnatn -gnatpg -mmcu=at90can128 -I- -Iadainclude
adainclude/ada.ads
cp ada.ali adalib
avr-gcc -c -g -Os -gnatn -gnatpg -mmcu=at90can128 -I- -Iadainclude
adainclude/interfac.ads
....

Which makes me think that the compiler basically works.

But in the step 14 log file I have:

avr-gcc -c -gnatec=C:\AVR-ADA\build\avr-ada-1.0.2\avr\gnat.adc -gdwarf-2 -gnatwp
-gnatwu -gnatn -gnatp -gnatVn -Os -gnatef -fverbose-asm -frename-registers
-mmcu=at90can128 -fdata-sections -ffunction-sections --RTS=rts/at90can128 -I-
-gnatA C:\AVR-ADA\build\avr-ada-1.0.2\avr\avr_lib\at90can128\avr-mcu.ads
avr-gnatmake: "avr-mcu.ali" incompatible ALI file, please recompile

I found the source of the error message in the file: make.adb

ALI :=
Scan_ALI (Lib_File, Text, Ignore_ED => False, Err =>
True);

if ALI = No_ALI_Id then

-- Record a failure only if not already done

if Compilation_OK then
Inform
(Lib_File,
"incompatible ALI file, please recompile");
Record_Failure (Full_Source_File, Source_Unit);
end if;
else

The function Scan_ALI is located in ali.adb.

I looked at the .ali file
C:\AVR-ADA\build\avr-ada-1.0.2\avr\avr_lib\at90can128\obj\avr-mcu.ali and
walked through the source code of Scan_ALI by hand until I get to the line:

R rnnnnnnnnnrnrrnrnnrrnnrnnnnnrrnrnnrnnrrnnnrnrrnnvr rrrnvvnnrnnnnnnnnnnr1nnn

This line encodes the set of "restrictions" for the compiler. The format of
this line is described in lib-writ.ads.

The first 23 characters (if I counted correctly, which I did several times)
are
"All_Boolean_Restrictions" which are defined in restrict.ads.

Following the first 23 chars what I should find is a bunch of two part
sequences where the first part of the sequence is either the letter 'n' or
the letter 'r' followed by some number of digits (a natural number) and the
second letter is either the letter 'n' or the letter 'v' followed by some
number of digits (a natural number).

Breaking that original line down to separate the sequences, you can see that
in the 3rd sequence the second character is a r, which is (my best guess)
what is causing the error.

R rnnnnnnnnnrnrrnrnnrrnnr nn nn nr rn rn nr
nnrrnnnrnrrnnvrrrrnvvnnrnnnnnnnnnnr1nnn

The gnat compiler (gnat1drv) uses the function Write_ALI in lib-writ.adb to
write the .ali file and around line 1025 writes the series of pairs. I
cannot see a way that the sequence I'm seeing could be generated by this
code.

Can anyone please point me in the right direction? I'm stuck.

Thanks,
Steve
  Reply With Quote


 


2 7th August 20:11
stephen leake
External User
 
Posts: 1
Default Please help... troubleshooting Gnat AVR build



"Steve D" <nospam_steved94@comcast.net> writes:

I get this when I first compile with one version of GNAT, and then
compile in the same directory with a later version of GNAT. The
solution in that case is to delete all .ali files, and start again
with the right compiler.

I know you said you have tight control over the environment, but maybe
check again? At least make sure you have no .ali files around when you
start compiling.

Maybe you're mixing the cross compiler ali files with the native ones?

Otherwise, you've found a compiler bug.

--
-- Stephe
  Reply With Quote


 


3 22nd August 11:10
steve d
External User
 
Posts: 1
Default Please help... troubleshooting Gnat AVR build


Do you know (by chance) how Gnat chooses the locations to include in the
build (outside of the -I directives in the command line)?

For example: if I write a simple native (non-cross) "Hello, world" program,
the compiler doesn't have any trouble finding Ada.Text_IO with nothing extra
specified on the command line. Is there some kind of an "nostdinc" fo Ada?
TIA, Steve
  Reply With Quote
4 22nd August 11:10
john b. matthews
External User
 
Posts: 1
Default Please help... troubleshooting Gnat AVR build


Look for section "3.3 Search Paths and the Run-Time Library (RTL)".*


Both -nostdinc & -nostdlib are recognized by gnatmake.*
*<http://gcc.gnu.org/onlinedocs/gcc-4.4.0/gnat_ugn_unw/>

--
John B. Matthews
trashgod at gmail dot com
<http://sites.google.com/site/drjohnbmatthews>
  Reply With Quote
Reply


Thread Tools
Display Modes


Some other forums that might be of your interest : Development, Ada, Apple script, Assembler, Awk, Beos, Basic, C, C++, C#, C# .net, .net, .net frameworks, Asp .net, Clarion, Clipper, Clos, Clu, Cobol, Coldfusion, Delphi, Dylan, Eiffel, Forth, Fortran, Haskell, Hermes, Icon, Idl, Java, Java script, Jscript .net, Jcl, Linoleum, Lisp, Lotus, Limbo, Logo, Ml, Mumps, Oberon, Postscript, Pop, Pl1, Prolog, Python, Ruby, Pascal, Perl, Php, Rebol, Rexx, Sed, Sather, Scheme, Smalltalk, Tcl, Vhdl, Vrml, Visual basic, Visual basic .net, Yorick, Mysql, Omnis, Postgresql, Xbase, Access, Oracle, Adabas, Berkeley, Btrieve, Filemaker, Gupta, Db2, Informix, Ingres, Mssql server, Object, Olap, Paradox, Rdb, Revelation, Sybase, Theory, Dbase, Html, Java script, Css, Flash, Photoshop, Corel script, Xml, Tech, Beos, Gem, Hp48, Hpux, Linux, Mac, Ms-dos, Os2, Palm, Solaris, Ti99, Windows, Xenix, Aos, Chorus, Geos, Inferno, Lantastic, Lynx, Mach, Minix, Netware, Os9, Parix, Plan9, Psos, Qnx, Xinu, Sco, Unix, Aix, Aux, 386bsd, Bsdi, Freebsd, Netbsd, Openbsd, Ultrix, Amd, Intel, Aptiva, Buz, Deals, Homebuilt, Overclocking, Programming, Extra forums


Copyright © 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666