When building qt-3.3.8 and wxGTk on Tru64 UNIX 5.1 (alphaev67-dec-osf5.1) with gcc-4.2.4, we got linker failures about duplicate non-virtual thunks, e.g. from qt: /usr/ccs/bin/ld: .obj/release-shared-mt/qmotifdnd_x11.o: non-virtual thunk to QDragMoveEvent::~QDragMoveEvent(): multiply defined .obj/release-shared-mt/qmotifdnd_x11.o: non-virtual thunk to QDragMoveEvent::~QDragMoveEvent(): multiply defined .obj/release-shared-mt/qmotifdnd_x11.o: non-virtual thunk to QDragEnterEvent::~QDragEnterEvent(): multiply defined .obj/release-shared-mt/qmotifdnd_x11.o: non-virtual thunk to QDragEnterEvent::~QDragEnterEvent(): multiply defined
This appears to be because the non-virtual thunks are not output weak on this platform, so, those that appear in multiple objects will cause linker errors like this (in the above case, there are _ZThn16_N14QDragMoveEventD0Ev and _ZThn16_N14QDragMoveEventD1Ev in both qdnd_x11.o and qmotifdnd_x11.o). This is easily reproducible, for example, compiling a slightly modified version of dllexport-MI1.C from the g++ testsuite. With gcc-4.2.4: % g++ -c -o dllexport-MI1.o dllexport-MI1.C; nm -wB dllexport-MI1.o | grep Thn 0x00000000000000 N $_ZThn8_N3MI1D0Ev..ng 0x00000000000000 N $_ZThn8_N3MI1D1Ev..ng 0x00000000000000 N $_ZThn8_NK3MI12vfEv..ng 0x00000000000854 T _ZThn8_N3MI1D0Ev 0x00000000000910 T _ZThn8_N3MI1D1Ev 0x00000000000208 T _ZThn8_NK3MI12vfEv When compared to gcc-3.4.3: g++ -c -o dllexport-MI1.o dllexport-MI1.C; nm -wB dllexport-MI1.o | grep Thn 0x00000000000000 N $_ZThn8_N3MI1D0Ev..ng 0x00000000000000 N $_ZThn8_N3MI1D1Ev..ng 0x00000000000000 N $_ZThn8_NK3MI12vfEv..ng 0x00000000000344 T* _ZThn8_N3MI1D0Ev 0x00000000000548 T* _ZThn8_N3MI1D1Ev 0x000000000001f0 T* _ZThn8_NK3MI12vfEv The '*' in the nm output indicates a weak symbol. -- Summary: Tru64 outputs non-virtual thunks as non-weak symbols Product: gcc Version: 4.2.4 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: bugzilla-gcc at thewrittenword dot com GCC host triplet: alphaev67-dec-osf5.1 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38581