![]() |
|
|
|
|
1
7th August 20:11
External User
Posts: 1
|
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 |
|
|
|
|
|