Bug 1352931 - -fvisibility=hidden parameter causes linker error when compiling ROS against gazebo
Summary: -fvisibility=hidden parameter causes linker error when compiling ROS against ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: gazebo
Version: 24
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Rich Mattes
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-07-05 14:08 UTC by Whistler
Modified: 2016-07-18 18:25 UTC (History)
2 users (show)

Fixed In Version: gazebo-6.5.1-5.fc24
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-07-18 18:25:59 UTC
Type: Bug


Attachments (Terms of Use)

Description Whistler 2016-07-05 14:08:43 UTC
Description of problem:

When compiling ROS (http://www.ros.org), the following error happens when compiling a component which requires gazebo:

/usr/lib64/player/libgazebo_player.so: undefined reference to `gazebo_shared::printVersion()'
/usr/lib64/player/libgazebo_player.so: undefined reference to `gazebo_shared::addPlugin(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::vector<boost::shared_ptr<gazebo::SystemPlugin>, std::allocator<boost::shared_ptr<gazebo::SystemPlugin> > >&)'
/usr/lib64/player/libgazebo_player.so: undefined reference to `gazebo_shared::setup(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int, char**, std::vector<boost::shared_ptr<gazebo::SystemPlugin>, std::allocator<boost::shared_ptr<gazebo::SystemPlugin> > >&)'

After removing the -fvisibility=hidden flag from CMakeLists.txt of Gazebo and rebuild the RPM, the bug is solved.

Version-Release number of selected component (if applicable):
gazebo-6.5.1-4.fc24

How reproducible:
Always

Steps to Reproduce:
1. Install gazebo and other dependencies for ROS.
2. Download ROS source code.
3. Compile ROS

Actual results:
Fail to compile, the following error happens:

/usr/lib64/player/libgazebo_player.so: undefined reference to `gazebo_shared::printVersion()'
/usr/lib64/player/libgazebo_player.so: undefined reference to `gazebo_shared::addPlugin(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::vector<boost::shared_ptr<gazebo::SystemPlugin>, std::allocator<boost::shared_ptr<gazebo::SystemPlugin> > >&)'
/usr/lib64/player/libgazebo_player.so: undefined reference to `gazebo_shared::setup(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int, char**, std::vector<boost::shared_ptr<gazebo::SystemPlugin>, std::allocator<boost::shared_ptr<gazebo::SystemPlugin> > >&)'

Expected results:
Compiles successfully

Additional info:

There is another bug of the cmake script of gazebo which lacks the "/usr/lib64/player" library directory, which causes the libgazebo_player.so cannot be found.

Comment 1 Rich Mattes 2016-07-05 23:19:49 UTC
Thanks for the report.

I'm pretty sure the root cause of the problem is that gazebo-config.cmake is including gazebo_player in its list of gazebo libraries.  gazebo_player is a plugin library meant to be dlopened by Player at runtime; it shouldn't ever be linked to anything building against gazebo.  I moved libgazebo_player to Player's private plugin folder (/usr/lib64/player) for that reason, but didn't remove a reference to gazebo_player in Gazebo's CMakeLists.txt (which resulted in it being added to gazebo-config.cmake)

The fact that gazebo_player is trying to access private symbols is also a bug, and prevents it from being dlopened by Player.  I was able to reproduce what you're seeing with libgazebo_player:

$ ldd -r /usr/lib64/player/libgazebo_player.so  |grep undefined
undefined symbol: _ZNK5boost16re_detail_10600031cpp_regex_traits_implementationIcE17transform_primaryEPKcS4_	(/lib64/libsdformat.so.3)
undefined symbol: _ZNK5boost16re_detail_10600031cpp_regex_traits_implementationIcE9transformEPKcS4_	(/lib64/libsdformat.so.3)
undefined symbol: _ZN6gazebo7physics10init_worldEN5boost10shared_ptrINS0_5WorldEEE	(/usr/lib64/player/libgazebo_player.so)
undefined symbol: _ZN6gazebo7physics4loadEv	(/usr/lib64/player/libgazebo_player.so)
undefined symbol: _ZN6gazebo7physics10load_worldEN5boost10shared_ptrINS0_5WorldEEENS2_IN3sdf7ElementEEE	(/usr/lib64/player/libgazebo_player.so)...

The first bug is easy to fix - I will verify that gazebo_player is removed from gazebo-config.cmake and push an update.  The second problem is less straightforward, I will coordinate with upstream and make sure the symbols gazebo_player is using are visible.

Gazebo and sdformat are also both affected by rhbz#1331983 which I just discovered, so I need to rebuilt sdformat as well.

Comment 2 Fedora Update System 2016-07-06 12:47:54 UTC
gazebo-6.5.1-5.fc24 sdformat-3.7.0-4.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2016-3074c529e4

Comment 3 Fedora Update System 2016-07-10 16:00:50 UTC
gazebo-6.5.1-5.fc24, sdformat-3.7.0-4.fc24 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-3074c529e4

Comment 4 Fedora Update System 2016-07-18 18:25:21 UTC
gazebo-6.5.1-5.fc24, sdformat-3.7.0-4.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.