c++ stl in l4/pkg/libstdc++

Frank Mehnert fm3 at os.inf.tu-dresden.de
Wed Aug 17 13:35:07 CEST 2005


Hi Bert,

On Wednesday 17 August 2005 11:03, Bert van Leeuwen wrote:
> Can somebody (Frank?) please give me some pointers on how to replace
> the STL in  l4/pkg/libstdc++ for gcc 3.3.x (i.e.
> /l4/pkg/libstdc++/lib/src-v3 and
> l4/pkg/libstdc++/contrib/libstdc++-v3)? It seems to be rather an old
> version, and I would like to try a newer version to eliminate possible
> sources of error in my program. I tried just replacing
> drops/include/c++/3.3 with the STL on my box, but that gave hundreds
> of compile errors.
>
> (My program is hanging sporadically, and everytime I get a backtrace
> into the hung thread, it is somewhere inside STL list. I cannot
> reproduce this behaviour in linux, only in L4, so I want to see if
> replacing the STL with a newer version will help)

Upgrading the libstdc++ is rather time-consuming.  The latest supported
version is taken from an early gcc-3.4. To port the libstdc++ to L4env,
the configure script has to be executed and the appropriate architecture
has to be specified. See libstdc++/lib/src-6/Makefile.

The configure script then tries to use <architecture>-{gcc,g++,..} for
compiling the library. That is the (only) purpose of the l4/tools/gcc-wrap
package. That gcc links against several L4env packages. The configure
script uses small source files to detect if functions are available or not.

So you first have to get it work, the libstdc++ configure has to support
the drops architecture (which means linking against L4env and OSKit). To
get a feeling what of the library has to be changed, look at the gcc-3.3
version in contrib/libstdc++-v3:

  $ cd l4/pkg/libstdc++/contrib/libstdc++-v3
  $ cvs diff -r1.1.1.1 -rHEAD

(Unfortunately, the gcc-3.4 version of libstdc++ is not imported in its
original form).

I would suggest you to import the new libstdc++ into a new directory in
contrib, then add a new directory in lib and then try to apply the patches
to the libstdc++ you've seen from the CVS diff. After that, try to compile
the thing and look what's happen and try to fix the problems.

Note: the libstdc++ package is ported using the OSKit10! And that piece of
software will most probably not build against gcc-4. Perhaps you could try
to link against the dietlibc -- then you have to adapt gcc-wrap at first.
Make sure that "make test" in gcc-wrap performs well. In fact, the program

  int main(void) { printf ("hello world"); }

should be compilable using gcc-wrap/drops-gcc without errors. After that,
start looking at the libstdc++.

Frank
-- 
## Dept. of Computer Science, Dresden University of Technology, Germany ##
## http://os.inf.tu-dresden.de/~fm3                                     ##
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://os.inf.tu-dresden.de/pipermail/l4-hackers/attachments/20050817/dae5c0c4/attachment.sig>


More information about the l4-hackers mailing list