Menu

#4 [PATCH] Make shared library dependencies be self-contained

Unstable_(example)
closed
None
1
2015-04-27
2015-03-20
No

A bunch of shared library dependencies in roccat-tools were left out since the binaries already depend on those libraries, but this interferes with the library dependency inference features of package managers such as RPM and DEB, so it is not guaranteed to work at run-time on all systems. This patch makes all shared library dependencies be self-contained so that every binary and shared library in roccat-tools can resolve all of its symbols from just its own dependencies. Also removes a few unused dependencies.

Applies to 3.2.0.

1 Attachments

Discussion

  • Stefan Achatz

    Stefan Achatz - 2015-03-31

    Didn't apply the patch but did the following to hopefully end symbol problems:

    • Added "-Wl,--no-undefined" to compiler options so I get linker errors on missing symbols.

    • Cleared LINK_INTERFACE_LIBRARIES target property for all libraries. This way project internal dependencies of link libraries are not transient anymore.

    • Using "ldd -r -u" on all libraries and executables to get info on overlinking.

    These things led to a lot of changes in TARGET_LINK_LIBRARIES which are part of the next roccat-tools release. No unresolved symbols anymore and eliminated project internal overlinking.

     
  • Stefan Achatz

    Stefan Achatz - 2015-03-31
    • status: open --> closed
     
  • Tristan Schmelcher

    Sounds great! Is the roccat-tools development tree online somewhere? I couldn't find it.

     
  • Tristan Schmelcher

    It didn't quite work. The -Wl,--no-undefined is on the compile command line instead of the link command line so it's doing nothing. I'm attaching a patch against 3.3.0 that moves it to the linking command line and fixes the resulting errors. Also verified with ldd -r -u that there is no overlinking.

    (FYI, if you want to prevent overlinking entirely, you could try also adding -Wl,--as-needed.)

     
  • Stefan Achatz

    Stefan Achatz - 2015-04-26

    Didn't apply the patch, but built the dependency list myself (In your patch libroccatkonepluswidget has itself as link dependency?).
    --no-undefined is correctly used now.
    --as-needed is added to only optimize release builds.
    Did this also for libgaminggear.

     
  • Tristan Schmelcher

    Good catch. I'm surprised it built successfully for me. :P

     

Anonymous
Anonymous

Add attachments
Cancel