RTEMS C++ Issues

Robert S. Grimes rsg at alum.mit.edu
Wed Jun 27 14:41:54 UTC 2007


Hi,

I have a problem with C++ and a new BSP for the Virtex PowerPC.  I can
successfully build and run C++ programs, as long as I don't use any globally
constructed objects.

Now, I'm working with the cdtest program, which tests constructors, destructors,
iostream, and exceptions; to keep it simple for now, I'm not enabling the
iostream tests.  Of course, at this point, the constructors and destructors for
auto objects works fine, but no constructors are called for the global objects

So, I'm trying to implement the code from the wiki (see
http://www.rtems.com/wiki/index.php/Using_C_Plus_Plus), but I unfortunately
don't know enough still about automake, autoconf, and the RTEMS build
system.  I tried to adapt another PowerPC BSP (ep1a) that seemed to use this
approach, specifically the shared file powerpc/shared/start/rtems_crti.S, but
I'm running into problems during the BSP build; this is the output:

  Making all in hello
  make[5]: Entering directory
`/home/dev/rtems/tools/b-rtems/powerpc-rtems/c/virtex/testsuites/samples/hello'
  powerpc-rtems-gcc -B../../../../../virtex/lib/ -specs bsp_specs -qrtems
mcpu=403 -Dppc405 -Dvirtex -O4 -fno-keep-inline-functions -g      -o hello.exe
init.o ../../../../../virtex/lib/no-dpmem.rel
../../../../../virtex/lib/no-event.rel ../../../../../virtex/lib/no-msg.rel
../../../../../virtex/lib/no-mp.rel ../../../../../virtex/lib/no-part.rel
../../../../../virtex/lib/no-signal.rel ../../../../../virtex/lib/no-timer.rel
../../../../../virtex/lib/no-rtmon.rel
  /usr/rtems/4.8/lib/gcc/powerpc-rtems/4.1.1/../../../../powerpc-rtems/bin/ld:
rtems_crti.o: No such file: No such file or directory
  collect2: ld returned 1 exit status
  make[5]: *** [hello.exe] Error 1
  make[5]: Leaving directory
`/home/dev/rtems/tools/b-rtems/powerpc-rtems/c/virtex/testsuites/samples/hello'

As you can see, the BSP seems to build fine, but the first sample program that
is built with the bsp fails, because it doesn't know where to find the
rtems_crti.o file.  I don't know how to tell the linker where to find this file,
which most certainly does exist - specifically, in powerpc/virtex.

Seems the problem could be in the Makefile.am, Makefile.in, or the bsp_specs
file, none of which I really understand well enough to fix.

I think the answer is probably pretty simple, at least for you guys, but
it's clearly a bit out of reach for me...

FWIW - I also tried building the ep1a BSP, and it didn't work - in some other
seemingly unrelated way.  I'm currently trying some others, and will report the
results...

Thanks!
-Bob

P.S. Oh, yeah, and exceptions don't work either - it kicks my application out,
and hits the fatal error at the end of boot_card (IIRC).  Right now, not too
worried about that, but I'll probably be asking about it later, so feel free to
comment now!



More information about the users mailing list