From owner-freebsd-bugs Wed Aug 30 6: 0: 6 2000 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 31E0237B43E for ; Wed, 30 Aug 2000 06:00:01 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id GAA02682; Wed, 30 Aug 2000 06:00:01 -0700 (PDT) (envelope-from gnats@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 To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-1.0 Subject: gnu/20942: binutils break C++ in GCC 2.95.x and GCC-current Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >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 #include struct NAMESTABLE { map lookup; NAMESTABLE() : lookup() { cout << "constructor" << endl; } void add(const char *s, const int &item) { cout << s << endl; lookup.insert(pair(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