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

Joel Sherrill joel.sherrill at
Thu Jul 15 15:33:41 UTC 2010

On 07/15/2010 10:18 AM, Michael Gurlitz wrote:
> 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:
I have run into the compilation issue before.  I don't remember if
I resolved it or not.  It wasn't much.
>> 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.
I haven't built 4.5.0.  I will give it a whirl and post back.
> * 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?
This one is simple.  During the tool build the multilib is
needed to ensure you get the .h files into a place where
the "normal" cross builds will see them without adding
to the include path.

But you want the BSPs installed so you can actually (later)
link executables.
> 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.
Understandable.  There was good luck with gcc 4.4.x and Ada.
I believe that was what we used for SIGAda last year.
> Regards,
> Michael Gurlitz
> Aerospace Corporation
> _______________________________________________
> rtems-users mailing list
> rtems-users at

Joel Sherrill, Ph.D.             Director of Research&  Development
joel.sherrill at        On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
    Support Available             (256) 722-9985

More information about the users mailing list