This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Problems with egcs on Unixware 7 system
- To: Graham Simms <graham at muscat dot com>
- Subject: Re: Problems with egcs on Unixware 7 system
- From: Robert Lipe <robertlipe at usa dot net>
- Date: Fri, 8 Jan 1999 11:12:30 -0600
- Cc: egcs at egcs dot cygnus dot com
- References: <369622D6.D7544F08@muscat.com>
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