[ https://issues.apache.org/jira/browse/MESOS-6658?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15715470#comment-15715470 ]
Benjamin Bannier commented on MESOS-6658: ----------------------------------------- One crucial difference between the cmake and the autotools build is that the autotools build explicitly requests {{-Wl,--as-needed}} under Linux, while the cmake build just inherits the default behavior of the linker. AFAIK e.g., Fedora enable {{-Wl,--as-needed}} systemwide and by default, while e.g., Debian-based distros (Debian & Ubuntu) do not. This seems to nicely overlap with were these bad binaries are created. To test this out I added {{-Wl,--as-needed}} to the {{CMAKE_SHARED_LINKER_FLAGS}} on a ubuntu-14 host, and was indeed able to unload a {{src/mesos-tests}} created with the cmake setup successfully. I am not sure this is a problem in the cmake build; it seems more that the autotools build explicitly masks a problem, and we see that only in the cmake build which didn't behave identical. It seems desirable to have the build produce good binaries no matter whether {{-Wl,--as-needed}} was used or not, as e.g., some systems use versions of {{ld}} which overeagerly might drop even required dependencies (e.g., in cases where dependencies do not model their own dependencies correctly). > Mesos tests generated with cmake build fail to unload libraries properly > ------------------------------------------------------------------------ > > Key: MESOS-6658 > URL: https://issues.apache.org/jira/browse/MESOS-6658 > Project: Mesos > Issue Type: Bug > Components: cmake, tests > Affects Versions: 1.2.0 > Reporter: Benjamin Bannier > Assignee: Joseph Wu > Labels: mesosphere > > A default cmake build created from {{ec0546e}} creates a {{mesos-tests}} > which cannot unload dependency without an error, > {code} > $ ./src/mesos-tests --gtest_filter='' > Source directory: /vagrant > Build directory: /home/vagrant/mesos > Note: Google Test filter = > [==========] Running 0 tests from 0 test cases. > [==========] 0 tests from 0 test cases ran. (0 ms total) > [ PASSED ] 0 tests. > Inconsistency detected by ld.so: dl-close.c: 762: _dl_close: Assertion > `map->l_init_called' failed! > {code} > This problem appears e.g., ubuntu-14.04 with cmake-2.8.12, but also on > debian-8, or ubuntu-16. -- This message was sent by Atlassian JIRA (v6.3.4#6332)