From nobody@FreeBSD.ORG  Wed Aug 30 05:54:51 2000
Return-Path: <nobody@FreeBSD.ORG>
Received: by hub.freebsd.org (Postfix, from userid 32767)
	id 12B8E37B43C; Wed, 30 Aug 2000 05:54:51 -0700 (PDT)
Message-Id: <20000830125451.12B8E37B43C@hub.freebsd.org>
Date: Wed, 30 Aug 2000 05:54:51 -0700 (PDT)
From: pfeifer@dbai.tuwien.ac.at
Sender: nobody@FreeBSD.ORG
To: freebsd-gnats-submit@FreeBSD.org
Subject: binutils break C++ in GCC 2.95.x and GCC-current
X-Send-Pr-Version: www-1.0

>Number:         20942
>Category:       gnu
>Synopsis:       binutils break C++ in GCC 2.95.x and GCC-current
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Aug 30 06:00:00 PDT 2000
>Closed-Date:    Sun Nov 5 04:30:32 PST 2000
>Last-Modified:  Sun Nov 05 04:31:22 PST 2000
>Originator:     Gerald Pfeifer
>Release:        FreeBSD 4.1-RELEASE
>Organization:
>Environment:
FreeBSD deneb.dbai.tuwien.ac.at 4.1-RELEASE FreeBSD 4.1-RELEASE #0:
Thu Jul 27 04:44:16 GMT 2000     root@usw4.freebsd.org:/usr/src/sys/compile/GENERIC  i386
>Description:
Apparently binutils as of 4.1-RELEASE break static constructors in C++
for GCC 2.95.x and GCC-current. Both work fine (w/o FreeBSD patches) on
FreeBSD 3.x and also GCC 2.95.2 as shipped with 4.1-RELEASE is fine.

I assume that there is a problem (change) in binutils on 4.1-RELEASE that
causes this breakage and that has been fixed (also made) in the imported
version of GCC?
>How-To-Repeat:
Compile and run the following small C++ program with either GCC 2.95.2
(original version, w/o FreeBSD patches) or GCC-current and you'll get
a core dump as the static constructor is not invoked.

GCC as shipped with 4.1-RELEASE is not affected.

-------- cut --------
#include <map>
#include <iostream>

struct NAMESTABLE
    {
    map<int,int> lookup;

    NAMESTABLE()
        : lookup()
        {
        cout << "constructor" << endl;
        }

    void add(const char *s, const int &item)
        {
        cout << s << endl;
        lookup.insert(pair<int,int>(item,0));
        }
    };

NAMESTABLE q;

int main() {
    NAMESTABLE p;
    p.add("auto",1);
    q.add("static",1);
    }
>Fix:
1. Fix (the local copy?) of binutils.
2. If it is a GCC bug (which I don't believe) submit the change back
   to the GCC maintainers.

>Release-Note:
>Audit-Trail:

From: Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
To: <freebsd-gnats-submit@freebsd.org>
Cc:  
Subject: Re: gnu/20942: binutils break C++ in GCC 2.95.x and GCC-current
Date: Sun, 5 Nov 2000 09:17:53 +0100 (CET)

 Please close this PR. It is a duplicate of 20966 and originally
 was ``lost'' by GNATS so that sheldonh asked me to file it again
 (which led to 20966).
 
 This weekend 20942, after a few weeks(!) 20942 finally appeared in
 GNATS, but 20966 has been worked on already.
 
 Gerald
 -- 
 Gerald "Jerry" pfeifer@dbai.tuwien.ac.at http://www.dbai.tuwien.ac.at/~pfeifer/
 
 
State-Changed-From-To: open->closed 
State-Changed-By: johan 
State-Changed-When: Sun Nov 5 04:30:32 PST 2000 
State-Changed-Why:  
Closed at originators request. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=20942 
>Unformatted:
