From owner-freebsd-bugs Wed Oct 18 20:21:18 2000 Delivered-To: freebsd-bugs@freebsd.org Received: from smtp2.port.ru (mx2.port.ru [194.67.23.33]) by hub.freebsd.org (Postfix) with ESMTP id E0A9C37B4C5 for ; Wed, 18 Oct 2000 20:21:11 -0700 (PDT) Received: from adsl-141-154-116-32.bostma.adsl.bellatlantic.net ([141.154.116.32] helo=kan.dnsalias.net) by smtp2.port.ru with esmtp (Exim 3.14 #30) id 13m6GJ-000MdI-00; Thu, 19 Oct 2000 07:21:10 +0400 Received: (from kan@localhost) by kan.dnsalias.net (8.11.0/8.11.0) id e9J3K7d46626; Wed, 18 Oct 2000 23:20:07 -0400 (EDT) (envelope-from kan) Message-ID: X-Mailer: XFMail 1.4.0 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 Date: Wed, 18 Oct 2000 23:19:41 -0400 (EDT) From: "Alexander N. Kabaev" To: (Yifeng Xu) Subject: Re: gnu/20966: binutils break C++ in GCC 2.95.x and GCC-current Cc: freebsd-bugs@freebsd.org Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >I also report the problem a few months ago, >On FreeBSD 4.x, some C++ programs can work under Linux >but not FreeBSD, example code: Pardon me, but what gives you idea that this problem is even related to the problem I was writing about? Your test case works just fine when compiled as C and fails only when compiled by the C++ frontend. I wouldn't blame FreeBSD for what seems to be genuine CCC bug. The bug was introduced somewhen in between last EGCS and FSF GCC 2.95 releases. That explains why your code always works on Linux, because your Linux distribution is most likely running older EGCS version, while FreeBSD has imported GCC 2.95.2 into the base system quite some time ago. Anyway, I tried to figure out what is wrong with latest stable and development GCC versions and the bug was pretty easy to find. I've already submitted appropriate fixes to the gcc-patches mailing list, you can find them there if you really need. It remains to be seen if GCC guys will approve these patches. PS. Using attribute((constructor)) functions in C++ code seems strange for me. Why can't you just use static object with constructor? This approach is working everywhere and is way more portable. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message