Building RTEMSAda for PowerPC MVME6100 - rtems-testing, gcc-svn, and socket.c

Michael Gurlitz michael.gurlitz at
Thu Jul 15 15:18:51 UTC 2010

Hello RTEMS community, I have been tasked with compiling a
powerpc-rtems-gnat toolchain for use on a MVME6100. I have been
working on an ArchLinux VM, though ultimately I'd like to have a
toolchain for Cygwin. I was initially successful in building RTEMS
with C/C++, and I have successfully built and loaded .exe files into
psim and .ralf files onto the board. However, building a GNAT cross
compiler has proved quite difficult. I've talked with Joel and
Sebastian in irc, and I hope someone here may provide some insight
into this issue. Sebastian alluded to similar issues on coldfire, and
if I can't figure this out I may recommend my manager look into a
commercial solution. I believe he already uses the VxWorks solutions,
so I don't know if this would be worthwhile for him. Honestly I don't
need a perfect solution, and I would be ecstatic if anyone is certain
that a specific combination of gcc-4.x and rtems4.y would work.

A relevant comment I found in gsocket.h is:
>  * RTEMS has these .h files but not until you have built and installed
>  * RTEMS. When building a C/C++ toolset, you also build the newlib C library.
>  * So the build procedure for an RTEMS GNAT toolset requires that
>  * you build a C/C++ toolset, then build and install RTEMS with
>  * --enable-multilib, and finally build the Ada part of the toolset.
The problem is that this comment, the RTEMSAda wiki article, and
gcc/do_one aren't completely consistent.

Joel suggested I use the scripts in rtems-testing/gcc/, but these
failed in the same way my own attempts did:
I was pretty desperate, so I "fixed" this by changing the line "#ifdef
VMS" to "#if defined(VMS) || defined(__rtems__)" in socket.c, which
did compile. Next g-socket.adb failed, with a duplicate case error (I
didn't save this error). I deleted ESHUTDOWN on line 1791, which
worked. Amazingly, i eventually had (and have) gnat executables, but I
suspect they were miscompiled because I can't get the hello_world
example to work:
> powerpc-rtems4.11-gcc --pipe -B/home//b/rtems-testing//install-4.5.0/powerpc-rtems4.11/beatnik/lib/ -specs bsp_specs -qrtems   -mcpu=7400 -D__ppc_generic   -Dbeatnik -I. -mcpu=7400 -D__ppc_generic  -c ../rtems_init.c
> powerpc-rtems4.11-gnatmake -mcpu=7400 -D__ppc_generic  -g -v  \
>            -I/home//b/rtems-testing/install-4.5.0/powerpc-rtems4.11/beatnik//lib/include/adainclude \
>            -O -gnata -gnatE -gnato -g hello -o hello.exe \
>            -bargs -Mgnat_main \
>            -largs -B/home//b/rtems-testing/install-4.5.0/powerpc-rtems4.11/beatnik//lib/ -specs=bsp_specs -qrtems -mcpu=7400 -D__ppc_generic   -Dbeatnik  \
>                rtems_init.o  \
> Message: make.adb:7473
> powerpc-rtems4.11-gnatmake: INTERNAL ERROR. Please report.

* Note on gcc/do_one for Joel: I noticed that rtems is built and
installed twice in succession, once with `--enable-multilib`, then the
next time with `--disable-multilib --enable-rtemsbsp="..."`. Could you
explain why it does this? Also, is there a way to build multiple BSP's
with this method?

I found that socket.c and other networking files were rewritten in
gcc-svn, so I tried a build from the trunk. I don't have the build
errors at the moment, but this failed cryptically while compiling Ada
files. Regardless, I'd prefer a stable compiler since I won't be the
person maintaining this.

Michael Gurlitz
Aerospace Corporation

More information about the users mailing list