|
Eric Lemings made changes - 19/Jul/06 10:50 PM
Thanks for the update! From the gcc issue (and the referenced patch) it seems that the problem could be due to the inline definitions of some of the virtual member functions implicitly generated by the compiler. Which makes me wonder if we could fix it by defining the functions explicitly and out of line (as we normally do for the runtime classes).
I assume the patch fixes the problem. Let me close the issue. Brad, please reopen it if there's still a problem.
Martin Sebor made changes - 19/Mar/07 04:34 PM
I'd need to do a little more digging, but I experienced what appears to be the same problem over the weekend when running a build on my home box. I don't have the logs with me though, so I can't be certain that it's the same issue.
For reference, I'm using a G4 running OS X 10.4.9. I took some time yesterday to verify that I am still observing this issue with the GCC 4.0.1 compiler using trunk as of yesterday morning, and confirm that I am. This action was prompted in part by a belated revisit of the issue in response to http://mail-archives.apache.org/mod_mbox/incubator-stdcxx-dev/200705.mbox/%3c4651F759.9050709@roguewave.com%3e
Note that I have changed hardware for my primary development system from the G4 to a Intel Core Duo.
Andrew Black made changes - 08/Jun/07 05:17 PM
Sounds like the "fix" is to use a more recent version of gcc. Lowered priority until this is confirmed.
Martin Sebor made changes - 05/Jul/07 02:56 AM
Martin Sebor made changes - 26/Sep/07 09:51 PM
This is still a problem with the latest trunk and the latest gcc 4.0.1/Xcode 2.0:
gcc -c -I/Users/sebor/stdcxx/include/ansi -D_RWSTDDEBUG -I/Users/sebor/stdcxx/include -I/build/sebor/stdcxx-gcc-4.0.1-11s/include -I/Users/sebor/stdcxx/examples/include -pedantic -nostdinc++ -g -W -Wall -Wcast-qual -Winline -Wshadow -Wwrite-strings -Wno-long-long -Wcast-align /Users/sebor/stdcxx/examples/manual/accumulate.cpp Set Priority to Critical (it would be a Blocker if it weren't for the reports that gcc 4.2.0 works).
Set Severity to Linker Error.
Martin Sebor made changes - 27/Sep/07 12:10 AM
Here's an analysis of what's going on in stdcxx:
1, On Mac OS X, gcc 4.0.1 doesn't generate a vtable for class E in the test case below (which is as expected given that the class dtor isn't defined) but it does so for class D (which is not expected because this dtor also isn't defined), even though there is no "real" difference between the two classes other than the order in which the members are declared. 2. We declare members of std::exception, std::bad_exception, and std::bad_alloc in the same order as those in class D below, i.e., the dtor comes before the other virtual member function. Since we also define some virtual members of these classes (based on the results of config tests which determine that some members are not defined in libsupc+), the vtable for each is generated in the object file where the other members are defined. Since the vtable for all these classes also exists in libsupc+ (that's where the virtual dtor and what() are defined), we end up with two vtables for each class. 3. Given the above, we should be able to work around the problem by reversing the declaration order of the virtual dtor and the other virtual member (what()) so as to trick the compiler into not generating the vtable in our objects. $ cat t.cpp && uname -srp && gcc -dumpversion && gcc -c t.cpp && nm t.o | c++filt | grep "S vtable" struct D: B { struct E: B { void D::foo () { } Darwin 8.7.1 i386
Martin Sebor made changes - 27/Sep/07 12:36 AM
Attached a patch tested with gcc 4.0.1 on Darwin/x86, gcc 3.4.6 on FreeBSD 6.2/x86, and Intel C++ 9.1 on Red Hat Enterprise Linux AS release 4, Update 2/IA64.
ChangeLog: 2007-09-26 Martin Sebor <sebor@roguewave.com>
Martin Sebor made changes - 27/Sep/07 01:51 AM
Martin Sebor made changes - 27/Sep/07 01:51 AM
Brad, can you verify that the patch fixes the problem in your environment?
I just did a build on the latest snapshot of trunk. Looks okay.
Martin Sebor made changes - 12/Oct/07 07:39 PM
Martin Sebor made changes - 16/Oct/07 04:39 PM
Looks like the patch committed at rev 583667 (http://svn.apache.org/viewcvs?view=rev&rev=583667
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25908
for more details.