gnu/58099: g++ -fhuge-objects on ix86 coredumps upon use of
robertc at squid-cache.org
Wed Oct 15 19:10:19 PDT 2003
>Synopsis: g++ -fhuge-objects on ix86 coredumps upon use of std::ostringstream
>Arrival-Date: Wed Oct 15 19:10:15 PDT 2003
>Originator: Robert Collins
>Release: FreeBSD 4.9-PRERELEASE i386
System: FreeBSD squid-cache.org 4.9-PRERELEASE FreeBSD 4.9-PRERELEASE #1: Tue Sep 16 13:13:50 MDT 2003 wessels at squid-cache.org:/usr/obj/usr/src/sys/SQUID i386
Using g++ 2.95.4, the test case :
int main(int argc, char **argv)
foo << "hello" << "hello" << std::endl;
std::cout << foo.str() ;
Will coredump if the option -fhuge-objects is supplied to g++. My understanding is that their needs to be a separate libstdc++ for use when -fhuge-objects is supplied, IFF -fhuge-objects is not a no-op.
We encountered this in squid, where our configure tests for a working -fhuge-objects flag, to enable it on systems that need it. We didn't try to run the resulting program, as the c++ compiler should Do The Right Thing...
Compile the above program with g++ -fhuge-objects, then run the resulting program.
Build a -fhuge-objects version of libstdc++ and alter the specs file to use it when appropriate. This affects previous versions of FreeBSD too... Alternatively, make -fhuge-objects on i386 a no-op, such that the std library is compatible.
More information about the freebsd-bugs