[prev in list] [next in list] [prev in thread] [next in thread]
List: freebsd-bugs
Subject: gnu/20942: binutils break C++ in GCC 2.95.x and GCC-current
From: pfeifer () dbai ! tuwien ! ac ! at
Date: 2000-08-30 12:54:51
[Download RAW message or body]
>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: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Wed Aug 30 06:00:00 PDT 2000
>Closed-Date:
>Last-Modified:
>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:
>Unformatted:
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic