JP | 19 Jul 20:34 2011

Testing lm32 GCC on either qemu or milkymist

How is testing of lm32 GCC handled?  It appears that doing "make check 
RUNTESTFLAGS=execute.exp" doesn't execute any tests.  Has the GCC 
testsuite been run on either qemu or a real board?  If so, how is it done?

JP
Sebastien Bourdeauducq | 19 Jul 21:32 2011

Re: Testing lm32 GCC on either qemu or milkymist

On Tue, 2011-07-19 at 11:34 -0700, JP wrote:
> How is testing of lm32 GCC handled? 

Short answer: it is not handled. But it should. So many things to do...
It would be very cool if you get the test suite to work! :)

Have you been able to resolve your QEMU problems?

JP | 19 Jul 22:12 2011

Compiler testing

I want to compile and run very simple tests for the compilers (GCC and 
LLVM).  How do I build a simple program _without_ RTEMS and load it into 
qemu?

- What's the full compile/link command?
- How do load and run the program in qemu?

  I tried using the "lightweight toolchain" lm32-elf-gcc: 
http://www.milkymist.org/wiki/index.php?title=Compiling_a_lightweight_Mico32_toolchain
but the trivial "lm32-elf-gcc hello.c -o hello" didn't link properly.

MacBook-Pro:tmp jpbonn$ lm32-elf-gcc hello.c -o hello
hello.c: In function ‘main’:
hello.c:5:1: warning: incompatible implicit declaration of built-in 
function ‘printf’
/usr/mico32/lib/gcc/lm32-elf/4.5.3/../../../../lm32-elf/bin/ld: cannot 
find -lgcc
/usr/mico32/lib/gcc/lm32-elf/4.5.3/../../../../lm32-elf/bin/ld: cannot 
find crti.o
/usr/mico32/lib/gcc/lm32-elf/4.5.3/../../../../lm32-elf/bin/ld: cannot 
find crtbegin.o
/usr/mico32/lib/gcc/lm32-elf/4.5.3/../../../../lm32-elf/bin/ld: cannot 
find crtend.o
/usr/mico32/lib/gcc/lm32-elf/4.5.3/../../../../lm32-elf/bin/ld: cannot 
find crtn.o
/usr/mico32/lib/gcc/lm32-elf/4.5.3/../../../../lm32-elf/bin/ld: cannot 
find -lgcc
collect2: ld returned 1 exit status
MacBook-Pro:tmp jpbonn$
(Continue reading)

Sebastien Bourdeauducq | 19 Jul 22:23 2011

Re: Compiler testing

On Tue, 2011-07-19 at 13:12 -0700, JP wrote:
> I want to compile and run very simple tests for the compilers (GCC and 
> LLVM).  How do I build a simple program _without_ RTEMS and load it into 
> qemu?
> 
> - What's the full compile/link command?

Have a look at programs like the Milkymist BIOS and the demo firmware,
which are built without RTEMS. They are in the milkymist/milkymist (SoC)
repository on Github. The Makefiles use the -rtems4.11 toolchain, but
they should work as well with the -elf toolchain (in fact, they pass
options to the compiler to disable OS-specific features).

> - How do load and run the program in qemu?

qemu-system-lm32 -M milkymist -kernel <ELF file>
more options: 
http://www.milkymist.org/wiki/index.php?title=Using_QEMU

>   I tried using the "lightweight toolchain" lm32-elf-gcc: 
> http://www.milkymist.org/wiki/index.php?title=Compiling_a_lightweight_Mico32_toolchain
> but the trivial "lm32-elf-gcc hello.c -o hello" didn't link properly.

Yes, the -elf compiler does not have a C library. Such a library is
searched for automatically by the -rtems4.11 compiler, and explicitly
specified by the BIOS/demo build scripts.

S.

(Continue reading)

Sebastien Bourdeauducq | 19 Jul 22:25 2011

Re: Compiler testing

On Tue, 2011-07-19 at 22:23 +0200, Sebastien Bourdeauducq wrote:
> > - How do load and run the program in qemu?
> 
> qemu-system-lm32 -M milkymist -kernel <ELF file>
> more options: 
> http://www.milkymist.org/wiki/index.php?title=Using_QEMU

And if you want the serial console on the terminal from which you
launched QEMU, which is usually convenient, add "-serial stdio".

JP Bonn | 19 Jul 21:58 2011

Re: Testing lm32 GCC on either qemu or milkymist

On 7/19/11 12:32 PM, Sebastien Bourdeauducq wrote:
 > On Tue, 2011-07-19 at 11:34 -0700, JP wrote:
 >> How is testing of lm32 GCC handled?
 >
 > Short answer: it is not handled. But it should. So many things to do...
 > It would be very cool if you get the test suite to work! :)

OK, that's the conclusion I came to.

 > Have you been able to resolve your QEMU problems?

Yes. I have a working qemu/lm32 gcc/flickernoise built on OS X.  I've 
documented everything on the wiki and updated the scripts. (I noticed 
the spelling fixes :)


Gmane