Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#862 closed bug (fixed)

libtranslator.so link errors under GCC4

Reported by: eNGIMa Owned by: axeld
Priority: normal Milestone:
Component: - General Version:
Keywords: Cc:
Blocked By: Blocking:
Has a Patch: no Platform: All

Description

When linking the libtranslator.so library the operation fails with many occurences of errors similar to:

TranslatorRoster.cpp:(.text+0xcce): undefined reference to `std::_Rb_tree_rebalance_for_erase(std::_Rb_tree_node_base*, std::_Rb_tree_node_base&)'
TranslatorRoster.cpp:(.text+0xcfb): undefined reference to `std::_Rb_tree_increment(std::_Rb_tree_node_base*)'
generated/objects/haiku/x86/release/kits/translation/TranslatorRoster.o: In function `BTranslatorRoster::Private::_FindTranslator(node_ref&)':
TranslatorRoster.cpp:(.text+0xeb3): undefined reference to `std::_Rb_tree_increment(std::_Rb_tree_node_base*)'
generated/objects/haiku/x86/release/kits/translation/TranslatorRoster.o: In function `BTranslatorRoster::Private::_FindTranslator(char const*) const':
TranslatorRoster.cpp:(.text+0xf1d): undefined reference to `std::_Rb_tree_increment(std::_Rb_tree_node_base const*)'
generated/objects/haiku/x86/release/kits/translation/TranslatorRoster.o: In function `BTranslatorRoster::Private::~Private()':
TranslatorRoster.cpp:(.text+0x1024): undefined reference to `std::_Rb_tree_increment(std::_Rb_tree_node_base*)'
TranslatorRoster.cpp:(.text+0x1051): undefined reference to `std::_Rb_tree_increment(std::_Rb_tree_node_base const*)'
generated/objects/haiku/x86/release/kits/translation/TranslatorRoster.o: In function `BTranslatorRoster::Private::~Private()':
TranslatorRoster.cpp:(.text+0x1a74): undefined reference to `std::_Rb_tree_increment(std::_Rb_tree_node_base*)'
TranslatorRoster.cpp:(.text+0x1aa1): undefined reference to `std::_Rb_tree_increment(std::_Rb_tree_node_base const*)'
generated/objects/haiku/x86/release/kits/translation/TranslatorRoster.o: In function `BTranslatorRoster::Private::~Private()':
TranslatorRoster.cpp:(.text+0x1d98): undefined reference to `std::_Rb_tree_increment(std::_Rb_tree_node_base*)'
TranslatorRoster.cpp:(.text+0x1dc5): undefined reference to `std::_Rb_tree_increment(std::_Rb_tree_node_base const*)'

Appears to not link against libstdc++. Managed to fix locally by adding $(TARGET_LIBSTDC++) to the SharedLibrary directive in the translator Jamfile. Unsure if this is a local build issue or reflects an underlying problem with newer compiler/linker.

Attachments (2)

stdcc.diff (2.7 KB ) - added by eNGIMa 13 years ago.
Added stdc++ to libraries linking against in some cases (Updated)
jamMediaKit (11.6 KB ) - added by eNGIMa 13 years ago.
Results from executing 'jam -q MediaKit' without patch

Download all attachments as: .zip

Change History (8)

comment:1 by korli, 13 years ago

Resolution: fixed
Status: newclosed

Seems the cpp headers in gcc4 need some code from libstdc++ (not everything is inline). It means we should link against libstdc++ anyway, because it highly depends on the implementation. Fixed in revision 18892. Please test.

comment:2 by eNGIMa, 13 years ago

Seems to work fine here. Though I've found a number of other occurences of similar stdc++ link errors which require fixes of the same type (A number of codecs, soundrecorder & mediaplayer, opengl).

Attaching a diff to fix the rest I've discovered.

by eNGIMa, 13 years ago

Attachment: stdcc.diff added

Added stdc++ to libraries linking against in some cases (Updated)

comment:3 by eNGIMa, 13 years ago

Maybe I should check these things more thoroughly, forgot one target. Just added stdc++ to the mp4_reader plugin and updated the attached diff which, in combination with the qoca fixes in #861, allows one to build the entire tree in GCC4 :D

comment:4 by korli, 13 years ago

Could you add the error log from your gcc4 build ? This could help to explain why we need to apply your patch. Thanks.

by eNGIMa, 13 years ago

Attachment: jamMediaKit added

Results from executing 'jam -q MediaKit' without patch

comment:5 by eNGIMa, 13 years ago

Above is results from executing 'jam -q MediaKit' from root of project directory with a fresh and updated build of binutils and haiku (Removed my generated directory previously due to other errors, though this still remains).

Errors to all libraries/plugins the first patch apply to involve similarly undefined references to standard exceptions or standard library internals (Eg, rb_tree internals).

comment:6 by korli, 13 years ago

Applied some build fixes you provided, as I checked the use of stdcpp headers in modules, in revision 18903.

Note: See TracTickets for help on using tickets.