public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: Problems with egcs on Unixware 7 system
  1999-01-31 23:58 Problems with egcs on Unixware 7 system Graham Simms
@ 1999-01-31 23:58 ` Robert Lipe
  0 siblings, 0 replies; 2+ messages in thread
From: Robert Lipe @ 1999-01-31 23:58 UTC (permalink / raw)
  To: Graham Simms; +Cc: egcs

This failure form has been present in EGCS for a while.  Your test
case fails on both of the SCO ELF targets that I have ready access to.
(OpenServer 5 and UDK, which is essentially the Unixware 7 SDK) Only
a small percentage of the testsuite fails in this way.  Something in
the .weak handling seems to have gone wrong.  I haven't yet been able
to figure out if it is an EGCS thing, an assembler thing, a linker
thing, or some interaction amongst all of them.  From the reports in the
testsuite list, I suspect that many systems populated with non-GNU tools
may be affected.

It's been on my TODO list to build a Linux .S file from one of these
test cases and start smooshing it into the SCO environment, then
replacing various SCO components with GNU equivalents to see if I can
find the exact reason we don't see this on Linux.  I just haven't made
it that far and am unlikely to do so for a few weeks.

I suspect that the thing that isn't going right is this generated assembly:

        .size    __malloc_alloc_template<0>::deallocate(void *, unsigned int),.-
__malloc_alloc_template<0>::deallocate(void *, unsigned int)                   
        .align 4
        .weak   basic_string<char, string_char_traits<char>, __default_alloc_tem
plate<false, 0> >::rep(void) const                                             
        .type    basic_string<char, string_char_traits<char>, __default_alloc_te
mplate<false, 0> >::rep(void) const,@function                                  
basic_string<char, string_char_traits<char>, __default_alloc_template<false, 0>
>::rep(void) const:
.LFB34:
        pushl %ebp


I don't at all understand this, becuase if you look at the .o, it looks
like all the template functions (nm t.o | c++filt | grep 'template') are
indeed weak.






> // test.cxx
> #include <iostream>
> #include <string>
> 
> int main(void)
> {
>      cout << "Hello\n";
> 
>      string s = "World\n";
> 
>      cout << s;
> }                 
> 
> gives the following error:
> 
> g++ test.cxx -o test
> 
> UX:ld: ERROR: /usr/local/egcs111new/lib/libstdc++.a(cstrmain.o): fatal
> error: symbol `basic_string<char, string_char_traits<char>,
> __default_alloc_template<0, 0> >::rep(void) const` multiply-defined, also in
> file /usr/tmp/ccNqGaRz.o
> collect2: ld returned 1 exit status


> I'm wondering if there is anyone out there with experience of using egcs of
> Unixware 7 who may be able to help. I've searched the egcs web site and

It works pretty well - in fact, this failure hasn't always happened.

RJL

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Problems with egcs on Unixware 7 system
@ 1999-01-31 23:58 Graham Simms
  1999-01-31 23:58 ` Robert Lipe
  0 siblings, 1 reply; 2+ messages in thread
From: Graham Simms @ 1999-01-31 23:58 UTC (permalink / raw)
  To: egcs

I am currently attempting to port an application written in c++ which
successfully compiles and runs using egcs under Linux and Solaris to
Unixware 7.

I am not totally familiar with the Unixware enviroment which may explain why
I am finding it difficult to get a working egcs compiler built. I can
successfully build egcs 1.1.1 but when I attempt to build a non-trivial c++
program it falls over on linking.

For example, the following program:

// test.cxx
#include <iostream>
#include <string>

int main(void)
{
     cout << "Hello\n";

     string s = "World\n";

     cout << s;
}                 

gives the following error:

g++ test.cxx -o test

UX:ld: ERROR: /usr/local/egcs111new/lib/libstdc++.a(cstrmain.o): fatal
error: symbol `basic_string<char, string_char_traits<char>,
__default_alloc_template<0, 0> >::rep(void) const` multiply-defined, also in
file /usr/tmp/ccNqGaRz.o
collect2: ld returned 1 exit status

I'm wondering if there is anyone out there with experience of using egcs of
Unixware 7 who may be able to help. I've searched the egcs web site and
can't find any ducumentation that helps, I've even tried installing a binary
distribution of egcs 1.0.1 and that didn't help either which implies that it
may be a linking problem.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1999-01-31 23:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-01-31 23:58 Problems with egcs on Unixware 7 system Graham Simms
1999-01-31 23:58 ` Robert Lipe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).