stdc++ (cout) problem with RTEMS on Sparc emulator

Chris Johns chrisj at rtems.org
Wed Dec 15 23:41:32 UTC 2004


Courtney B. Duncan wrote:
> 
> I think /usr/local/erc32/sparc-rtems/lib/libstdc++.a is the correct one 
> and it is the one being linked.  All the permutations of 'revb' 'soft' 
> and 'v8' are also present, and I've tried them with the same result 
> (doesn't work).  The emulator says that it is V7, Rev C. and has FPU, so 
> I don't think I need those other versions.
> 

Ok.

> 
> I have verified that use of the #include file and linking with -lstdc++ 
> don't cause the problem, it is when something from the library is used 
> and part of it is actually pulled in that everything quits.  A single 
> line like
> 
> cout << "something";
> 
> or
> 
> vector<int> something;
> 
> will do it.  By disassembling from the start point at 0x02000000, I see 
> that pulling in the library radically changes the startup code, causing 
> it to jump immediately to memory without valid instructions.
> 

Hmmm, I would check the start up files such as:

  crtbegin.o, crtend.o, crti.o, crtn.o

These are linked in to run the static constructor list via the _init 
call (assuming ELF). You can find this call in:

  cpukit/score/src/threadhandler.c

The files listed above need to be correctly multilib'ed to work. I 
thought they were always linked in so the start up code should be the same.

Is it possible to set a break point here to see what happens ?


If this is the problem check the list of static constructors is correct. 
A failure of this type typically points to a link command file issue.

-- 
  Chris Johns



More information about the users mailing list