Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 2 Apr 1998 17:59:19 -0800 (PST)
From:      yergeau@gloworm.stanford.edu
To:        FreeBSD-gnats-submit@FreeBSD.ORG
Cc:        yergeau@gloworm.stanford.edu
Subject:   bin/6198: /bin/ld's demangling of C++ names breaks -frepo feature of egcs
Message-ID:  <199804030159.RAA06174@localhost.Stanford.EDU>

next in thread | raw e-mail | index | archive | help

>Number:         6198
>Category:       bin
>Synopsis:       demangling C++ names breaks the Cygnus -frepo hack
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:
>Keywords:
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Apr  2 18:00:01 PST 1998
>Last-Modified:
>Originator:     Dan Yergeau
>Organization:
>Release:        FreeBSD 2.2.5-RELEASE i386
>Environment:

FreeBSD 2.2.5-RELEASE
gcc-2.7.2.x  with the gcc-2.7.2-repo-bsd.patch
or egcs-1.0.2 with tlink.c replaced by the one from the above patch

>Description:

If /usr/bin/ld demangles C++ names, the automatic template
instantiation feature added by the Cygnus -frepo/tlink hack (also in
egcs) breaks.  The -frepo/tlink hack relies on raw encoded names
being reported as missing symbols so that collect2 knows what needs
to be recompiled in order to instantiate templates.

>How-To-Repeat:

>Fix:

Although it is nice to have the names demangled automatically, ld is
probably not the best place to do it (or, at least not as a
compiled-in default).  I'll suggest either 

 1) altering the current hardcoded demangling to be selectable by a
    ld option or an environment variable (off by default, but would
    be turned on by the /usr/bin/{gcc,c++,g++} drivers).

 2) disabling the current hardcoded demangling and just alter the
    compiler driver to pipe ld output through c++filt (or redirect
    to a file and filter that file).  The only potential gotcha is
    in handling stdout vs. stderr.

No other ld that I know of tries to demangle C++ names.  Compilers
that appear to do so (e.g. Sun's SC4.x CC) seem to use the second
approach.

I'm a little suprised that neither FSF nor Cygnus have implemented
demangling ld errors.


Dan

>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199804030159.RAA06174>