From mboxrd@z Thu Jan 1 00:00:00 1970 From: hjl@lucon.org (H.J. Lu) To: jodyg@idt.net Cc: egcs@cygnus.com Subject: Re: problems with the recent snapshot (971207) (Solved) Date: Tue, 09 Dec 1997 00:46:00 -0000 Message-id: References: <19971208222126.19112@tymbri> X-SW-Source: 1997-12/msg00526.html > > On Mon, Dec 08, 1997 at 05:05:56PM -0800, H.J. Lu wrote: > > > /tmp/cca294841.o:/home/phenning/EGCS/Build/build/libraries/libstdc++/testsuite/../../../../egcs-971207/libstdc++/testsuite/../std/bastring.h:148: undefined reference to `ostream & operator<<, __default_alloc_template >(ostream &, basic_string, __default_alloc_template > const &)' > > > [plus a lot of other similar errors] > > > > > > so, tstring.cc compilation and tstring.cc -O compilation fail unexpectedly. > > > > > > What else can I provide to help resolve this? > > > > Same here on i586-linux-gnu. But it was ok on i586-linux-glibc1. > > Since egcs 971207 miscompiles things on x86, it is not that strange. > > > > The patch I submitted for bastring is the source of these problems. If > you look at the error messages carefully you'll notice > > undefined reference to `ostream & operator<<, > __default_alloc_template > ^^^^^ > >(ostream &, basic_string, > __default_alloc_template > const &)' > ^^^^^ > In the library you find > basic_string, > __default_alloc_template > > ^^^^^ > > The issue is the -D_PTHREAD during the compilation of sinst.cc. > This causes the thread safe allocator to be used by default under Linux > glibc2. However, _PTHREAD is NOT defined when tstring.cc is compiled and > it attempts to use the NON-thread safe allocator which was not instantiated > in libstdc++. > > I mentioned this issue with the patch but did not have a solution. > > What version(s) should go into the library ? SGI uses _PTHREAD in the stl > and egcs defines it for linux in libstdc++/config/linux.mt. How should it be > defined for general programs ? > I don't like to link with -lpthread for my single thread program. Can we have both in libstdc++, like compiling anything which includes twice? # .... -D_PTHREAD -c -o stlinst.omt stlinst.cc # .... -c -o stlinst.o stlinst.cc Will it work? -- H.J. Lu (hjl@gnu.org)