[CMake] Anybody using IAR compiler here ?

Alexander Neundorf a.neundorf-work at gmx.net
Tue Jun 1 16:27:23 EDT 2010


On Tuesday 01 June 2010, Jesper Eskilson wrote:
> On 05/31/2010 10:53 PM, Alexander Neundorf wrote:
> > On Monday 31 May 2010, Jesper Eskilson wrote:
> >> On 05/30/2010 02:13 PM, Alexander Neundorf wrote:
> >>> That's also ok.
> >>> Could you please post the output of the IAR AVR and ARM assemblers when
> >>> called without any arguments here ?
> >>> (or put them into http://public.kitware.com/Bug/view.php?id=10176 )
> >>
> >> The first non-empty line is for ARM and Atmel AVR, respectively:
> >>
> >>       IAR Assembler V5.41.2.51793/W32 for ARM
> >>       IAR Assembler V5.50.0.50277/W32 for Atmel AVR
> >
> > Thanks :-)
> >
> > While we are at it, do the C and C++ compilers behave the same way, i.e.
> > print the version information when called without arguments ?
>
> Yes.
>
> > How does that output look like then ?
>
>     IAR ANSI C/C++ Compiler V5.41.2.51793/W32 for ARM
>     IAR C/C++ Compiler V5.50.0.50277/W32 for Atmel AVR

Thanks :-)

> > Does it differ between the AVR and ARM compilers ? They seemed to be
> > quite different in their command lines etc.
>
> They do differ a bit in their command lines, mostly depending on the
> different capabilities. One such difference is that ARM is ELF/Dwarf
> based, and the AVR-compiler uses the Ubrof object file format.

I didn't find any documentation of the ubrof format online. Is it available 
somewhere ?
The issue I had was with the way how cmake tries to find out what kind of 
compiler it has at hand (the "compiler ID").
It does that by compiling a file which has code like

...
#elif defined(__SUNPRO_CC)
# define COMPILER_ID "SunPro"
...
#endif

and then does something with that string, so that the string should end up as 
it is in the compiled object file.
But instead of finding the plain string in the binary files, I got hex code 
like this for a string "Hello world":

 0000:0740 00 00 00 00 c7 04 00 00 00 00 36 48 36 65 36 6c ....Ç.....6H6e6l
 0000:0750 36 6c 36 6f 36 2c 36 20 36 77 36 6f 36 72 36 6c 6l6o6,6 6w6o6r6l
 0000:0760 36 64 36 00 c7 05 00 00 00 00 61 00 00 00 00 60 6d6.Ç.....a....`
 
So this contains "6H6el6l6o6,6 6w6o6r6l6d6." which is "Hello world" with "6"s 
inbetween.
What are the "6"s doing there ? Are they 1-byte assembler instructions ? Or 
are all strings stored like that ?
The first "6" is at offset 0x074a, so this is an even address. So the bytes 
which contain the actual text are at odd offsets. Strange.

Do you know why this is so ?

Alex


More information about the CMake mailing list