Issue Details (XML | Word | Printable)

Key: STDCXX-585
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Blocker Blocker
Assignee: Farid Zaripov
Reporter: Farid Zaripov
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
C++ Standard Library

[gcc 4.2.0/Cygwin] linker errors due to multiple definition of `std::bad_cast::what()'; `std::bad_typeid::what()'; `std::bad_exception::what()'; `std::bad_alloc::what()'

Created: 11/Oct/07 06:07 PM   Updated: 26/Feb/08 03:15 PM
Return to search
Component/s: Configuration
Affects Version/s: 4.2.0
Fix Version/s: 4.2.1

Time Tracking:
Not Specified

File Attachments:
  Size
File Licensed for inclusion in ASF works BAD_ALLOC_ASSIGNMENT.cpp.diff 2007-11-22 06:59 PM Farid Zaripov 1 kB
Environment: gcc 4.2.0 / Cygwin
Issue Links:
Reference
 

Patch Info: Patch Available
Severity: Linker Error
Resolution Date: 19/Dec/07 01:45 PM


 Description  « Hide
When building the stdcxx on Cygwin I get errors like:

make: Entering directory `/usr/src/stdcxx/trunk/build/examples'
gcc -c -I/usr/src/stdcxx/trunk/include/ansi -D_RWSTDDEBUG -D_REENTRANT -mthreads -I/usr/src/stdcxx/trunk/include -I/usr/src/stdcxx/trunk/build/include -I/usr/src/stdcxx/trunk/examples/include -pedantic -nostdinc++ -g -W -Wall -Wcast-qual -Winline -Wshadow -Wwrite-strings -Wno-long-long -Wcast-align /usr/src/stdcxx/trunk/examples/manual/accumulate.cpp
gcc accumulate.o -o accumulate -mthreads -L/usr/src/stdcxx/trunk/build/lib -lstd15s -lsupc++ -lcatgets -liconv -lm
/usr/local/lib/gcc/i686-pc-cygwin/4.2.0/../../../libsupc++.a(tinfo.o): In function `ZNK10cxxabiv121vmi_class_type_info12do_dyncastEiNS_17class_type_info10sub_kindEPKS1_PKvS4_S6_RNS1_16_dyncast_resultE':
/usr/src/gcc-4.2.0/i686-pc-cygwin/libstdc+-v3/libsupc/../../.././libstdc-v3/libsupc+/tinfo.cc:418: multiple definition of `std::bad_cast::what() const'
/usr/src/stdcxx/trunk/build/lib/libstd15s.a(typeinfo.o):/usr/src/stdcxx/trunk/src/typeinfo.cpp:349: first defined here
/usr/local/lib/gcc/i686-pc-cygwin/4.2.0/../../../libsupc++.a(tinfo.o): In function `ZNK10cxxabiv121vmi_class_type_info12do_dyncastEiNS_17class_type_info10sub_kindEPKS1_PKvS4_S6_RNS1_16_dyncast_resultE':
/usr/src/gcc-4.2.0/i686-pc-cygwin/libstdc+-v3/libsupc/../../.././libstdc-v3/libsupc+/tinfo.cc:418: multiple definition of `std::bad_typeid::what() const'
/usr/src/stdcxx/trunk/build/lib/libstd15s.a(typeinfo.o):/usr/src/stdcxx/trunk/src/typeinfo.cpp:414: first defined here
/usr/local/lib/gcc/i686-pc-cygwin/4.2.0/../../../libsupc++.a(new_handler.o): In function `_ZNSt9bad_allocD2Ev':
/usr/src/gcc-4.2.0/i686-pc-cygwin/libstdc+-v3/libsupc/../../.././libstdc-v3/libsupc+/new_handler.cc:48: multiple definition of `std::bad_alloc::what() const'
/usr/src/stdcxx/trunk/build/lib/libstd15s.a(memory.o):/usr/src/stdcxx/trunk/src/memory.cpp:331: first defined here
/usr/local/lib/gcc/i686-pc-cygwin/4.2.0/../../../libsupc++.a(eh_exception.o): In function `_ZNSt13bad_exceptionD2Ev':
/usr/src/gcc-4.2.0/i686-pc-cygwin/libstdc+-v3/libsupc/../../.././libstdc-v3/libsupc+/eh_exception.cc:38: multiple definition of `std::bad_exception::what() const'
/usr/src/stdcxx/trunk/build/lib/libstd15s.a(exception.o):/usr/src/stdcxx/trunk/src/exception.cpp:412: first defined here
collect2: ld returned 1 exit status
make: *** [accumulate] Error 1



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Martin Sebor added a comment - 01/Nov/07 12:09 AM
Now that 4.2.0 is released, set Affects Version(s) accordingly.

Farid Zaripov added a comment - 22/Nov/07 06:59 PM
The patch is attached.

Farid Zaripov added a comment - 22/Nov/07 07:02 PM
ChangeLog:

2007-11-22 Farid Zaripov <farid_zaripov@epam.com>

STDCXX-585

  • BAD_ALLOC_ASSIGNMENT.cpp: Don't define ~bad_alloc() when
    testing the presence of the other members to avoid multiply
    defined sybmol linker errors.

Martin Sebor added a comment - 10/Dec/07 01:26 AM
I assume the patch has tested successfully with all compilers on both Linux and Windows. If that's correct, let's check it in and keep a close eye on all the other platforms to see what happens and be ready to revert it if it breaks things too badly.

Martin Sebor added a comment - 19/Dec/07 04:17 PM
FWIW, I would have preferred to commit this on trunk only and wait for a full set of results before merging it out to 4.2.1.

Farid Zaripov added a comment - 26/Feb/08 03:15 PM
It seems that this patch doesn't cause any problems on the another platforms.
Closing.