Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 Oct 2000 23:19:41 -0400 (EDT)
From:      "Alexander N. Kabaev" <kabaev@mail.ru>
To:        (Yifeng Xu) <websoft@yahoo.com>
Cc:        freebsd-bugs@freebsd.org
Subject:   Re: gnu/20966: binutils break C++ in GCC 2.95.x and GCC-current
Message-ID:  <XFMail.001018231941.kabaev@mail.ru>

next in thread | raw e-mail | index | archive | help
>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




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