tensor5/arch-atom

Unused shared libraries

Closed this issue · 6 comments

These are namcap warnings for atom and electron packages, reproducible with

$ ldd -r -u /usr/lib/electron/electron
Unused direct dependencies:
    /usr/lib/libplc4.so
    /usr/lib/libexpat.so.1
$ ldd -r -u /usr/lib/atom/node_modules/scrollbar-style/build/Release/scrollbar-style-observer.node
Unused direct dependencies:
    /usr/lib/libpthread.so.0

(same output with keyboard-layout-observer.node and cached-run-in-this-context.node).

In electron-0.35.4-1, /usr/lib/libcups.so.2 also appeared in the list of unused direct dependencies; this was fixed in ccb6897 by removing a -lcups. Removing -lplc4 and -lexpat in the same file causes a link error.

As of Electron 1.2.0 (02abadd) there are no more unused direct dependencies in that binary. However, for a more stable solution we should get rid of the -Wl,--whole-archive flag in brightray.gyp.

The -Wl,--whole-archive flag was removed from Electron in 10d31b6. This fixes one part of this issue.

Currently the only unused shared libraries are in Atom; this is the relevant namcap output:

atom W: Unused shared library '/usr/lib/libpthread.so.0' by file ('usr/lib/atom/node_modules/spellchecker/build/Release/spellchecker.node')
atom W: Unused shared library '/usr/lib/libpthread.so.0' by file ('usr/lib/atom/node_modules/scrollbar-style/build/Release/scrollbar-style-observer.node')
atom W: Unused shared library '/usr/lib/libpthread.so.0' by file ('usr/lib/atom/node_modules/nslog/build/Release/nslog.node')
atom W: Unused shared library '/usr/lib/libpthread.so.0' by file ('usr/lib/atom/node_modules/marker-index/build/Release/marker_index.node')
atom W: Unused shared library '/usr/lib/libpthread.so.0' by file ('usr/lib/atom/node_modules/keyboard-layout/build/Release/keyboard-layout-observer.node')
atom W: Unused shared library '/usr/lib/libpthread.so.0' by file ('usr/lib/atom/node_modules/cached-run-in-this-context/build/Release/cached-run-in-this-context.node')

According to this GCC bug report this is a consequence of the fact that pthread symbols are referenced through weak symbols, therefore we cannot do anything here other than closing the issue.

The linked bug is closed as EOL, but it still exists even on arch. Is there any more information about that, as this github issue is the first hit about this issue?

I've seen this error in multiple packages now and its really annoying.

It bothers me too, but apparently according to the link above this is a "feature" of GCC C++ runtime.