target/5505: Doubts about a patch for OSF

kreckel@ginac.de kreckel@ginac.de
Sun Jan 27 07:45:00 GMT 2002


>Number:         5505
>Category:       target
>Synopsis:       Doubts about a patch for OSF
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Jan 27 06:26:00 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Richard B. Kreckel
>Release:        gcc-3.0.1, gcc-3.0.2, gcc-3.0.3
>Organization:
>Environment:
alphaev5-dec-osf5.1
>Description:
This patch:

> Mon Jul 16 19:57:19 2001  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
> 
>       * config/alpha/osf.h (ASM_OUTPUT_WEAK_ALIAS, ASM_WEAKEN_LABEL,
>       HANDLE_SYSV_PRAGMA): Define.
>       * mips-tfile.c (add_ext_symbol): Pass complete symbol ptr, inline
>       previous args.
>       (copy_object): Caller changed.
> 
>       testsuite:
>       * g++.old-deja/g++.pt/static3.C: Removed alpha*-*-osf* XFAIL.
>       g++.old-deja/g++.pt/static6.C: Likewise.
>       * lib/target-supports.exp (check_weak_available): alpha*-*-osf*
>       supports weak symbols.
[...]

seems to break the CLN library [0] on `alphaev5-dec-osf5.1'.  The
patch went into GCC 3.0.1 and is still there in GCC 3.0.3.  I have
reverted it from an otherwise vanilla GCC 3.0.1, 3.0.2 and 3.0.3,
bootstrapped that and everything works fine again.

The symptoms during compilation are:

With a vanilla g++ I frequently get obscure warnings like this one:
    as1: Warning: /tmp/ccL7IbTO.s, line 6: macro instruction used $at 
whereas with the patch reverted I don't see any of these.  These are
still mere warnings, though...

When creating the static library with the vanilla compiler I find that it
is 8% larger than with the patch reverted and I also get tons of warnings
of this kind:

ar: Warning: ignoring second definition of _ZN3cln8NDS_to_IEPKmm defined in archive

Having a look at the .o files where that symbol occurs reveals this
difference:

vanilla: nm cl_I_from_UDS.o
Name                                    Value        Type       Size
[...]
_ZN3cln15cl_class_bignumE        | 0000000000000000 | U | 0000000000000000
_ZN3cln8NDS_to_IEPKmm            | 0000000000000144 | T | 0000000000000008
[...]

reverted: nm cl_I_from_UDS.o
Name                                    Value        Type       Size
[...]
_ZN3cln15cl_class_bignumE        | 0000000000000000 | U | 0000000000000000
_ZN3cln8NDS_to_IEPKmm            | 0000000000000144 | t | 0000000000000008
_ZN3cln8NDS_to_IEPKmm            | 0000000000000000 | N | 0000000000000000
[...]

The offending text symbol `_ZN3cln8NDS_to_IEPKmm' demangles to
`cln::NDS_to_I(unsigned long const*, unsigned long)'.  Should it not
be a weak symbol, as is in the reverted case, since it is inlined?  Is
it okay to mark it .globl and .weakext?  Enabling the weak #pragma
with this patch (which isn't used in the library) shouldn't change
this, should it?

When linking any executable against the library I get zillions of
warnings "weak symbol multiply defined", which may just be a problem
of the linker.  But then again: why are there duplicates if above
we were told that the second definition is ignored?

Most worrying: all executables still build but simply segfault
immediately after calling into the library.

Could somebody with better knowledge of this stuff please review the
patch and comment on what may be going on there?  Unfortunately, I am
unable to get gdb to run on this system, otherwise I would have
debugged further.  I would even do so if somebody tells me where to
start but right now I'm completely stuck.

Regards
    -richy.

[0] <http://www.gnu.org/directory/CLN.html>

>How-To-Repeat:
If someone wants to give it a sad try, I recommend to configure CLN 
as simple as possible, i.e.:
$ export CPPFLAGS="-DNO_ASM -DNO_PROVIDE_REQUIRE"
$ ./configure --disable-shared --without-gmp
>Fix:
Remove the patch mentioned above.
>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the Gcc-bugs mailing list